-
Notifications
You must be signed in to change notification settings - Fork 109
Closed
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status:awaiting user responseissues requiring a response from the userissues requiring a response from the usertype: 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
When using generateContent
, errors due to output token limit being reached is not captured. The error
object returns empty {}
Environment details
- Programming language: TypeScript
- OS: MacOS / Unix-based
- Language runtime version: 5.7.3
- Package version: 1.10.0
Steps to reproduce
- Using Seed value of
0
,maxOutputToken
of1
and temperature value of0.1
, callgenerateContent
with a prompt to count instances of object in any video. (the expectation is that the output token will exceed 1) - An error will be thrown by
generateContent
, but body will be empty{}
note: the above image is from a screenshot from a log. Essentially, the generateContent
is wrapped by a try/catch
block, and the error thrown is simply {}
Expected behaviour
There should be some kind of the error handling that indicates that the error is truly due to maxOutputToken
being reached. For example, if we were to set the config.httpOptions.timeout
to 100
milliseconds, we can get a simple error message of APIError
from the SDK.
see below for example
Metadata
Metadata
Assignees
Labels
priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status:awaiting user responseissues requiring a response from the userissues requiring a response from the usertype: 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.