GeminiChatProvider class

Chat provider adapter for Google Gemini.

Supports non-streaming generation through complete and Gemini's server-sent event streaming endpoint through stream.

Inheritance

Constructors

GeminiChatProvider({String? apiKey, String? bearerToken, Uri? endpoint, AiHttpClient? httpClient})
Creates a Gemini chat provider using either an API key or bearer token.

Properties

apiKey String?
API key used with the x-goog-api-key header.
final
bearerToken String?
OAuth bearer token. Takes precedence over apiKey when supplied.
final
displayName String
Human-readable provider name.
no setteroverride
endpoint Uri
Gemini generateContent endpoint.
final
hashCode int
The hash code for this object.
no setterinherited
httpClient AiHttpClient
HTTP transport used for provider requests.
final
id String
Stable provider id used for registration and lookup.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

complete(ChatRequest request) Future<ChatResult>
Executes a non-streaming completion request.
override
describe() Map<String, dynamic>
Returns a serializable description of the provider.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
stream(ChatRequest request) Stream<ChatEvent>
Streams Gemini Server-Sent Events.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited