Skip to content

A plugin fix for gemini_tts.py for populating the input/output tokens.#5784

Open
Yash-Zinzuvadia wants to merge 1 commit into
livekit:mainfrom
Yash-Zinzuvadia:fix/gemini-tts-token-usage-v2
Open

A plugin fix for gemini_tts.py for populating the input/output tokens.#5784
Yash-Zinzuvadia wants to merge 1 commit into
livekit:mainfrom
Yash-Zinzuvadia:fix/gemini-tts-token-usage-v2

Conversation

@Yash-Zinzuvadia
Copy link
Copy Markdown

The current version of the GeminiTTS plugin is not populating the input and output tokens from the usage_metadata of the response, for tts models which use token based calculation. This fix solves the issue by getting the token count from response.usage_metadata.prompt_token_count and candidates_token_count where Gemini API surfaces them.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 20, 2026

CLA assistant check
All committers have signed the CLA.

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@Yash-Zinzuvadia Yash-Zinzuvadia force-pushed the fix/gemini-tts-token-usage-v2 branch from ea38bd8 to bbc6658 Compare May 20, 2026 15:16
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.

2 participants