ActionContext

Context for actions

Parameters

processContext

the process context

action

the action being executed, if one is executing. This is useful for getting tools etc.

Inheritors

Properties

Link copied to clipboard
abstract val action: Action?
Link copied to clipboard
Link copied to clipboard
abstract val blackboardId: String

Unique identifier of this blackboard. Blackboard doesn't extend StableIdentified to avoid conflict with implementations that are otherwise identified

Link copied to clipboard
abstract val objects: List<Any>

Entries in the order they were added. The default instance of any type is the last one Objects are immutable and may not be removed.

Link copied to clipboard
abstract val operation: Operation

Action or operation that is being executed.

Link copied to clipboard
abstract override val processContext: ProcessContext
Link copied to clipboard

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

Functions

Link copied to clipboard
open fun addAll(objects: List<Any>)
Link copied to clipboard
abstract fun addObject(value: Any): Bindable

Add to entries without binding to a variable name. Implementations must respect the order in which entities were added. This is equivalent to using the default binding name as the key. For example, if you add a Dog to the blackboard without a key, it will be bound to the default binding name "it" and will be the last entry in the list of objects. Equivalent:

Link copied to clipboard
Link copied to clipboard
open fun ai(): Ai

Get AI functionality for this context

Link copied to clipboard
inline fun <T> Blackboard.all(): List<T>

Return all entries of a specific type

fun <T> Blackboard.all(clazz: Class<T>): List<T>
Link copied to clipboard
open fun <O : Any> asSubProcess(outputClass: Class<O>, agentScopeBuilder: AgentScopeBuilder<O>): O
open fun <O : Any> asSubProcess(outputClass: Class<O>, agent: Agent): O

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

Link copied to clipboard
inline fun <O : Any> ActionContext.asSubProcess(agentScopeBuilder: AgentScopeBuilder<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
abstract fun bind(key: String, value: Any): Bindable
Link copied to clipboard
open fun bindAll(bindings: Map<String, Any>)
Link copied to clipboard
open fun <T> count(clazz: Class<T>): Int
Link copied to clipboard
inline fun <T> Blackboard.count(): Int

Count entries of the given type

Link copied to clipboard
abstract fun domainObjectInstances(): List<Any>

Return the domain object instances that are relevant for this action context. They may expose tools.

Link copied to clipboard

Expose the model data for use in prompts Prefer more strongly typed usage patterns

Link copied to clipboard
open fun <T : Any> fireAgent(obj: Any, resultType: Class<T>): CompletableFuture<T>?

Any agents known to the present platform that can handle the given object and return the given result type. It is not an error if there are no such agents

Link copied to clipboard
abstract operator fun get(name: String): Any?

Return the value of a variable, if it is set. Does not limit return via type information.

Link copied to clipboard
abstract fun getCondition(key: String): Boolean?
Link copied to clipboard
open fun getValue(variable: String = IoBinding.DEFAULT_BINDING, type: String, dataDictionary: DataDictionary): Any?

Resolve the value of a variable, if it is set. Resolve superclasses For example, getValue("it", "Animal") will match a Dog if Dog extends Animal

Link copied to clipboard
open fun <T> last(clazz: Class<T>): T?

Last entry of the given type, if there is one

Link copied to clipboard
inline fun <T> Blackboard.last(): T?

Last entry of the given type, if there is one

Link copied to clipboard
inline fun <T> Blackboard.lastOrNull(predicate: (t: T) -> Boolean): T?
fun <T> Blackboard.lastOrNull(clazz: Class<T>, predicate: (t: T) -> Boolean): T?
Link copied to clipboard
open override fun lastResult(): Any?

Last result, of any type, if there is one.

Link copied to clipboard
open fun <T, R> parallelMap(items: Collection<T>, maxConcurrency: Int, transform: (t: T) -> R): List<R>

Execute the operations in parallel.

Link copied to clipboard
abstract operator fun plusAssign(pair: <Error class: unknown class><String, Any>)
abstract operator fun plusAssign(value: Any)
open operator fun plusAssign(bindings: Map<String, Any>)
Link copied to clipboard
open override fun promptRunner(llm: <Error class: unknown class>, toolGroups: Set<ToolGroupRequirement>, toolObjects: List<ToolObject>, promptContributors: List<<Error class: unknown class>>, contextualPromptContributors: List<ContextualPromptElement>, generateExamples: Boolean): PromptRunner

Create a prompt runner for this context. Application code should always go through this method to run LLM operations.

Create a prompt runner for this context that can be customized later. Principally for use from Java.

Link copied to clipboard
abstract operator fun set(key: String, value: Any)

Bind a value to a name

Link copied to clipboard
abstract fun setCondition(key: String, value: Boolean): Blackboard

Explicitly set the condition value Used in planning.

Link copied to clipboard
abstract fun spawn(): Blackboard

Spawn an independent child blackboard based on the content of this