Package-level declarations

Functions

Link copied to clipboard
fun AIAgentConfig.copyWith(prompt: Prompt = this.prompt, model: LLModel = this.model, maxAgentIterations: Int = this.maxAgentIterations, missingToolsConversionStrategy: MissingToolsConversionStrategy = this.missingToolsConversionStrategy): AIAgentConfig

Method to copy the Agent's config with updated parameters (since the original class is immutable and is not a data class)

fun <Input, Output> GraphAIAgent<Input, Output>.copyWith(inputType: TypeToken = this.inputType, outputType: TypeToken = this.outputType, promptExecutor: PromptExecutor = this.promptExecutor, agentConfig: AIAgentConfig = this.agentConfig, id: String = this.id, toolRegistry: ToolRegistry = this.toolRegistry, clock: Clock = this.clock, installFeatures: GraphAIAgent.FeatureContext.() -> Unit = this.installFeatures, strategy: AIAgentGraphStrategy<Input, Output> = this.strategy): GraphAIAgent<Input, Output>

To be able to optimize the agent, we need to be able to automatically evolve it by modifying or creating copies of the AIAgent object.

Link copied to clipboard
fun <Input, Output> GraphAIAgent<Input, Output>.copyWithPrompt(newPrompt: Prompt): GraphAIAgent<Input, Output>

Returns a copy of this agent whose AIAgentConfig.prompt is replaced with newPrompt, leaving all other configuration (model, tools, installed features) intact.

Link copied to clipboard

Retrieves the CollectedSubgraphTraces from an agent that has SubgraphTraceCollectionFeature installed.

Link copied to clipboard
fun <T : Any> AIAgent<*, *>.getFeature(featureClass: KClass<T>, feature: AIAgentGraphFeature<*, T>): T?

Retrieves an installed feature instance from the agent's pipeline.

Link copied to clipboard
inline fun <Input, Output> AIAgent.Companion.invokeGraphAgent(promptExecutor: PromptExecutor, llmModel: LLModel, strategy: AIAgentGraphStrategy<Input, Output>, toolRegistry: ToolRegistry = ToolRegistry.EMPTY, id: String? = null, clock: Clock = Clock.System, systemPrompt: String = "", temperature: Double = 1.0, numberOfChoices: Int = 1, maxIterations: Int = 50, noinline installFeatures: GraphAIAgent.FeatureContext.() -> Unit = {}): GraphAIAgent<Input, Output>

Creates a GraphAIAgent with the given parameters.

Link copied to clipboard
suspend fun <Input, Output> GraphAIAgent<Input, Output>.runFresh(input: Input): Output

Copies this agent and runs the copy on input.