@@ -73,11 +73,18 @@ def create_corpus(
7373 corpus_type_config : Optional [RagCorpusTypeConfig ] = None ,
7474 embedding_model_config : Optional [EmbeddingModelConfig ] = None ,
7575 vector_db : Optional [
76- Union [Weaviate , VertexFeatureStore , VertexVectorSearch , Pinecone , RagManagedDb ]
76+ Union [
77+ Weaviate ,
78+ VertexFeatureStore ,
79+ VertexVectorSearch ,
80+ Pinecone ,
81+ RagManagedDb ,
82+ ]
7783 ] = None ,
7884 vertex_ai_search_config : Optional [VertexAiSearchConfig ] = None ,
7985 backend_config : Optional [RagVectorDbConfig ] = None ,
8086 encryption_spec : Optional [EncryptionSpec ] = None ,
87+ timeout : int = 600 ,
8188) -> RagCorpus :
8289 """Creates a new RagCorpus resource.
8390
@@ -95,21 +102,22 @@ def create_corpus(
95102
96103 Args:
97104 display_name: If not provided, SDK will create one. The display name of
98- the RagCorpus. The name can be up to 128 characters long and can consist
99- of any UTF-8 characters.
105+ the RagCorpus. The name can be up to 128 characters long and can consist
106+ of any UTF-8 characters.
100107 description: The description of the RagCorpus.
101108 corpus_type_config: The corpus type config of the RagCorpus.
102109 embedding_model_config: The embedding model config.
103110 Note: Deprecated. Use backend_config instead.
104111 vector_db: The vector db config of the RagCorpus. If unspecified, the
105- default database Spanner is used.
112+ default database Spanner is used.
106113 Note: Deprecated. Use backend_config instead.
107114 vertex_ai_search_config: The Vertex AI Search config of the RagCorpus.
108115 Note: embedding_model_config or vector_db cannot be set if
109- vertex_ai_search_config is specified.
116+ vertex_ai_search_config is specified.
110117 backend_config: The backend config of the RagCorpus. It can specify a
111- Vector DB and/or the embedding model config.
118+ Vector DB and/or the embedding model config.
112119 encryption_spec: The encryption spec of the RagCorpus.
120+ timeout: Default is 600 seconds.
113121
114122 Returns:
115123 RagCorpus.
@@ -186,7 +194,7 @@ def create_corpus(
186194 response = client .create_rag_corpus (request = request )
187195 except Exception as e :
188196 raise RuntimeError ("Failed in RagCorpus creation due to: " , e ) from e
189- return _gapic_utils .convert_gapic_to_rag_corpus (response .result (timeout = 600 ))
197+ return _gapic_utils .convert_gapic_to_rag_corpus (response .result (timeout = timeout ))
190198
191199
192200def update_corpus (
@@ -204,6 +212,7 @@ def update_corpus(
204212 ] = None ,
205213 vertex_ai_search_config : Optional [VertexAiSearchConfig ] = None ,
206214 backend_config : Optional [RagVectorDbConfig ] = None ,
215+ timeout : int = 600 ,
207216) -> RagCorpus :
208217 """Updates a RagCorpus resource.
209218
@@ -231,12 +240,13 @@ def update_corpus(
231240 description will not be updated.
232241 vector_db: The vector db config of the RagCorpus. If not provided, the
233242 vector db will not be updated.
234- vertex_ai_search_config: The Vertex AI Search config of the RagCorpus.
235- If not provided, the Vertex AI Search config will not be updated.
243+ vertex_ai_search_config: The Vertex AI Search config of the RagCorpus. If
244+ not provided, the Vertex AI Search config will not be updated.
236245 Note: embedding_model_config or vector_db cannot be set if
237- vertex_ai_search_config is specified.
238- backend_config: The backend config of the RagCorpus. Specifies a Vector
239- DB and/or the embedding model config.
246+ vertex_ai_search_config is specified.
247+ backend_config: The backend config of the RagCorpus. Specifies a Vector DB
248+ and/or the embedding model config.
249+ timeout: Default is 600 seconds.
240250
241251 Returns:
242252 RagCorpus.
@@ -286,7 +296,7 @@ def update_corpus(
286296 except Exception as e :
287297 raise RuntimeError ("Failed in RagCorpus update due to: " , e ) from e
288298 return _gapic_utils .convert_gapic_to_rag_corpus_no_embedding_model_config (
289- response .result (timeout = 600 )
299+ response .result (timeout = timeout )
290300 )
291301
292302
@@ -998,6 +1008,7 @@ def delete_file(name: str, corpus_name: Optional[str] = None) -> None:
9981008
9991009def update_rag_engine_config (
10001010 rag_engine_config : RagEngineConfig ,
1011+ timeout : int = 600 ,
10011012) -> RagEngineConfig :
10021013 """Update RagEngineConfig.
10031014
@@ -1019,6 +1030,7 @@ def update_rag_engine_config(
10191030
10201031 Args:
10211032 rag_engine_config: The RagEngineConfig to update.
1033+ timeout: Default is 600 seconds.
10221034
10231035 Raises:
10241036 RuntimeError: Failed in RagEngineConfig update due to exception.
@@ -1034,7 +1046,9 @@ def update_rag_engine_config(
10341046 response = client .update_rag_engine_config (request = request )
10351047 except Exception as e :
10361048 raise RuntimeError ("Failed in RagEngineConfig update due to: " , e ) from e
1037- return _gapic_utils .convert_gapic_to_rag_engine_config (response .result (timeout = 600 ))
1049+ return _gapic_utils .convert_gapic_to_rag_engine_config (
1050+ response .result (timeout = timeout )
1051+ )
10381052
10391053
10401054def get_rag_engine_config (name : str ) -> RagEngineConfig :
0 commit comments