fix: use vector_db=RagManagedDb(tier=1) — correct field names for SDK 1.153.1
RagVectorDbConfig takes vector_db= not rag_managed_db=. The db type is RagManagedDb, not RagManagedDbConfig.
This commit is contained in:
parent
ad8597f434
commit
582967a994
|
|
@ -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)
|
||||
)
|
||||
),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user