Skip to content

refactor(go/plugins): extract modality string constants#5488

Open
IzaakGough wants to merge 7 commits into
mainfrom
refactor/extract-modality-string-constants
Open

refactor(go/plugins): extract modality string constants#5488
IzaakGough wants to merge 7 commits into
mainfrom
refactor/extract-modality-string-constants

Conversation

@IzaakGough

@IzaakGough IzaakGough commented Jun 8, 2026

Copy link
Copy Markdown

Summary

Refactor the Go googlegenai plugin to replace repeated modality string literals with shared constants, and update the related TTS assertion to use the same constant.

Problem/Root Cause

models.go repeated raw modality strings such as "media", "text", "image", and "video" across model and embedder capability definitions. Keeping these values duplicated makes the registry harder to maintain and increases the risk of inconsistent updates when a modality value is reused in multiple places.

Solution/Changes

  • Add shared modality constants for media, text, image, and video in the Go Google GenAI plugin.
  • Replace repeated string literals in model output and embedder input capability declarations with those constants.
  • Update the existing TTS capability test to assert against the shared media constant instead of a raw string literal.

Testing

  • Updated the existing TTS model options test to use the shared modality constant.
  • No additional test runs were verified from the PR evidence.

@IzaakGough IzaakGough changed the title Refactor: extract modality string constants refactor(go/plugins/googlegenai): extract modality string constants Jun 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for text-to-speech (TTS) models in the Google Gen AI plugin. It defines modality constants, adds a TTSSupports capability definition, registers three new Gemini TTS preview models, and adds corresponding unit tests to verify model classification, options, and registration. There are no review comments, so no feedback is provided.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@IzaakGough IzaakGough marked this pull request as ready for review June 9, 2026 14:06

@adesinah adesinah left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look good. This PR needs to convert this chore for other Go plugins too.

@IzaakGough IzaakGough changed the title refactor(go/plugins/googlegenai): extract modality string constants refactor(go/plugins): extract modality string constants Jun 10, 2026
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