ProcessContext

data class ProcessContext(val processOptions: ProcessOptions = ProcessOptions(), platformServices: PlatformServices, val outputChannel: OutputChannel = platformServices.outputChannel + processOptions.outputChannel, val agentProcess: AgentProcess) : LlmOperations, AgenticEventListener

Process state and services. Created by the platform, not user code.

Constructors

Link copied to clipboard
constructor(processOptions: ProcessOptions = ProcessOptions(), platformServices: PlatformServices, outputChannel: OutputChannel = platformServices.outputChannel + processOptions.outputChannel, agentProcess: AgentProcess)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun <O> createObject(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, agentProcess: AgentProcess, action: Action?): O

Create an output object, in the context of an AgentProcess.

Link copied to clipboard
open override fun <O> createObjectIfPossible(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, agentProcess: AgentProcess, action: Action?): <Error class: unknown class><O>

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.

Link copied to clipboard
open override fun <O> createObjectIfPossibleWithThinking(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, agentProcess: AgentProcess, action: Action?): <Error class: unknown class><ThinkingResponse<O>>

Try to create an output object with thinking block extraction in the context of an AgentProcess. Return a failure result if the LLM does not have enough information to create the object.

Link copied to clipboard
open override fun <O> createObjectWithThinking(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, agentProcess: AgentProcess, action: Action?): ThinkingResponse<O>

Create an output object with thinking block extraction, in the context of an AgentProcess.

Link copied to clipboard
open override fun <O> doTransform(prompt: String, interaction: LlmInteraction, outputClass: Class<O>, llmRequestEvent: LlmRequestEvent<O>?): O

Low level transform, not necessarily aware of platform This is a convenience overload that creates a UserMessage from a String prompt

open override fun <O> doTransform(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, llmRequestEvent: LlmRequestEvent<O>?): O

Low level transform, not necessarily aware of platform

Link copied to clipboard
open override fun <O> doTransformWithThinking(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, llmRequestEvent: LlmRequestEvent<O>?): ThinkingResponse<O>

Low level transform with thinking block extraction, not necessarily aware of platform.

Link copied to clipboard
open override fun <O> doTransformWithThinkingIfPossible(messages: List<Message>, interaction: LlmInteraction, outputClass: Class<O>, llmRequestEvent: LlmRequestEvent<O>?): <Error class: unknown class><ThinkingResponse<O>>

Low level transform with thinking block extraction and MaybeReturn semantics, not necessarily aware of platform. Returns a failure result if the LLM indicates it cannot create the object.

Link copied to clipboard
open override fun generate(prompt: String, interaction: LlmInteraction, agentProcess: AgentProcess, action: Action?): String

Generate text in the context of an AgentProcess.

Link copied to clipboard
open override fun onPlatformEvent(event: AgentPlatformEvent)

An event relating to the platform or leading to the creation of an AgentProcess, such as the choice of a goal. No process is available at this point.

Link copied to clipboard
open override fun onProcessEvent(event: AgentProcessEvent)

Listen to an event during the execution of an AgentProcess

Link copied to clipboard

Request graceful termination of the current action only. Convenience extension that delegates to AgentProcess.terminateAction.

Link copied to clipboard

Request graceful termination of the entire agent process. Convenience extension that delegates to AgentProcess.terminateAgent.