Skip to content

Conversation

@Speediing
Copy link
Contributor

Description

Adds the thinkingConfig parameter to the Gemini Realtime Model in the LiveKit agents-js SDK. This change aligns the JS SDK with the Python SDK, enabling users to configure the thinking behavior of native audio models (e.g., disable thinking or use dynamic thinking).

Changes Made

  • Added thinkingConfig?: types.ThinkingConfig to the RealtimeOptions interface.
  • Added thinkingConfig?: types.ThinkingConfig as a constructor parameter to RealtimeModel with JSDoc documentation.
  • Stored thinkingConfig in this._options within the RealtimeModel constructor.
  • Passed thinkingConfig through in the buildConnectConfig() method at the top level of the LiveConnectConfig object.

Pre-Review Checklist

  • Build passes: All builds (lint, typecheck, tests) pass locally
  • AI-generated code reviewed: Removed unnecessary comments and ensured code quality
  • Changes explained: All changes are properly documented and justified above
  • Scope appropriate: All changes relate to the PR title, or explanations provided for why they're included
  • Video demo: A small video demo showing changes works as expected and did not break any existing functionality using Agent Playground (if applicable)

Testing

  • Automated tests added/updated (if applicable)
  • All tests pass (linting and type-checking verified)
  • Make sure both restaurant_agent.ts and realtime_agent.ts work properly (for major changes)

The AI performed linting and type-checking, and verified the specific code changes were correctly implemented.

Additional Notes

Usage example:

import { google } from '@livekit/agents-plugins-google';

const model = new google.beta.realtime.RealtimeModel({
  model: 'gemini-2.5-flash-native-audio-preview-12-2025',
  thinkingConfig: {
    thinkingBudget: 0, // disables thinking
  },
});

Note to reviewers: Please ensure the pre-review checklist is completed before starting your review.


Open in Cursor Open in Web

@cursor
Copy link

cursor bot commented Jan 7, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@changeset-bot
Copy link

changeset-bot bot commented Jan 7, 2026

🦋 Changeset detected

Latest commit: aee53c8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 17 packages
Name Type
@livekit/agents-plugin-google Patch
@livekit/agents Patch
@livekit/agents-plugin-anam Patch
@livekit/agents-plugin-baseten Patch
@livekit/agents-plugin-bey Patch
@livekit/agents-plugin-cartesia Patch
@livekit/agents-plugin-deepgram Patch
@livekit/agents-plugin-elevenlabs Patch
@livekit/agents-plugin-inworld Patch
@livekit/agents-plugin-livekit Patch
@livekit/agents-plugin-neuphonic Patch
@livekit/agents-plugin-openai Patch
@livekit/agents-plugin-resemble Patch
@livekit/agents-plugin-rime Patch
@livekit/agents-plugin-silero Patch
@livekit/agents-plugin-xai Patch
@livekit/agents-plugins-test Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant
Copy link

CLAassistant commented Jan 7, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ toubatbrian
❌ cursoragent
You have signed the CLA already but the status is still pending? Let us recheck it.

@Speediing Speediing requested a review from Shubhrakanti January 7, 2026 23:52
Copy link
Contributor

@Shubhrakanti Shubhrakanti left a comment

Choose a reason for hiding this comment

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

I would make an example and run it to make sure it works as intended.

Comment on lines 278 to 283
/**
* Thinking configuration for native audio models.
* Use `\{ thinkingBudget: 0 \}` to disable thinking.
* Use `\{ thinkingBudget: -1 \}` for automatic/dynamic thinking.
*/
thinkingConfig?: types.ThinkingConfig;
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the default value if we send nothing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Then it's thinking mode by default

@toubatbrian toubatbrian marked this pull request as ready for review January 8, 2026 18:16
@Speediing Speediing merged commit 2a1d3b9 into main Jan 8, 2026
7 of 8 checks passed
@Speediing Speediing deleted the cursor/gemini-realtime-thinking-config-9f13 branch January 8, 2026 18:28
@github-actions github-actions bot mentioned this pull request Jan 8, 2026
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.

6 participants