GeminiProvider class
Google Gemini provider implementation.
Supports Gemini 2.0 Flash, Gemini 1.5 Pro, and other Gemini models.
final gemini = GeminiProvider(
config: AIConfig(
apiKey: 'AI...',
model: 'gemini-2.0-flash',
),
);
Constructors
- GeminiProvider({required AIConfig config, Client? httpClient})
Properties
-
capabilities
→ List<
AICapability> -
List of capabilities this provider supports.
no setter
- config → AIConfig
-
The configuration for this provider.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- model → String
-
The current model being used.
no setter
- name → String
-
Human-readable name of this provider.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
complete(
List< AIMessage> messages, {int? maxTokens, double? temperature, List<AITool> ? tools}) → Future<AIResponse> - Sends a completion request and returns the full response.
-
completeStream(
List< AIMessage> messages, {int? maxTokens, double? temperature, List<AITool> ? tools}) → Stream<AIStreamChunk> - Sends a completion request and returns a stream of chunks.
-
dispose(
) → Future< void> - Releases any resources held by this provider.
-
embed(
String text) → Future< List< double> > - Generates embeddings for the given text.
-
estimateTokens(
String text) → int - Estimates the number of tokens in the given text.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
supports(
AICapability capability) → bool - Whether this provider supports a specific capability.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited