Skip to content

Commit bc7e2e9

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: RAG - Add support for timeout in upload_file request
Otherwise the 120 default will always apply. Aligning the default to import_files. PiperOrigin-RevId: 795534431
1 parent cebad9a commit bc7e2e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vertexai/rag/rag_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,6 +342,7 @@ def upload_file(
342342
display_name: Optional[str] = None,
343343
description: Optional[str] = None,
344344
transformation_config: Optional[TransformationConfig] = None,
345+
timeout: int = 600,
345346
) -> RagFile:
346347
"""
347348
Synchronous file upload to an existing RagCorpus.
@@ -379,6 +380,7 @@ def upload_file(
379380
display_name: The display name of the data file.
380381
description: The description of the RagFile.
381382
transformation_config: The config for transforming the RagFile, like chunking.
383+
timeout: Default is 600 seconds.
382384
383385
Returns:
384386
RagFile.
@@ -433,6 +435,7 @@ def upload_file(
433435
url=upload_request_uri,
434436
files=files,
435437
headers=headers,
438+
timeout=timeout,
436439
)
437440
except Exception as e:
438441
raise RuntimeError("Failed in uploading the RagFile due to: ", e) from e

0 commit comments

Comments
 (0)