Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion marimo/_server/ai/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,14 @@ def create_provider(self, config: AnyProviderConfig) -> PydanticGoogle:
)
if use_vertex:
project = os.getenv("GOOGLE_CLOUD_PROJECT")
location = os.getenv("GOOGLE_CLOUD_LOCATION", "us-central1")
# Upstream (pydantic-ai) defaults to us-central1 if not set
location = os.getenv("GOOGLE_CLOUD_LOCATION") or None
if location is None:
LOGGER.info(
"GOOGLE_CLOUD_LOCATION is not set. "
"The upstream provider will default to 'us-central1'. "
"Set this env var if your project has region restrictions."
)
# The type stubs don't have an overload that combines vertexai
# with project/location, but the runtime supports it
provider: PydanticGoogle = PydanticGoogle( # type: ignore[call-overload]
Expand Down
Loading