4646 EmbeddingModelConfig ,
4747 JiraSource ,
4848 LayoutParserConfig ,
49+ LlmParserConfig ,
4950 Pinecone ,
5051 RagCorpus ,
5152 RagFile ,
@@ -475,6 +476,7 @@ def import_files(
475476 use_advanced_pdf_parsing : Optional [bool ] = False ,
476477 partial_failures_sink : Optional [str ] = None ,
477478 layout_parser : Optional [LayoutParserConfig ] = None ,
479+ llm_parser : Optional [LlmParserConfig ] = None ,
478480) -> ImportRagFilesResponse :
479481 """
480482 Import files to an existing RagCorpus, wait until completion.
@@ -592,7 +594,10 @@ def import_files(
592594 to the table.
593595 layout_parser: Configuration for the Document AI Layout Parser Processor
594596 to use for document parsing. Optional.
595- If not None,`use_advanced_pdf_parsing` must be False.
597+ If not None, the other parser configs must be None.
598+ llm_parser: Configuration for the LLM Parser to use for document parsing.
599+ Optional.
600+ If not None, the other parser configs must be None.
596601 Returns:
597602 ImportRagFilesResponse.
598603 """
@@ -605,6 +610,15 @@ def import_files(
605610 "Only one of use_advanced_pdf_parsing or layout_parser may be "
606611 "passed in at a time"
607612 )
613+ if use_advanced_pdf_parsing and llm_parser is not None :
614+ raise ValueError (
615+ "Only one of use_advanced_pdf_parsing or llm_parser may be "
616+ "passed in at a time"
617+ )
618+ if layout_parser is not None and llm_parser is not None :
619+ raise ValueError (
620+ "Only one of layout_parser or llm_parser may be passed in at a time"
621+ )
608622 corpus_name = _gapic_utils .get_corpus_name (corpus_name )
609623 request = _gapic_utils .prepare_import_files_request (
610624 corpus_name = corpus_name ,
@@ -617,6 +631,7 @@ def import_files(
617631 use_advanced_pdf_parsing = use_advanced_pdf_parsing ,
618632 partial_failures_sink = partial_failures_sink ,
619633 layout_parser = layout_parser ,
634+ llm_parser = llm_parser ,
620635 )
621636 client = _gapic_utils .create_rag_data_service_client ()
622637 try :
@@ -638,6 +653,7 @@ async def import_files_async(
638653 use_advanced_pdf_parsing : Optional [bool ] = False ,
639654 partial_failures_sink : Optional [str ] = None ,
640655 layout_parser : Optional [LayoutParserConfig ] = None ,
656+ llm_parser : Optional [LlmParserConfig ] = None ,
641657) -> operation_async .AsyncOperation :
642658 """
643659 Import files to an existing RagCorpus asynchronously.
@@ -755,7 +771,10 @@ async def import_files_async(
755771 to the table.
756772 layout_parser: Configuration for the Document AI Layout Parser Processor
757773 to use for document parsing. Optional.
758- If not None,`use_advanced_pdf_parsing` must be False.
774+ If not None, the other parser configs must be None.
775+ llm_parser: Configuration for the LLM Parser to use for document parsing.
776+ Optional.
777+ If not None, the other parser configs must be None.
759778 Returns:
760779 operation_async.AsyncOperation.
761780 """
@@ -768,6 +787,15 @@ async def import_files_async(
768787 "Only one of use_advanced_pdf_parsing or layout_parser may be "
769788 "passed in at a time"
770789 )
790+ if use_advanced_pdf_parsing and llm_parser is not None :
791+ raise ValueError (
792+ "Only one of use_advanced_pdf_parsing or llm_parser may be "
793+ "passed in at a time"
794+ )
795+ if layout_parser is not None and llm_parser is not None :
796+ raise ValueError (
797+ "Only one of layout_parser or llm_parser may be passed in at a time"
798+ )
771799 corpus_name = _gapic_utils .get_corpus_name (corpus_name )
772800 request = _gapic_utils .prepare_import_files_request (
773801 corpus_name = corpus_name ,
@@ -780,6 +808,7 @@ async def import_files_async(
780808 use_advanced_pdf_parsing = use_advanced_pdf_parsing ,
781809 partial_failures_sink = partial_failures_sink ,
782810 layout_parser = layout_parser ,
811+ llm_parser = llm_parser ,
783812 )
784813 async_client = _gapic_utils .create_rag_data_service_async_client ()
785814 try :
0 commit comments