-
Notifications
You must be signed in to change notification settings - Fork 443
Open
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: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Let's say I call response = client.models.generate_content(...)
. I then might end up with an attribute access chain like response.candidates[0].content.parts[0].function_call.args
. Pretty much all of these fields are nullable. I'd like to know when I need to handle these None
values and what they would mean.
- When will
response.candidates
beNone
? - When will
response.candidates
be an empty list? - When will
candidate.content
beNone
? - When will
content.parts
beNone
? - When will
content.parts
be an empty list? - (It's clear when
part.function_call
would beNone
) - When would
function_call.args
beNone
?
Thanks! LLM usage naturally involves a lot of error conditions from unexpected inputs, rate limits, timeouts etc. So I want to handle valid inputs as tightly as possible, so that I can track down what's happening better.
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: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
janasangeetha commentedon Jul 3, 2025
Hey @honnibal
Thank you for reaching out!
Please find the details below:
github-actions commentedon Jul 18, 2025
Marking this issue as stale since it has been open for 14 days with no activity. This issue will be closed if no further activity occurs.