Skip to content

fix(js/plugin/compat-oai): invalid model ID error in transcription models#4708

Merged
ifielker merged 2 commits intogenkit-ai:mainfrom
7hokerz:7hokerz/compat-oai-stt-model-prefix
Feb 18, 2026
Merged

fix(js/plugin/compat-oai): invalid model ID error in transcription models#4708
ifielker merged 2 commits intogenkit-ai:mainfrom
7hokerz:7hokerz/compat-oai-stt-model-prefix

Conversation

@7hokerz
Copy link
Copy Markdown
Contributor

@7hokerz 7hokerz commented Feb 17, 2026

Description here... Help the reviewer by:

  • Applied the toModelName utility function to the STT model definition. (like TTS implementation)
  • Added an integration test flow for STT in testapps/compat-oai/src/index.ts.
  • Added jfk.flac as a test asset. (This audio file was sourced directly from the official Whisper GitHub repository without any modifications) audio link
  • Implemented a test case to verify that the audio file is correctly transcribed using the openai/whisper-1 model reference.
  • Fixed the issue: [JS] Transcription API returns 400 error #4707

Checklist (if applicable):

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @7hokerz, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an invalid model ID error in transcription models by ensuring consistent model naming through the application of the toModelName utility. It also enhances testing coverage by introducing a new integration test flow for Speech-to-Text, which validates the transcription process using the openai/whisper-1 model and a dedicated audio test asset.

Highlights

  • Model Naming Fix: Applied the toModelName utility function to the STT model definition to resolve invalid model ID errors.
  • STT Integration Test: Introduced a new integration test flow for Speech-to-Text (STT) functionality in testapps/compat-oai/src/index.ts.
  • Test Asset: Added jfk.flac as a test asset to be used in the new STT integration test.
  • Transcription Verification: Implemented a test case to verify correct audio transcription using the openai/whisper-1 model reference.
  • Issue Resolution: Fixed the issue identified as [JS] Transcription API returns 400 error #4707.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • js/plugins/compat-oai/src/audio.ts
    • Refactored the defineCompatOpenAITranscriptionModel function to use toModelName for generating the modelName from the provided name and pluginOptions?.name.
  • js/testapps/compat-oai/src/index.ts
    • Added a new transcribe flow that reads jfk.flac, converts it to a base64 data URL, and uses ai.generate with openai.model('whisper-1') to perform speech-to-text transcription.
Activity
  • The author provided a detailed description outlining the changes, including the application of toModelName, the addition of an STT integration test, the inclusion of a test asset, and the verification of transcription.
  • The author confirmed that the PR title adheres to conventional commits and that the changes have been tested.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 correctly fixes an invalid model ID error for transcription models by applying the toModelName utility function, ensuring model names are properly normalized. The addition of an integration test flow for STT using a jfk.flac test asset effectively validates the fix. The changes are well-implemented and address the issue described. I have no further suggestions.

Copy link
Copy Markdown
Collaborator

@ifielker ifielker left a comment

Choose a reason for hiding this comment

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

The code is fine. But let's switch out the audio sample please.

@7hokerz 7hokerz requested a review from ifielker February 18, 2026 07:34
@ifielker ifielker merged commit 0c214af into genkit-ai:main Feb 18, 2026
6 checks passed
@7hokerz 7hokerz deleted the 7hokerz/compat-oai-stt-model-prefix branch February 19, 2026 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants