googleapis / googleapis/python-genai
LiveKit Google Plugin: Gemini 2.5 Flash returns empty candidates despite STOP finish reason
- Dominant language
- Python
- Stars
- 4k
- Forks
- 1k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 40
Description
I'm experiencing a recurring issue with the LiveKit Google plugin
when using Gemini 2.5 Flash. The model returns empty candidates
despite having a STOP finish reason and consuming prompt tokens.
This issue does not occur with Gemini 2.0 Flash.
Error Message:
2025-09-18 04:17:28,022 - WARNING livekit.plugins.google - no
candidates in the response: sdk_http_response=HttpResponse(
headers=
) candidates=[Candidate(
content=Content(
role='model'
),
finish_reason=,
index=0
)] create_time=None model_version='gemini-2.5-flash'
prompt_feedback=None response_id='2IfLaNMEmbCq2w_6i_WpDw'
usage_metadata=GenerateContentResponseUsageMetadata(
prompt_token_count=4589,
prompt_tokens_details=[
ModalityTokenCount(
modality=,
token_count=4589
),
],
total_token_count=4589
) automatic_function_calling_history=None parsed=None {"pid": 71,
"job_id": "AJ_apM9tfCyuNjG"}
Environment:
- LiveKit Agents: livekit-agents[google]~=1.2
- Model: gemini-2.5-flash
- Working Model: gemini-2.0-flash (no issues)
- Plugin: livekit.plugins.google
Code Configuration:
llm=google.LLM(
model="gemini-2.5-flash",
temperature=0.8,
tool_choice="auto",
)
Reproduction:
This occurs during stt-llm-tts voice chat sessions using LiveKit
agents with the Google plugin. The issue appears to be
model-specific to Gemini 2.5 models.
Workaround:
Currently using gemini-2.0-flash as it does not exhibit this
behavior.
Contributor guide
Assessment
This issue has not been assessed yet.