fix: switch RAG corpus to Serverless mode (RagManagedDb) in us-central1
This commit is contained in:
parent
09dcb4d1a2
commit
a5fd5f58e8
|
|
@ -3,9 +3,8 @@
|
|||
setup_corpus.py — Create a Vertex AI RAG Engine corpus and import documents.
|
||||
Project: propane-will-491900-m5
|
||||
|
||||
IMPORTANT: RAG Engine in us-central1 requires allowlist access.
|
||||
Contact: vertex-ai-rag-engine-support@google.com
|
||||
Alternative: Use us-east1 or us-east4 for immediate access.
|
||||
Serverless mode (RagManagedDb) — no allowlist required.
|
||||
Region: us-central1
|
||||
"""
|
||||
|
||||
import os
|
||||
|
|
@ -13,7 +12,7 @@ import vertexai
|
|||
from vertexai import rag
|
||||
|
||||
PROJECT_ID = "propane-will-491900-m5"
|
||||
LOCATION = os.environ.get("RAG_LOCATION", "us-east1") # change to us-central1 after allowlist
|
||||
LOCATION = os.environ.get("RAG_LOCATION", "us-central1")
|
||||
CORPUS_DISPLAY_NAME = os.environ.get("RAG_CORPUS_NAME", "oavauco-knowledge-base")
|
||||
GCS_SOURCE = os.environ.get(
|
||||
"RAG_GCS_SOURCE",
|
||||
|
|
@ -31,9 +30,12 @@ def main():
|
|||
corpus = c
|
||||
break
|
||||
else:
|
||||
print(f"Creating RAG corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION}...")
|
||||
print(f"Creating RAG corpus '{CORPUS_DISPLAY_NAME}' in {LOCATION} (Serverless)...")
|
||||
corpus = rag.create_corpus(
|
||||
display_name=CORPUS_DISPLAY_NAME,
|
||||
backend_config=rag.RagVectorDbConfig(
|
||||
rag_managed_db=rag.RagManagedDb() # Serverless — no Spanner
|
||||
),
|
||||
)
|
||||
print(f"Corpus created: {corpus.name}")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user