GoogleLLMBuilder class

Google-specific LLM builder with provider-specific configuration methods

This builder provides a layered configuration approach where Google-specific parameters are handled separately from the generic LLMBuilder, keeping the main builder clean and focused.

Use this for Google-specific parameters only. For common parameters like apiKey, model, temperature, etc., continue using the base LLMBuilder methods.

Constructors

GoogleLLMBuilder.new(LLMBuilder _baseBuilder)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build() Future<ChatCapability>
Builds and returns a configured LLM provider instance
buildEmbedding() Future<EmbeddingCapability>
Builds a provider with EmbeddingCapability
buildGoogleTTS() Future<GoogleTTSCapability>
Builds a provider with GoogleTTSCapability
buildImageGeneration() Future<ImageGenerationCapability>
Builds a provider with ImageGenerationCapability
buildModelListing() Future<ModelListingCapability>
Builds a provider with ModelListingCapability
candidateCount(int count) GoogleLLMBuilder
Sets candidate count for response generation
embeddingDimensions(int dimensions) GoogleLLMBuilder
Sets the output dimensionality for embeddings
embeddingTaskType(String taskType) GoogleLLMBuilder
Sets the task type for embeddings
embeddingTitle(String title) GoogleLLMBuilder
Sets the title for embedding documents (only for RETRIEVAL_DOCUMENT task type)
enableAudioOutput() GoogleLLMBuilder
Enable audio response modality for TTS
enableImageGeneration(bool enable) GoogleLLMBuilder
Enables image generation capability
forClassification({int? dimensions}) GoogleLLMBuilder
Configure for classification tasks
forClustering({int? dimensions}) GoogleLLMBuilder
Configure for clustering tasks
forDocumentRetrieval({String? title, int? dimensions}) GoogleLLMBuilder
Configure for document retrieval
forSearchQuery({int? dimensions}) GoogleLLMBuilder
Configure for search queries
forSemanticSimilarity({int? dimensions}) GoogleLLMBuilder
Configure for semantic similarity tasks
includeThoughts(bool include) GoogleLLMBuilder
Enables or disables including thoughts in the response
maxInlineDataSize(int size) GoogleLLMBuilder
Sets maximum inline data size (default: 20MB)
multiSpeakerTTS({Map<String, String>? defaultSpeakerVoices, String? model}) GoogleLLMBuilder
Configure for multi-speaker TTS
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reasoningEffort(ReasoningEffort effort) GoogleLLMBuilder
Sets the reasoning effort for models that support it
responseModalities(List<String> modalities) GoogleLLMBuilder
Sets response modalities (e.g., 'TEXT', 'IMAGE')
safetySettings(List<SafetySetting> settings) GoogleLLMBuilder
Sets safety settings for content filtering
singleSpeakerTTS({String voiceName = 'Kore', String? model}) GoogleLLMBuilder
Configure for single-speaker TTS
stopSequences(List<String> sequences) GoogleLLMBuilder
Sets stop sequences for response generation
thinkingBudgetTokens(int tokens) GoogleLLMBuilder
Sets thinking budget tokens for reasoning models
toString() String
A string representation of this object.
inherited
ttsModel(String model) GoogleLLMBuilder
Sets the TTS model to use
voice(String voiceName) GoogleLLMBuilder
Configure TTS with specific voice

Operators

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