From 582967a994eb1ca31ed65fef7aa52381648b120b Mon Sep 17 00:00:00 2001 From: chrischristiansen-glitch Date: Sun, 24 May 2026 18:58:00 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20use=20vector=5Fdb=3DRagManagedDb(tier=3D?= =?UTF-8?q?1)=20=E2=80=94=20correct=20field=20names=20for=20SDK=201.153.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit RagVectorDbConfig takes vector_db= not rag_managed_db=. The db type is RagManagedDb, not RagManagedDbConfig. --- agents/rag/setup_corpus.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/agents/rag/setup_corpus.py b/agents/rag/setup_corpus.py index c2bc549..7998f32 100644 --- a/agents/rag/setup_corpus.py +++ b/agents/rag/setup_corpus.py @@ -3,8 +3,12 @@ setup_corpus.py — Create a Vertex AI RAG Engine corpus and import documents. Project: propane-will-491900-m5 -Explicitly uses Serverless (RagManagedDbConfig basic tier) to avoid +Explicitly uses Serverless (RagManagedDb basic tier) to avoid Spanner allowlist restrictions on new projects in us-central1. + +Tested against vertexai SDK 1.153.1: + RagVectorDbConfig(vector_db=RagManagedDb(tier=1)) + tier=1 == BASIC (serverless), tier=2 == ENTERPRISE """ import os @@ -23,8 +27,7 @@ GCS_SOURCE = os.environ.get( f"gs://{PROJECT_ID}-agent-staging/rag-docs/", ) -# RagManagedDbConfig.Tier enum may not exist in older SDK versions. -# tier=1 == BASIC, tier=2 == ENTERPRISE +# tier=1 == BASIC (serverless), tier=2 == ENTERPRISE _TIER_BASIC = 1 @@ -81,8 +84,8 @@ def get_or_create_corpus() -> RagCorpus: corpus = rag.create_corpus( display_name=CORPUS_DISPLAY_NAME, backend_config=rag.RagVectorDbConfig( - rag_managed_db=rag.RagManagedDbConfig( - tier=_TIER_BASIC, # 1 = BASIC (serverless), 2 = ENTERPRISE + vector_db=rag.RagManagedDb( + tier=_TIER_BASIC, # 1 = BASIC (serverless) ) ), )