Skip to content

feat: audio input/output#1118

Merged
looplj merged 1 commit intorelease/v0.9.xfrom
dev-tmp
Mar 21, 2026
Merged

feat: audio input/output#1118
looplj merged 1 commit intorelease/v0.9.xfrom
dev-tmp

Conversation

@looplj
Copy link
Copy Markdown
Owner

@looplj looplj commented Mar 21, 2026

No description provided.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 introduces comprehensive support for audio input and output capabilities throughout the system. It enables the frontend to display both user-provided audio and audio generated by large language models, while the backend and LLM integration layers have been updated to correctly process, store, and transform these new audio data types. This enhancement significantly expands the multimodal interaction possibilities of the application.

Highlights

  • Frontend UI Enhancements: The user interface now supports displaying both user-provided audio input and audio generated by Large Language Models (LLMs) within the span details, complete with format information, audio players, and transcripts.
  • Backend Data Model Updates: Core backend data structures, including Span and SpanValue, have been extended to incorporate new types for UserInputAudio and Audio, facilitating the storage and retrieval of audio data.
  • LLM Integration for Audio: The LLM transformer layers for Gemini and OpenAI have been updated to correctly handle the conversion of audio input and output between the application's internal models and the respective LLM API formats, ensuring seamless multimodal communication.
  • Localization Support: New localization strings have been added for both English and Chinese to support the new audio-related UI elements and span types, improving the user experience for a broader audience.
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.

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 introduces support for audio input and output across the application stack, touching the frontend, backend, and LLM transformers. The changes are comprehensive and well-organized. I've identified a critical compilation error in the Go backend that needs to be addressed, along with a medium-severity suggestion to improve robustness in the frontend. Overall, this is a solid implementation of a new feature.

EndTime: now,
Value: &SpanValue{
ToolResult: &SpanToolResult{
Text: new(fmt.Sprintf("[audio input: %s]", part.InputAudio.Format)),
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.

critical

The expression new(fmt.Sprintf("[audio input: %s]", part.InputAudio.Format)) will cause a compilation error. new() expects a type as an argument, but fmt.Sprintf returns a value of type string. To fix this, you should generate the string first and then get a pointer to it. Using lo.ToPtr from the lo package, which is already imported in this file, is a concise way to achieve this.

Suggested change
Text: new(fmt.Sprintf("[audio input: %s]", part.InputAudio.Format)),
Text: lo.ToPtr(fmt.Sprintf("[audio input: %s]", part.InputAudio.Format)),

Comment on lines +133 to +136
const audioSrc =
userInputAudio.data && userInputAudio.format
? `data:audio/${userInputAudio.format};base64,${userInputAudio.data}`
: undefined;
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.

medium

The current implementation for userInputAudio doesn't render the audio player if userInputAudio.format is missing, even if userInputAudio.data is present. This is inconsistent with how the audio section is handled, which provides a default MIME type ('audio/mpeg'). To improve robustness and ensure the audio player is always available when there's data, consider providing a default MIME type for userInputAudio as well.

Suggested change
const audioSrc =
userInputAudio.data && userInputAudio.format
? `data:audio/${userInputAudio.format};base64,${userInputAudio.data}`
: undefined;
const audioMime = userInputAudio.format ? `audio/${userInputAudio.format}` : 'audio/mpeg';
const audioSrc = userInputAudio.data
? `data:${audioMime};base64,${userInputAudio.data}`
: undefined;

@looplj looplj merged commit b1a5fb9 into release/v0.9.x Mar 21, 2026
2 checks passed
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.

1 participant