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 recordSettings for the Anthropic Large Language Model provider.static interfaceCustom models can be added by implementing this interface and, and the underlying implementations ofdev.langchain4j.model.chat.ChatModeland (optionally)dev.langchain4j.model.chat.StreamingChatModel.static final recordstatic final recordSettings for the Google AI Gemini Large Language Model provider.static final recordstatic final recordSettings for the Local AI Large Language Model provider.static final recordSettings for the Ollama Large Language Model provider.static final recordSettings for the OpenAI Large Language Model provider. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic ModelProvider.AnthropicSettings for the Anthropic Large Language Model provider.static ModelProvider.Customcustom(ModelProvider.Custom provider) static ModelProviderCreates a model provider from the default configuration path.static ModelProviderfromConfig(String configPath) Creates a model provider from the specified configuration path.static ModelProvider.GoogleAIGeminiSettings for the Google AI Gemini Large Language Model provider.static ModelProvider.HuggingFaceSettings for the HuggingFace Large Language Model provider.static ModelProvider.LocalAIlocalAI()Settings for the Local AI Large Language Model provider.static ModelProvider.Ollamaollama()Settings for the Ollama Large Language Model provider.static ModelProvider.OpenAiopenAi()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
-