How can I define thinking config for gemini models...
# ask-ai
b
How can I define thinking config for gemini models in livekit
t
Thanks for reaching out, Harsh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you set up a thinking configuration for Gemini models in LiveKit, you can use the
thinking_config
parameter when initializing the LLM or RealtimeModel. Let me walk you through how to configure it: For Regular Gemini LLM: • *Python:*`from livekit.plugins import google llm = google.LLM( model="gemini-2.0-flash-001", thinking_config={ "thinking_budget": 1000 # Must be an integer } )` • *Node.js:*`import { google } from '@livekit/agents-plugins-google'; const llm = new google.LLM({ model: 'gemini-2.0-flash-001', thinkingConfig: { thinkingBudget: 1000 // Must be between 0 and 24576 } });` For Gemini Realtime API: • *Python:*`from livekit.plugins.google.realtime import RealtimeModel model = RealtimeModel( model="gemini-2.0-flash-exp", thinking_config={ "thinking_budget": 1000 } )` Key Details: • The
thinking_budget
parameter should be an integer in Python and between 0 and 24576 in Node.js. • This configuration is checked during initialization and then passed along to the Gemini API. If you have any questions or need a hand with anything else, please don’t hesitate to reach out—I’m here to help! Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/realtime/real... | .cursor/rules/agent-core.mdc