GeminiStreamClient class final
Streams chat completions from the Google Gemini API
(streamGenerateContent?alt=sse).
Wire format: SSE frames whose data is a GenerateContentResponse JSON.
Text arrives in candidates[0].content.parts[].text; the final frame
carries usageMetadata. There is no [DONE] sentinel — the stream
ending is the completion signal.
- Implemented types
Constructors
- GeminiStreamClient({required String apiKey, String baseUrl = 'https://generativelanguage.googleapis.com/v1beta', Client? client})
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
streamChat(
List< AiChatMessage> messages, {required String model, double? temperature, int? maxTokens, Map<String, Object?> extraBody = const {}}) → Stream<Object> -
Streams a chat completion as a sequence of typed events.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited