Skip to content

feat: Add responseModalities to GenerationConfig #6892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ryanwilson
Copy link
Member

Adds an optional responseModalities property to the GenerationConfig class. This allows specifying the desired modality types (e.g., TEXT, IMAGE, AUDIO) for the response.

The changes include:

  • Adding responseModalities: List<ResponseModality>? to the GenerationConfig primary constructor.
  • Updating the GenerationConfig.Builder to include the new property.
  • Updating the internal GenerationConfig.Internal data class and the toInternal mapping for serialization.

Adds an optional `responseModalities` property to the `GenerationConfig` class. This allows specifying the desired modality types (e.g., TEXT, IMAGE, AUDIO) for the response.

The changes include:
- Adding `responseModalities: List<ResponseModality>?` to the `GenerationConfig` primary constructor.
- Updating the `GenerationConfig.Builder` to include the new property.
- Updating the internal `GenerationConfig.Internal` data class and the `toInternal` mapping for serialization.
Copy link
Contributor

github-actions bot commented Apr 17, 2025

📝 PRs merging into main branch

Our main branch should always be in a releasable state. If you are working on a larger change, or if you don't want this change to see the light of the day just yet, consider using a feature branch first, and only merge into the main branch when the code complete and ready to be released.

Copy link
Contributor

Vertex AI Mock Responses Check ⚠️

A newer major version of the mock responses for Vertex AI unit tests is available. update_responses.sh should be updated to clone the latest version of the responses: v10.0

@google-oss-bot
Copy link
Contributor

1 Warning
⚠️ Did you forget to add a changelog entry? (Add the 'no-changelog' label to the PR to silence this warning.)

Generated by 🚫 Danger

@google-oss-bot
Copy link
Contributor

google-oss-bot commented Apr 17, 2025

Copy link
Contributor

github-actions bot commented Apr 17, 2025

Test Results

0 files   -    66  0 suites   - 66   0s ⏱️ - 1m 16s
0 tests  -   552  0 ✅  -   551  0 💤  - 1  0 ❌ ±0 
0 runs   - 1 104  0 ✅  - 1 102  0 💤  - 2  0 ❌ ±0 

Results for commit 4d48637. ± Comparison against base commit 51b4a1c.

♻️ This comment has been updated with latest results.

Removes an extra parenthesis and corrects the mapping logic within the `toInternal()` function in `GenerationConfig.kt` that was introduced when adding the `responseModalities` property.
@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-vertexai:
error: Added field com.google.firebase.vertexai.type.GenerationConfig.Builder.responseModalities [AddedField]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

@google-oss-bot
Copy link
Contributor

The public api surface has changed for the subproject firebase-vertexai:
error: Added field com.google.firebase.vertexai.type.GenerationConfig.Builder.responseModalities [AddedField]

Please update the api.txt files for the subprojects being affected by this change by running ./gradlew ${subproject}:generateApiTxtFile. Also perform a major/minor bump accordingly.

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

Successfully merging this pull request may close these issues.

2 participants