Package com.embabel.agent.core.support
Class AbstractLlmOperations
-
- All Implemented Interfaces:
-
com.embabel.agent.spi.LlmOperations
public abstract class AbstractLlmOperations implements LlmOperations
Convenient superclass for LlmOperations implementations, which should normally extend this Find all tool callbacks and decorate them to be aware of the platform Also emits events.
-
-
Constructor Summary
Constructors Constructor Description AbstractLlmOperations(ToolDecorator toolDecorator, ModelProvider modelProvider, Validator validator, ValidationPromptGenerator validationPromptGenerator, AutoLlmSelectionCriteriaResolver autoLlmSelectionCriteriaResolver, LlmDataBindingProperties dataBindingProperties)
-
Method Summary
Modifier and Type Method Description final <O extends Any> OcreateObject(List<Message> messages, LlmInteraction interaction, Class<O> outputClass, AgentProcess agentProcess, Action action)Create an output object, in the context of an AgentProcess. final <O extends Any> Result<O>createObjectIfPossible(List<Message> messages, LlmInteraction interaction, Class<O> outputClass, AgentProcess agentProcess, Action action)Try to create an output object in the context of an AgentProcess. -
-
Constructor Detail
-
AbstractLlmOperations
AbstractLlmOperations(ToolDecorator toolDecorator, ModelProvider modelProvider, Validator validator, ValidationPromptGenerator validationPromptGenerator, AutoLlmSelectionCriteriaResolver autoLlmSelectionCriteriaResolver, LlmDataBindingProperties dataBindingProperties)
-
-
Method Detail
-
createObject
final <O extends Any> O createObject(List<Message> messages, LlmInteraction interaction, Class<O> outputClass, AgentProcess agentProcess, Action action)
Create an output object, in the context of an AgentProcess.
- Parameters:
messages- messages in the conversation so far.interaction- Llm options and tool callbacks to use, plus unique identifieroutputClass- Class of the output objectagentProcess- Agent process we are running withinaction- Action we are running within if we are running within an action
-
createObjectIfPossible
final <O extends Any> Result<O> createObjectIfPossible(List<Message> messages, LlmInteraction interaction, Class<O> outputClass, AgentProcess agentProcess, Action action)
Try to create an output object in the context of an AgentProcess. Return a failure result if the LLM does not have enough information to create the object.
- Parameters:
messages- messagesinteraction- Llm options and tool callbacks to use, plus unique identifieroutputClass- Class of the output objectagentProcess- Agent process we are running withinaction- Action we are running within if we are running within an action
-
-
-
-