Bug Description
Sometimes google return no candidate and fallback mechanisim not working how to fix?
Expected Behavior
If gemini response has no candidate it should fallback to other LLM
Reproduction Steps
it depends google
Operating System
ubuntu
Models Used
gemini 2.5 flash
Package Versions
pendencies = [
"livekit-agents[anam,bey,bithuman,cartesia,deepgram,mcp,openai,silero,simli,tavus,turn-detector]~=1.2",
"livekit-plugins-azure>=1.2.6",
"livekit-plugins-elevenlabs>=1.2.6",
"livekit-plugins-google>=1.2.6",
"livekit-plugins-minimax>=1.2.6",
"livekit-plugins-noise-cancellation~=0.2",
"livekit-plugins-speechmatics>=1.2.6",
"pip",
"python-dotenv>=1.1.1",
Session/Room/Call IDs
No response
Proposed Solution
Additional Context
No response
Screenshots and Recordings
2025-11-20 23:03:28,874 - INFO google_genai.models - AFC remote call 1 is done. "", "pid": 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:28,876 - WARNING livekit.plugins.google - no candidates in the response: sdk_http_response=HttpResponse(
headers=
) candidates=[Candidate(
content=Content(
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-2.5-flash' prompt_feedback=None response_id='EHQfacqzMMShxN8Pmfe4qAE' usage_metadata=GenerateContentResponseUsageMetadata(
prompt_token_count=6800,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=6800
),
],
total_token_count=6800
) automatic_function_calling_history=None parsed=None "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:35,981 - ERROR asyncio - Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x11ba34150> 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:37,655 - DEBUG livekit.agents - received user transcript "user_transcript": "E sen zaten kodu verdin bana.", "language": "tr-TR", "pid": 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:37,726 - INFO google_genai.models - AFC is enabled with max remote calls: 10.
2025-11-20 23:03:38,809 - INFO google_genai.models - AFC remote call 1 is done. "", "pid": 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:38,810 - WARNING livekit.plugins.google - no candidates in the response: sdk_http_response=HttpResponse(
headers=
) candidates=[Candidate(
content=Content(
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-2.5-flash' prompt_feedback=None response_id='GnQfaZGhLMO1nsEPt_650QI' usage_metadata=GenerateContentResponseUsageMetadata(
prompt_token_count=6808,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=6808
),
],
total_token_count=6808
) automatic_function_calling_history=None parsed=None "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:48,290 - DEBUG livekit.agents - received user transcript "user_transcript": "Orada mısınız?", "language": "tr-TR", "pid": 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:48,338 - INFO google_genai.models - AFC is enabled with max remote calls: 10.
2025-11-20 23:03:49,892 - INFO google_genai.models - AFC remote call 1 is done. "", "pid": 1119, "job_id": "AJ_HLh7v4qq5gEh"}
2025-11-20 23:03:49,893 - WARNING livekit.plugins.google - no candidates in the response: sdk_http_response=HttpResponse(
headers=
) candidates=[Candidate(
content=Content(
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-2.5-flash' prompt_feedback=None response_id='JXQfacTEMIqhnsEPhZzZ8AE' usage_metadata=GenerateContentResponseUsageMetadata(
prompt_token_count=6813,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=6813
),
],
total_token_count=6813
) automatic_function_calling_history=None parsed=None "AJ_HLh7v4qq5gEh"}