feat(generative): add location to GenerativeConfig.google_vertex runtime config (#2073) - #2130
Open
Anai-Guo wants to merge 1 commit into
Open
feat(generative): add location to GenerativeConfig.google_vertex runtime config (#2073)#2130Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
…ime config (weaviate#2073) The generative-google module in Weaviate core reads a location setting (default us-central1) alongside region, and the collection-level config (Configure.Generative.google_vertex) already exposes it. The per-query runtime path (GenerativeConfig.google_vertex) had no way to send it. Now that GenerativeGoogle carries the location field (field 15) in the regenerated protos, wire it through: add location to _GenerativeGoogle, pass it in _to_grpc, and expose an optional location argument on GenerativeConfig.google_vertex. It is appended at the end of the signature so positional callers are unaffected, and omitted from the gRPC message when left as None, so the server default still applies. The six generative_pb2 files mirror main's proto regen (f58e35b); they are included only so CI is green on this branch and no-op on merge. Signed-off-by: Tai An <antai12232931@anaiguo.com>
Contributor
Author
|
I agree with the Weaviate Contributor License Agreement. |
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to #2118 (which added
locationto the collection-levelConfigure.Generative.google_vertex). This wires the samelocationthrough the per-query runtime config,GenerativeConfig.google_vertex.Weaviate core's
generative-googlemodule reads alocationclass setting (defaultus-central1) alongsideregion, and now that theGenerativeGoogleproto carrieslocation(field 15, from your regen inf58e35b6), the runtime path can send it:locationto_GenerativeGooglelocation=self.locationin_to_grpclocation=argument onGenerativeConfig.google_vertex, appended at the end of the signature so positional callers are unaffectedWhen left as
Noneit is omitted from the gRPC message, so the server default still applies and existing calls are unchanged.Test
Added a
google_vertexcase totest_generative_parametersassertinglocation="us-central1"round-trips intogenerative_pb2.GenerativeGoogle(location=...). All 21 cases pass; on unmodified code the new case fails withTypeError: google_vertex() got an unexpected keyword argument 'location', confirming the field actually flows.Note on the proto files
The six
generative_pb2files in this diff are identical tomain(yourf58e35b6regen). They're included only so CI is green on this branch — my fork can't fast-forward past the CI-workflow commit without theworkflowtoken scope, so I couldn't rebase onto the new protos. They 3-way-merge to a no-op againstmain; feel free to drop them on merge/rebase.🤖 Generated with Claude Code