fix: use tier=1 int instead of RagManagedDbConfig.Tier.BASIC enum
The Tier enum is not available in the installed SDK version. Use integer value 1 (BASIC) directly instead.
This commit is contained in:
parent
814dd89ca6
commit
ad8597f434
|
|
@ -23,6 +23,10 @@ GCS_SOURCE = os.environ.get(
|
||||||
f"gs://{PROJECT_ID}-agent-staging/rag-docs/",
|
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_BASIC = 1
|
||||||
|
|
||||||
|
|
||||||
def ensure_serverless_engine_config() -> None:
|
def ensure_serverless_engine_config() -> None:
|
||||||
"""
|
"""
|
||||||
|
|
@ -76,10 +80,9 @@ def get_or_create_corpus() -> RagCorpus:
|
||||||
print(f"Creating corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION} (serverless)...")
|
print(f"Creating corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION} (serverless)...")
|
||||||
corpus = rag.create_corpus(
|
corpus = rag.create_corpus(
|
||||||
display_name=CORPUS_DISPLAY_NAME,
|
display_name=CORPUS_DISPLAY_NAME,
|
||||||
# Explicitly request serverless / basic managed DB tier
|
|
||||||
backend_config=rag.RagVectorDbConfig(
|
backend_config=rag.RagVectorDbConfig(
|
||||||
rag_managed_db=rag.RagManagedDbConfig(
|
rag_managed_db=rag.RagManagedDbConfig(
|
||||||
tier=rag.RagManagedDbConfig.Tier.BASIC,
|
tier=_TIER_BASIC, # 1 = BASIC (serverless), 2 = ENTERPRISE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user