Skip to content

feat(generative): add location setting to generative-google config - #476

Open
OsamaAnsar wants to merge 2 commits into
weaviate:mainfrom
OsamaAnsar:feature/generative-google-location
Open

OsamaAnsar wants to merge 2 commits into
weaviate:mainfrom
OsamaAnsar:feature/generative-google-location

Conversation

@OsamaAnsar

Copy link
Copy Markdown
Contributor

Summary

Closes #445.

Adds the optional location setting to the generative-google module (defaults to us-central1 server-side). Mirrors weaviate-python-client#2118 / #2130.

Approach

location is a plain pass-through field on both existing generative-google config surfaces, so no builder logic changes are needed:

  • Config time — configure.generative.google() already spreads ...config, so adding location to GenerativeGoogleConfig is enough.
  • Query time — generativeParameters.google() already spreads ...rest, and the vendored GenerativeGoogle proto message already carries location (src/proto/v1/generative.ts), so adding location to GenerativeGoogleConfigRuntime completes the runtime path without touching serialize/index.ts.

Changes

  • src/collections/config/types/generative.ts — location?: string on GenerativeGoogleConfig
  • src/collections/types/generate.ts — location?: string on GenerativeGoogleConfigRuntime
  • src/collections/configure/unit.test.ts — location added to the existing generative.google all-values test

No new test in generate/unit.test.ts: per that file's header comment it only covers fields that are renamed to a gRPC name, and location passes through unchanged.

Testing

npx tsc --noEmit clean. eslint and prettier --check clean. Unit suite passes (160/160 across configure/unit.test.ts + generate/unit.test.ts) with WEAVIATE_VERSION set locally for test/version.ts.

@OsamaAnsar

Copy link
Copy Markdown
Contributor Author

I agree with the CLA

@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?

This branch has not been deployed

No deployments
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