Package-level declarations

Types

Link copied to clipboard

Context for actions

Link copied to clipboard
open class Actor<T> constructor(val persona: T, val llm: <Error class: unknown class>, val toolGroups: Set<String> = emptySet())

Core abstraction for an LLM with tools and a persona. An Actor plays a role: Convenient way to combine a PromptContributor with an LLM and tools. Open to allow subclasses to add tools via @Tool methods

Link copied to clipboard

Reusable AgentFunction. Allows use of AgentPlatform as a function from I to O, with different process options.

Link copied to clipboard
data class AgentImage(val mimeType: String, val data: ByteArray)

Represents an image for Agent API operations. Provides convenient constructors for common image sources.

Link copied to clipboard

Typed operations over an agent platform

Link copied to clipboard
interface Aggregation

Tag interface to indicate that an implementing type should be built from the context from its bound fields. Provides a strongly typed way to wait on combined results. Makes a megazord! An aggregation should have multiple non-nullable fields, each of which will be bound to the blackboard. An aggregation is used as an input to the action.

Link copied to clipboard
interface Ai

Gateway to AI functionality in the context of an operation. This includes both LLM and embedding models.

Link copied to clipboard

Builder that can be injected into components to obtain Ai instances. Use when you want custom configuration.

Link copied to clipboard
interface Asyncer

Simple Java-friendly async interface.

Link copied to clipboard

Make a dynamic prompt contribution based on the operation context.

Link copied to clipboard
typealias Embedding = FloatArray
Link copied to clipboard

OperationContext that execute actions. An ExecutingOperationContext can execute agents as sub-processes.

Link copied to clipboard

ActionContext with a single input

Link copied to clipboard

ActionContext with multiple inputs

Link copied to clipboard
value class InteractionId(val value: String)

All prompt interactions through the platform need a unique id This allows LLM interactions to be optimized by an AgentPlatform

Link copied to clipboard
interface LlmReference

An LLmReference exposes tools and is a prompt contributor. The prompt contribution might describe how to use the tools or can include relevant information directly. Consider, for example, a reference to an API which is so small it's included in the prompt, versus a large API which must be accessed via tools. The reference name is used in a strategy for tool naming, so should be fairly short. Description may be more verbose. If you want a custom naming strategy, use a ToolObject directly, and add the PromptContributor separately.

Link copied to clipboard

Try to resolve a stuck agent process by trying all handlers in order

Link copied to clipboard
data class MultimodalContent(val text: String, val images: List<AgentImage> = emptyList())

Represents multimodal content for Agent API operations. This is a higher-level abstraction over the Chat API's ContentPart system designed specifically for use in Agent actions and prompt runners.

Link copied to clipboard

Builder for creating multimodal content fluently

Link copied to clipboard
class NoSuchAgentException(val agentName: String, val knownAgents: String) : IllegalArgumentException
Link copied to clipboard

Context for any operation. Exposes blackboard and process context.

Link copied to clipboard

Specifies the type of planner that an agent uses.

Link copied to clipboard

Services used by the platform and available to user-authored code.

Link copied to clipboard

User code should always use this interface to execute prompts. Typically obtained from an OperationContext or ActionContext parameter, via OperationContext.ai A PromptRunner is immutable once constructed, and has determined LLM and hyperparameters. Use the "with" methods to evolve the state to your desired configuration before executing createObject, generateText or other LLM invocation methods. Thus, a PromptRunner can be reused within an action implementation. A contextual facade to LlmOperations.

Link copied to clipboard

User-facing interface for executing prompts. These are what are executed on a finally configured PromptRunner.

Link copied to clipboard
interface SomeOf

Tag interface used as an action return type. Indicates that some of the fields will be bound to the blackboard. Fields are usually nullable.

Link copied to clipboard
fun interface StuckHandler

Attempts to resolve stuck processes

Link copied to clipboard
class StuckHandlerResult(val message: String, val handler: StuckHandler?, val code: StuckHandlingResultCode, val agentProcess: AgentProcess) : AbstractAgentProcessEvent
Link copied to clipboard
class Subagent

Define a handoff to a subagent.

Link copied to clipboard
class SupplierActionContext<O>(val processContext: ProcessContext, val action: Action, val outputClass: Class<O>) : ActionContext, Blackboard, AgenticEventListener
Link copied to clipboard
data class ToolObject(val objects: List<Any>, val namingStrategy: StringTransformer = StringTransformer.IDENTITY, val filter: (String) -> Boolean = { true })

Holds one or more annotated tool objects. Adds a naming strategy and a filter to the overall object.

Link copied to clipboard
interface ToolsStats

Tool statistics, indexed by tool name.

Link copied to clipboard
open class ToolStats(val name: String, val calls: Int, val averageResponseTime: Long = 0, val failures: Int = 0)

Stats around tool calls to a particular tool. Open to allow implementations to extend if they wish

Link copied to clipboard
fun interface Transformation<I, O>

Transformation function signature

Link copied to clipboard
data class TransformationActionContext<I, O>(val input: I, val processContext: ProcessContext, val action: Action, val inputClass: Class<I>, val outputClass: Class<O>) : InputActionContext<I> , Blackboard, AgenticEventListener
Link copied to clipboard
interface TypedOps

Enables typed operations using agentic systems

Functions

Link copied to clipboard
inline fun <I, O : Any> agentTransformer(agent: Agent): Action
fun <I, O : Any> agentTransformer(agent: Agent, pre: List<String> = emptyList(), post: List<String> = emptyList(), cost: CostComputation = { 0.0 }, value: CostComputation = { 0.0 }, canRerun: Boolean = false, inputClass: Class<I>, outputClass: Class<O>): Action
Link copied to clipboard
inline fun <I, O : Any> asAction(agentName: String): Action

fun <I, O : Any> asAction(agentName: String, inputClass: Class<I>, outputClass: Class<O>, pre: List<String> = emptyList(), post: List<String> = emptyList(), cost: CostComputation = { 0.0 }, value: CostComputation = { 0.0 }, canRerun: Boolean = false): Action

Expose the named agent as an action of the given transformation type

Link copied to clipboard
inline fun <I, O : Any> Agent.asAction(): Action

Expose this agent as an action of the given transformation type

Link copied to clipboard
inline fun <I : Any, O> TypedOps.asFunction(): AgentFunction<I, O>
Link copied to clipboard
inline fun <O : Any> ActionContext.asSubProcess(agentScopeBuilder: TypedAgentScopeBuilder<O>): O
inline fun <O : Any> ActionContext.asSubProcess(agent: Agent): O

Run the given agent as a sub-process of this action context.

Link copied to clipboard
fun <I, O : Any> asTransformation(agent: Agent, outputClass: Class<O>): Transformation<I, O>
Link copied to clipboard
inline fun <I, O : Any> Agent.asTransformation(): Transformation<I, O>

Creates a transformation action from an agent

Link copied to clipboard
infix inline fun <T> PromptRunner.create(prompt: String): T

Create an object of the given type. Method overloading is evil

Link copied to clipboard
infix inline fun <T> PromptRunner.createObject(prompt: String): T

Create an object of the given type

inline fun <T> TemplateOperations.createObject(model: Map<String, Any>): T
Link copied to clipboard
inline fun <T> PromptRunner.createObjectIfPossible(prompt: String): T?
Link copied to clipboard

Create a multimodal content builder

Create multimodal content builder with initial text

Create multimodal content with text and a single image

fun multimodal(text: String, imageFile: File): MultimodalContent

Create multimodal content with text and image file

fun multimodal(text: String, imagePath: Path): MultimodalContent

Create multimodal content with text and image path

Link copied to clipboard
inline fun <I : Any, O : Any> TypedOps.transform(input: I, processOptions: ProcessOptions = ProcessOptions()): O

Perform the magic trick of getting from A to B

fun <I : Any, O : Any> TypedOps.transform(input: I, processOptions: ProcessOptions = ProcessOptions(), outputClass: Class<O>): O
Link copied to clipboard

Add an image from a file

Add an image from a path

Add an image with explicit MIME type and data