GoogleProvider class

Google provider implementation

This provider implements the ChatCapability, EmbeddingCapability, ImageGenerationCapability, and GoogleTTSCapability interfaces and delegates to specialized capability modules for different functionalities.

Implemented types

Constructors

GoogleProvider.new(GoogleConfig config)

Properties

config GoogleConfig
final
hashCode int
The hash code for this object.
no setterinherited
providerName String
Get provider name
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedCapabilities Set<LLMCapability>
Set of capabilities this provider supports
no setteroverride
supportsImageEditing bool
Check if the provider supports image editing
no setteroverride
supportsImageVariations bool
Check if the provider supports image variations
no setteroverride

Methods

chat(List<ChatMessage> messages) Future<ChatResponse>
Sends a chat request to the provider with a sequence of messages.
override
chatStream(List<ChatMessage> messages, {List<Tool>? tools}) Stream<ChatStreamEvent>
Sends a streaming chat request to the provider
override
chatWithTools(List<ChatMessage> messages, List<Tool>? tools) Future<ChatResponse>
Sends a chat request to the provider with a sequence of messages and tools.
override
createVariation(ImageVariationRequest request) Future<ImageGenerationResponse>
Create variations of an existing image
override
editImage(ImageEditRequest request) Future<ImageGenerationResponse>
Edit an existing image based on a prompt
override
embed(List<String> input) Future<List<List<double>>>
Generate embeddings for the given input texts
override
generateImage({required String prompt, String? model, String? negativePrompt, String? imageSize, int? batchSize, String? seed, int? numInferenceSteps, double? guidanceScale, bool? promptEnhancement}) Future<List<String>>
Simple image generation (convenience method)
override
generateImages(ImageGenerationRequest request) Future<ImageGenerationResponse>
Generate images from text prompts
override
generateSpeech(GoogleTTSRequest request) Future<GoogleTTSResponse>
Generate speech from text using Google's native TTS
override
generateSpeechStream(GoogleTTSRequest request) Stream<GoogleTTSStreamEvent>
Generate speech with streaming output
override
getAvailableVoices() Future<List<GoogleVoiceInfo>>
Get available voices for Google TTS
override
getSupportedFormats() List<String>
Get supported response formats for this provider
override
getSupportedLanguages() Future<List<String>>
Get supported languages for Google TTS
override
getSupportedSizes() List<String>
Get supported image sizes for this provider
override
memoryContents() Future<List<ChatMessage>?>
Get current memory contents if provider supports memory
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
summarizeHistory(List<ChatMessage> messages) Future<String>
Summarizes a conversation history into a concise 2-3 sentence summary
override
supports(LLMCapability capability) bool
Check if this provider supports a specific capability
override
toString() String
A string representation of this object.
inherited

Operators

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