mypy typing issue: client.aio.models.generate_content_stream
requires await
twice
#316
Labels
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Thanks for stopping by to let us know something could be better!
PLEASE READ: If you have a support contract with Google, please create an issue in the support console instead of filing on GitHub. This will ensure a timely response.
Is this a client library issue or a product issue? We will only be able to assist with issues that pertain to the behaviors of this library. If the issue you're experiencing is due to the behavior of the product itself, please visit the Support page to reach the most relevant engineers.
If the support paths suggested above still do not result in a resolution, please provide the following details.
Environment details
google-genai
:1.1.0
/mypy
:1.15.0
Steps to reproduce
Mypy complains the above code with
error: "Awaitable[AsyncIterator[GenerateContentResponse]]" has no attribute "__aiter__"; maybe "__await__"? (not async iterable)
.Though the mypy error is resolved by attaching
await
twice (as the following code), but it doesn't actually work.I guess the return type of
generate_content_stream
should beAsyncIterator[types.GenerateContentResponse]
instead ofAwaitable[AsyncIterator[types.GenerateContentResponse]]
, but not sure.Thanks!
The text was updated successfully, but these errors were encountered: