Skip to content

feat(config): add location to Configure.Generative.google_vertex (#2073) - #2118

Open
Anai-Guo wants to merge 1 commit into
weaviate:mainfrom
Anai-Guo:feat/generative-google-location
Open

feat(config): add location to Configure.Generative.google_vertex (#2073)#2118
Anai-Guo wants to merge 1 commit into
weaviate:mainfrom
Anai-Guo:feat/generative-google-location

Conversation

@Anai-Guo

@Anai-Guo Anai-Guo commented Aug 3, 2026

Copy link
Copy Markdown

Closes #2073.

Problem

The generative-google module in Weaviate core reads a location class setting (modules/generative-google/config/class_settings.go: locationProperty = "location", DefaultGoogleLocation = "us-central1"), separate from the existing region setting. The Python client's _GenerativeGoogleConfig has region but no location, so there is no way to set it from Configure.Generative.* — the server default always applies.

Change

  • _GenerativeGoogleConfig gains an optional location field.
  • Configure.Generative.google_vertex(...) gains an optional location argument (documented as defaulting to the server-defined us-central1).
  • The other constructors that build _GenerativeGoogleConfig (palm, google, google_gemini) pass location=None, so nothing changes for them.

Because the field is Optional and the model is serialized with exclude_none, an unset location is simply absent from the module config — existing collection configurations serialize byte-for-byte as before.

Scope note

This covers the collection-config half of #2073 only. The runtime/query-time half is not included: the GenerativeGoogle gRPC message (weaviate/proto/v1/v6300/v1/generative_pb2.pyi) has region but no location field, which matches the issue's note that "this change needs newest protos". Once the protos carry location, the runtime provider in weaviate/collections/classes/generative.py can be extended in a follow-up.

Tests

Added two parametrized cases to test_config_with_generative, which had no google_vertex coverage at all:

  • google_vertex(project_id=...){"generative-palm": {"projectId": "project"}} (regression guard: no new key leaks in when location is unset)
  • google_vertex(...) with every argument, including region and location, asserting both land in the module config
$ python -m pytest test/collection/test_config.py -q
193 passed

$ python -m pytest test/ -q
2 failed, 386 passed, 1 skipped

Both failures are in test/test_timeout.py and reproduce identically on an unmodified checkout of main (ae327ca) on this machine — they are pre-existing and unrelated.

Lint, matching .pre-commit-config.yaml pins:

$ ruff 0.14.7 check / format --check   → All checks passed / 2 files already formatted
$ flake8 7.3.0 (+bugbear, comprehensions, builtins, docstrings, pydoclint)  → clean

🤖 Generated with Claude Code

…viate#2073)

The generative-google module in Weaviate core reads a ``location`` class
setting (default ``us-central1``) alongside ``region``, but the Python
client had no way to send it, so collections could not select a Vertex
location from the client.

Add ``location`` to ``_GenerativeGoogleConfig`` and expose it as an
optional ``location`` argument on ``Configure.Generative.google_vertex``.
It is omitted from the module config when left as ``None``, so the server
default still applies and existing configurations are unchanged.

Runtime (gRPC) generative parameters are unchanged: the ``GenerativeGoogle``
proto message has no ``location`` field yet, so query-time support has to
wait for regenerated protos.

Signed-off-by: Tai An <antai12232931@anaiguo.com>

@orca-security-eu orca-security-eu Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed SAST high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@weaviate-git-bot

Copy link
Copy Markdown

To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge.

beep boop - the Weaviate bot 👋🤖

PS:
Are you already a member of the Weaviate Forum?

@Anai-Guo

Anai-Guo commented Aug 3, 2026

Copy link
Copy Markdown
Author

I agree with the Weaviate Contributor License Agreement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for location setting in generative-google module

2 participants