Spring Ai Llm Service
Spring AI implementation that provides decoupled LLM operations.
Wraps a Spring AI ChatModel and provides the ability to create LlmMessageSender instances for making LLM calls without tight coupling to Spring AI throughout the codebase.
This class is the recommended replacement for the deprecated com.embabel.common.ai.model.Llm class.
Parameters
Name of the LLM
Name of the provider (e.g., "OpenAI", "Anthropic")
The Spring AI ChatModel to use for LLM calls
Function to convert LlmOptions to Spring AI ChatOptions
Model's knowledge cutoff date, if known
List of prompt contributors for this model. Knowledge cutoff is automatically included if knowledgeCutoffDate is set.
Pricing model for this LLM, if known
Constructors
Properties
Functions
Create a message sender for this LLM configured with the given options.
Returns a copy of this LLM service with the specified knowledge cutoff date.
Returns a copy with a different options converter.
Returns a copy of this LLM service with an additional prompt contributor.