Skip to content
Open
Changes from 1 commit
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
8 changes: 7 additions & 1 deletion marimo/_server/ai/providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,13 @@ def create_provider(self, config: AnyProviderConfig) -> PydanticGoogle:
)
if use_vertex:
project = os.getenv("GOOGLE_CLOUD_PROJECT")
location = os.getenv("GOOGLE_CLOUD_LOCATION", "us-central1")
location = os.getenv("GOOGLE_CLOUD_LOCATION") or None
if location is None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good callout, but this doesn't actually re-set location

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm, saw the thread, but would be worth mentioning in a comment that upstream will default to us-central

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, switched it to info and added a comment noting the upstream default. Thanks for the review!

LOGGER.warning(
"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