how can i change the thinking level for gemini 3.1...
# ask-ai
m
how can i change the thinking level for gemini 3.1 flash live
Copy code
model = "gemini-3.1-flash-live-preview"

config = types.LiveConnectConfig(
    response_modalities=["AUDIO"]
    thinking_config=types.ThinkingConfig(
        thinking_level="low",
    )
)

async with client.aio.live.connect(model=model, config=config) as session:
# Send audio input and receive audio
t
Thanks for reaching out, Manas. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding about changing the
thinking_level
for
gemini-3.1-flash-live-preview
. Your snippet is correct. Valid
thinking_level
values are: "minimal", "low", "medium", and "high". The default is "minimal" (lowest latency). To change it, set
thinking_config
in
LiveConnectConfig
as you already do. Example:
Copy code
config = types.LiveConnectConfig(
    response_modalities=["AUDIO"],
    thinking_config=types.ThinkingConfig(
        thinking_level="medium",  # minimal | low | medium | high
    )
)
If you want guidance on trade-offs (latency vs. reasoning quality) or which level to pick for a specific use case (e.g., real-time conversation vs. complex reasoning), tell me your use case and I’ll recommend a level. Sources: Gemini Live API plugin | LiveKit Documentation, with interactive elements
m
from livekit.plugins import google session = AgentSession( llm=google.realtime.RealtimeModel( voice="Puck", temperature=0.8, instructions="You are a helpful assistant", ), ) should i add in this only the thinking?
t
You're on the right track — yes, add the thinking config inside
RealtimeModel
. For Gemini 3.1 use `thinking_level`; for Gemini 2.5 use
thinking_budget
. Example for Gemini 3.1:
Copy code
from livekit.plugins import google
from google.genai import types

session = AgentSession(
    llm=google.realtime.RealtimeModel(
        model="gemini-3.1-flash-live-preview",
        voice="Puck",
        temperature=0.8,
        instructions="You are a helpful assistant",
        thinking_config=types.ThinkingConfig(
            thinking_level="medium",  # minimal | low | medium | high
            include_thoughts=False,   # optional
        ),
    ),
)
If you want, tell me which model/version you’re using and your priority (lowest latency vs. better reasoning) and I’ll recommend a specific level. Sources: Gemini Live API plugin | LiveKit Documentation, with interactive elements
m
if i want to save the users input also then what can i do i am using gemini 3.1 live ,like i want the transcription of the user input also saved
t
You're asking how to save user audio transcriptions when using Gemini 3.1 Live — yes, you can capture and save them. Two common approaches: • Built-in transcription (simpler)
Copy code
from google.genai import types
  from livekit.plugins import google
  from livekit.agents import AgentSession

  session = AgentSession(
      llm=google.realtime.RealtimeModel(
          model="gemini-3.1-flash-live-preview",
          voice="Puck",
          temperature=0.8,
          instructions="You are a helpful assistant",
          input_audio_transcription=types.InputAudioTranscription(
              model="whisper-1"
          ),
          thinking_config=types.ThinkingConfig(thinking_level="medium"),
      ),
  )
Then listen for conversation items (user role) or the
lk.transcription
text stream and save the text to your DB/file. • Separate STT + turn detection (more control, recommended for production) ◦ Disable automatic activity detection for Gemini and enable a turn-detection model. ◦ Use an external STT (e.g., Deepgram) to produce transcripts. ◦ Capture transcripts from the STT or from conversation events and persist them. If you want, tell me: • which SDK/language you’re using (Python, JS, server, client), and • whether you prefer built-in simplicity or a more robust STT pipeline, and I’ll provide the exact code/event hooks to save transcripts to your storage. Sources: Gemini Live API plugin | LiveKit Documentation | Text and transcriptions | LiveKit Documentation, with interactive elements
m
there are some issues when i am using gemini live 3.1 model but some functionality are not working
t
Thanks — I’m responding about the Gemini 3.1 Live issues you mentioned. Some Gemini 3.1 Flash Live functionality is limited (for example,
generate_reply()
,
update_instructions()
,
update_chat_ctx()
aren’t compatible, and
send_client_content
is restricted to initial history seeding). To help quickly, what specific functionality is failing for you? Please include: • SDK/language and code snippet where the failure happens • Model string you’re using (e.g.,
gemini-3.1-flash-live-preview
) • Any error messages, unexpected behavior, or logs • Whether you’re using built-in transcription or an external STT With that I’ll suggest targeted workarounds or config changes. , with interactive elements
m
so this errors are because of the model or from the livekit
t
Good question — short answer: most of those specific failures are due to Gemini 3.1 Flash Live model limitations, not LiveKit. What’s happening • Gemini 3.1 Flash Live restricts certain Live/Agent features:
generate_reply()
,
update_instructions()
, and
update_chat_ctx()
are not compatible, and
send_client_content
is limited to initial history seeding. • These model-imposed limits cause the behaviors you described (functions that work with other models may be no-ops or error when used with 3.1). What LiveKit still handles • LiveKit continues to provide real-time plumbing (audio streams, events, text stream handlers, turn detection, registering handlers). Transcription capture via
lk.transcription
or text stream handlers and using external STT is supported as described earlier. Next step • If you share one failing function, the SDK/language, your model string, and any error/log output, I’ll confirm whether it’s a model limitation and suggest a concrete workaround (e.g., use a different model for that feature, perform instruction updates in your app layer, or use an external STT pipeline)., with interactive elements