Package akka.javasdk.agent
Interface ModelProvider
- All Known Subinterfaces:
ModelProvider.Custom
- All Known Implementing Classes:
ModelProvider.Anthropic
,ModelProvider.FromConfig
,ModelProvider.GoogleAIGemini
,ModelProvider.HuggingFace
,ModelProvider.LocalAI
,ModelProvider.Ollama
,ModelProvider.OpenAi
public sealed interface ModelProvider
permits ModelProvider.FromConfig, ModelProvider.Anthropic, ModelProvider.GoogleAIGemini, ModelProvider.LocalAI, ModelProvider.Ollama, ModelProvider.OpenAi, ModelProvider.HuggingFace, ModelProvider.Custom
Configuration interface for AI model providers used by agents.
ModelProvider defines which AI model and settings to use for agent interactions. Akka supports multiple model providers including hosted services (OpenAI, Anthropic, Google AI Gemini, HuggingFace) and locally running models (Ollama, LocalAI).
Different agents can use different models by specifying the ModelProvider in the agent effect. If no model is specified, the default model from configuration is used.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final record
Settings for the Anthropic Large Language Model provider.static interface
static final record
static final record
Settings for the Google AI Gemini Large Language Model provider.static final record
static final record
Settings for the Local AI Large Language Model provider.static final record
Settings for the Ollama Large Language Model provider.static final record
Settings for the OpenAI Large Language Model provider. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ModelProvider.Anthropic
Settings for the Anthropic Large Language Model provider.static ModelProvider.Custom
custom
(ModelProvider.Custom provider) static ModelProvider
Creates a model provider from the default configuration path.static ModelProvider
fromConfig
(String configPath) Creates a model provider from the specified configuration path.static ModelProvider.GoogleAIGemini
Settings for the Google AI Gemini Large Language Model provider.static ModelProvider.HuggingFace
Settings for the HuggingFace Large Language Model provider.static ModelProvider.LocalAI
localAI()
Settings for the Local AI Large Language Model provider.static ModelProvider.Ollama
ollama()
Settings for the Ollama Large Language Model provider.static ModelProvider.OpenAi
openAi()
Settings for the OpenAI Large Language Model provider.
-
Method Details
-
fromConfig
Creates a model provider from the default configuration path.Reads configuration from
akka.javasdk.agent.model-provider
.- Returns:
- a configuration-based model provider
-
fromConfig
Creates a model provider from the specified configuration path.Allows using different model configurations for different agents by defining multiple model configurations and referencing them by path.
- Parameters:
configPath
- the configuration path to read model settings from- Returns:
- a configuration-based model provider
-
anthropic
Settings for the Anthropic Large Language Model provider. -
googleAiGemini
Settings for the Google AI Gemini Large Language Model provider. -
localAI
Settings for the Local AI Large Language Model provider. -
ollama
Settings for the Ollama Large Language Model provider. -
openAi
Settings for the OpenAI Large Language Model provider. -
huggingFace
Settings for the HuggingFace Large Language Model provider. -
custom
-