SupervisorInvocation

data class SupervisorInvocation<T : Any> constructor(agentPlatform: AgentPlatform, goalType: Class<T>, goalDescription: String = "Produce ", processOptions: ProcessOptions = ProcessOptions(), agentScopeBuilder: AgentScopeBuilder = agentPlatform) : TypedInvocation<T, SupervisorInvocation<T>> , ScopedInvocation<SupervisorInvocation<T>>

Invoker for supervisor-orchestrated agents.

Uses an LLM to orchestrate actions from @EmbabelComponent and @Agent annotated classes to achieve a specified goal type. The supervisor sees type schemas and decides which actions to call based on available artifacts on the blackboard.

Unlike UtilityInvocation, this requires a goal type to work toward.

Parameters

agentPlatform

the agent platform to create and manage agent processes

goalType

the type of object to produce as the goal

goalDescription

description of the goal for the supervisor LLM

processOptions

options to configure the agent process

agentScopeBuilder

emits the scope to create the supervisor agent in

Constructors

Link copied to clipboard
constructor(agentPlatform: AgentPlatform, goalType: Class<T>, goalDescription: String = "Produce ", processOptions: ProcessOptions = ProcessOptions(), agentScopeBuilder: AgentScopeBuilder = agentPlatform)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
open override val resultType: Class<T>

The class of the result type this invocation will produce.

Functions

Link copied to clipboard

Create a supervisor agent from platform actions.

Link copied to clipboard
open fun invoke(map: Map<String, Any>): T

Invokes the agent with a map of named inputs and returns the typed result.

open fun invoke(obj: Any, vararg objs: Any): T

Invokes the agent with one or more arguments and returns the typed result.

Link copied to clipboard

Invokes the agent asynchronously with a map of named inputs.

open fun invokeAsync(obj: Any, vararg objs: Any): CompletableFuture<T>

Invokes the agent asynchronously with one or more arguments.

Link copied to clipboard
fun <U : Any> returning(resultType: Class<U>): SupervisorInvocation<U>
Link copied to clipboard
open fun run(map: Map<String, Any>): AgentProcess

Runs the agent with a map of named inputs.

open fun run(obj: Any, vararg objs: Any): AgentProcess

Runs the agent with one or more arguments

Link copied to clipboard
open override fun runAsync(map: Map<String, Any>): CompletableFuture<AgentProcess>

Runs the agent asynchronously with a map of named inputs.

open override fun runAsync(obj: Any, vararg objs: Any): CompletableFuture<AgentProcess>

Runs the agent asynchronously with one or more arguments

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun withScope(agentScopeBuilder: AgentScopeBuilder): SupervisorInvocation<T>

Set the scope of actions and goals