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
feat: Generate methods that use server-side streaming (#2474)
The generated methods look like this:
```dart
/// Generates a [streamed response](https://ai.google.dev/gemini-api/docs/text-generation?lang=python#generate-a-text-stream)
/// from the model given an input `GenerateContentRequest`.
Stream<GenerateContentResponse> streamGenerateContent(
GenerateContentRequest request,
) {
final url = Uri.https(_host, '/v1/${request.model}:streamGenerateContent');
return _client
.postStreaming(url, body: request)
.map(GenerateContentResponse.fromJson);
}
```
0 commit comments