Agent Builder
class AgentBuilder(val name: String, val provider: String = "embabel", val version: <Error class: unknown class> = Semver(), val description: String, promptContributors: List<<Error class: unknown class>> = emptyList())
Instances of this are usually created via the convenient agent() function.
Types
Link copied to clipboard
Link copied to clipboard
class ConditionDelegateProvider(specifiedName: String? = null, factory: (name: String) -> Condition, conditions: MutableSet<Condition>)
Functions
Link copied to clipboard
Create an action
Link copied to clipboard
Link copied to clipboard
fun condition(name: String? = null, cost: <Error class: unknown class> = 0.0, block: ConditionPredicate): AgentBuilder.ConditionDelegateProvider
fun condition(name: String? = null, prompt: (context: OperationContext) -> String, llm: LlmCall = LlmCall()): AgentBuilder.ConditionDelegateProvider
Declare a condition determined with an LLM. Assign it a name to ensure type safe access val myCondition = condition("custom prompt")
Link copied to clipboard
Add a pattern builder, such as an aggregation flow, to the agent. Must be used if you have multiple actions
Link copied to clipboard
fun goal(name: String, description: String, satisfiedBy: KClass<*>? = null, requires: Set<KClass<*>> = if (satisfiedBy != null) {
setOf(satisfiedBy)
} else {
emptySet()
}, inputs: Set<IoBinding> = requires.map {
IoBinding(
// name = it.simpleName,
type = it,
)
}.toSet(), pre: List<Condition> = emptyList(), value: <Error class: unknown class> = 0.0, export: Export = Export())
Add a goal to the agent.
Link copied to clipboard
Add an action is an anonymous agent. This is valuable because the agent will be private and will not pollute the global action space.
Link copied to clipboard
inline fun <I, O : Any> promptedTransformer(name: String, description: String = name, pre: List<Condition> = emptyList(), post: List<Condition> = emptyList(), inputVarName: String = IoBinding.DEFAULT_BINDING, outputVarName: String = IoBinding.DEFAULT_BINDING, cost: <Error class: unknown class> = 0.0, toolGroups: Set<ToolGroupRequirement> = emptySet(), qos: ActionQos = ActionQos(), referencedInputProperties: Set<String>? = null, llm: <Error class: unknown class> = LlmOptions(), promptContributors: List<<Error class: unknown class>> = emptyList(), canRerun: Boolean = false, toolCallbacks: Collection<<Error class: unknown class>> = emptyList(), noinline prompt: (actionContext: TransformationActionContext<I, O>) -> String)
Add an action that is a transformation using an LLM.
Link copied to clipboard
Add an action that references the agent with a given name
Link copied to clipboard
Require prompt contributors at agent level
Link copied to clipboard
inline fun <I, O : Any> transformation(name: String = "-", description: String = name, preConditions: List<Condition> = emptyList(), pre: List<String> = emptyList(), post: List<Condition> = emptyList(), inputVarName: String = IoBinding.DEFAULT_BINDING, outputVarName: String? = IoBinding.DEFAULT_BINDING, cost: <Error class: unknown class> = 0.0, toolGroups: Set<ToolGroupRequirement> = emptySet(), qos: ActionQos = ActionQos(), referencedInputProperties: Set<String>? = null, block: Transformation<I, O>)
Add an action that is a transformation NOT using an LLM.