LlmInteraction

data class LlmInteraction(val id: InteractionId, val llm: <Error class: unknown class> = LlmOptions(), val toolGroups: Set<ToolGroupRequirement> = emptySet(), val tools: List<Tool> = emptyList(), val promptContributors: List<<Error class: unknown class>> = emptyList(), val contextualPromptContributors: List<ContextualPromptElement> = emptyList(), val generateExamples: Boolean? = null, val propertyFilter: Predicate<String> = Predicate { true }, val validation: Boolean = true, val useEmbabelToolLoop: Boolean = true, val maxToolIterations: Int = 20) : LlmCall

Encapsulates an interaction with an LLM. An LlmInteraction is a specific instance of an LlmCall. The LLM must have been chosen and the call has a unique identifier.

Parameters

id

Unique identifier for the interaction. Note that this is NOT the id of this particular LLM call, but of the interaction in general. For example, it might be the "analyzeProject" call within the "Analyze" action. Every such call with have the same id, but many calls may be made across different AgentProcesses, or even within the same AgentProcess if the action can be rerun. This is per action, not per process.

llm

LLM options to use, specifying model and hyperparameters

tools

Tools to use for this interaction

promptContributors

Prompt contributors to use for this interaction

useEmbabelToolLoop

If true, use Embabel's own tool loop instead of Spring AI's. This enables dynamic tool injection and gives full control over the tool execution loop. Default is true.

maxToolIterations

Maximum number of tool loop iterations (default 20)

Constructors

Link copied to clipboard
constructor(id: InteractionId, llm: <Error class: unknown class> = LlmOptions(), toolGroups: Set<ToolGroupRequirement> = emptySet(), tools: List<Tool> = emptyList(), promptContributors: List<<Error class: unknown class>> = emptyList(), contextualPromptContributors: List<ContextualPromptElement> = emptyList(), generateExamples: Boolean? = null, propertyFilter: Predicate<String> = Predicate { true }, validation: Boolean = true, useEmbabelToolLoop: Boolean = true, maxToolIterations: Int = 20)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val generateExamples: Boolean? = null

Whether to generate examples for the prompt. Defaults to unknown: Set to false if generating your own examples.

Link copied to clipboard
Link copied to clipboard
open override val llm: <Error class: unknown class>
Link copied to clipboard
Link copied to clipboard
open override val name: String
Link copied to clipboard
open val promptContributors: List<<Error class: unknown class>>
Link copied to clipboard
open override val propertyFilter: Predicate<String>

Filter that determines which properties to include when creating objects.

Link copied to clipboard
open override val toolGroups: Set<ToolGroupRequirement>

Tool groups exposed. This will include directly registered tool groups and tool groups resolved from ToolGroups.

Link copied to clipboard
open override val tools: List<Tool>
Link copied to clipboard
Link copied to clipboard
open override val validation: Boolean = true

Whether to validate generated objects. Defaults to true; set to false to skip validation.

Functions

Link copied to clipboard
open fun resolveTools(toolGroupResolver: ToolGroupResolver): List<Tool>

Resolve all tools from this consumer and its tool groups.