From 016625bc5f8185dbbcf3516c6bb7dab6247d6b6d Mon Sep 17 00:00:00 2001 From: Ishaan Jaffer Date: Tue, 25 Nov 2025 18:59:39 -0800 Subject: [PATCH] add VertexAIVectorStoreOptions --- litellm/types/rag.py | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/litellm/types/rag.py b/litellm/types/rag.py index 252530c7163..51ac6eea043 100644 --- a/litellm/types/rag.py +++ b/litellm/types/rag.py @@ -86,8 +86,37 @@ class BedrockVectorStoreOptions(TypedDict, total=False): aws_external_id: Optional[str] +class VertexAIVectorStoreOptions(TypedDict, total=False): + """ + Vertex AI RAG Engine configuration. + + Example (use existing corpus): + {"custom_llm_provider": "vertex_ai", "vector_store_id": "CORPUS_ID", "gcs_bucket": "my-bucket"} + + Requires: + - gcloud auth application-default login (for ADC authentication) + - Files are uploaded to GCS via litellm.files.create_file, then imported into RAG corpus + - GCS bucket must be provided via gcs_bucket or GCS_BUCKET_NAME env var + """ + + custom_llm_provider: Literal["vertex_ai"] + vector_store_id: str # RAG corpus ID (required for Vertex AI) + + # GCP config + vertex_project: Optional[str] # GCP project ID (uses env VERTEXAI_PROJECT if not set) + vertex_location: Optional[str] # GCP region (default: us-central1) + vertex_credentials: Optional[str] # Path to credentials JSON (uses ADC if not set) + gcs_bucket: Optional[str] # GCS bucket for file uploads (uses env GCS_BUCKET_NAME if not set) + + # Import settings + wait_for_import: Optional[bool] # Wait for import to complete (default: True) + import_timeout: Optional[int] # Timeout in seconds (default: 600) + + # Union type for vector store options -RAGIngestVectorStoreOptions = Union[OpenAIVectorStoreOptions, BedrockVectorStoreOptions] +RAGIngestVectorStoreOptions = Union[ + OpenAIVectorStoreOptions, BedrockVectorStoreOptions, VertexAIVectorStoreOptions +] class RAGIngestOptions(TypedDict, total=False):