PromptCondition

data class PromptCondition(val name: String, val prompt: (context: OperationContext) -> String, val llm: LlmCall) : Condition

Prompt an LLM to evaluate a condition. Evaluating prompt conditions is expensive, so we need to consider efficiency here.

Parameters

name

name of the condition

prompt

the prompt to evaluate. Typically created from Blackboard state from the ProcessContext.

Constructors

Link copied to clipboard
constructor(name: String, prompt: (context: OperationContext) -> String, llm: LlmCall)

Properties

Link copied to clipboard
open override val cost: <Error class: unknown class> = 1.0

This is as expensive as it can get

Link copied to clipboard
Link copied to clipboard
open val name: String
Link copied to clipboard
val prompt: (context: OperationContext) -> String

Functions

Link copied to clipboard
open infix fun and(b: Condition): Condition
Link copied to clipboard
open override fun evaluate(context: OperationContext): ConditionDetermination

Evaluate the condition in the context of the process. This may be expensive, so the cost is provided. The infrastructure will attempt to call this function infrequently on expensive conditions, so there's no urgency to optimize here.

Link copied to clipboard
open fun infoString(verbose: Boolean?, indent: Int): String
Link copied to clipboard
open operator fun inv(): Condition
Link copied to clipboard
open operator fun not(): Condition
Link copied to clipboard
open infix fun or(b: Condition): Condition