You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The schema and main methods from the client are automatically generated from the OpenAPI spec. However, the streaming methods need to be written manually.
To add stream support to generate content we need to:
Write a StreamTransformer that returns valid jsons from the stream of data. You can check _OpenAIStreamTransformer as a reference (but the way the data is sent may be different).
The text was updated successfully, but these errors were encountered:
Docs: https://ai.google.dev/tutorials/rest_quickstart#stream_generate_content
The schema and main methods from the client are automatically generated from the OpenAPI spec. However, the streaming methods need to be written manually.
To add stream support to generate content we need to:
/models/{modelId}:streamGenerateContent
from thegoogleai_openapi_curated.yaml
and regenerate the client (as we will add this method manually).streamGenerateContent
method in theGoogleAIClient
class. You can checkOpenAIClient.createCompletionStream
as a reference.StreamTransformer
that returns valid jsons from the stream of data. You can check_OpenAIStreamTransformer
as a reference (but the way the data is sent may be different).The text was updated successfully, but these errors were encountered: