-
Notifications
You must be signed in to change notification settings - Fork 724
Closed as not planned
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.status:awaiting user responsestatus:staletype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Hello Gemini team,
Recently, I'm getting a lot of empty response like below, when running:
from google.genai.client import Client as GenAIClient
response = await client.aio.models.generate_content(
model=self.model_id,
contents=user_prompt, # Gemini API treats the prompt as the 'contents'
config=types.GenerateContentConfig(**gemini_gen_config)
)print(str(response))
Output:
sdk_http_response=HttpResponse(
headers=<dict len=11>
) candidates=[Candidate(
content=Content(
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-2.5-pro' prompt_feedback=None response_id='hYCoaK7mFISV_uMPidKliQc' usage_metadata=GenerateContentResponseUsageMetadata(
prompt_token_count=1878,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=1878
),
],
thoughts_token_count=13,
total_token_count=1891
) automatic_function_calling_history=[] parsed=None
instead of
sdk_http_response=HttpResponse(
headers=<dict len=11>
) candidates=[Candidate(
content=Content(
parts=[
Part(
text="""...
Gemini full response here
Gemini full response here
Gemini full response here
...
"""
),
],
role='model'
),
finish_reason=<FinishReason.STOP: 'STOP'>,
index=0
)] create_time=None model_version='gemini-2.5-pro' prompt_feedback=None response_id='roCoaJitN5uQjMcP85aYyA4' usage_metadata=GenerateContentResponseUsageMetadata(
candidates_token_count=2084,
prompt_token_count=2403,
prompt_tokens_details=[
ModalityTokenCount(
modality=<MediaModality.TEXT: 'TEXT'>,
token_count=2403
),
],
thoughts_token_count=5640,
total_token_count=10127
) automatic_function_calling_history=[] parsed=None
Environment details
- Programming language: python
- OS: Linux
- Language runtime version: 3.12
- Package version: 1.31.0
Thanks!
pekeler, github-account1111 and hwaxxer
Metadata
Metadata
Assignees
Labels
priority: p3Desirable enhancement or fix. May not be included in next release.Desirable enhancement or fix. May not be included in next release.status:awaiting user responsestatus:staletype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.