FakePromptRunner

data class FakePromptRunner(val llm: <Error class: unknown class>?, val toolGroups: Set<ToolGroupRequirement>, val toolObjects: List<ToolObject>, val promptContributors: List<<Error class: unknown class>>, contextualPromptContributors: List<ContextualPromptElement>, val generateExamples: Boolean?, context: OperationContext, _llmInvocations: MutableList<LlmInvocation> = mutableListOf(), responses: MutableList<Any?> = mutableListOf()) : PromptRunner

Constructors

Link copied to clipboard
constructor(llm: <Error class: unknown class>?, toolGroups: Set<ToolGroupRequirement>, toolObjects: List<ToolObject>, promptContributors: List<<Error class: unknown class>>, contextualPromptContributors: List<ContextualPromptElement>, generateExamples: Boolean?, context: OperationContext, _llmInvocations: MutableList<LlmInvocation> = mutableListOf(), responses: MutableList<Any?> = mutableListOf())

Properties

Link copied to clipboard
open override val generateExamples: Boolean?

Whether to generate examples for the prompt. Defaults to unknown: Set to false if generating your own examples.

Link copied to clipboard
open override val llm: <Error class: unknown class>?
Link copied to clipboard

The LLM calls that were made

Link copied to clipboard
open val promptContributors: List<<Error class: unknown class>>
Link copied to clipboard
open override val toolGroups: Set<ToolGroupRequirement>

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

Link copied to clipboard
open override val toolObjects: List<ToolObject>

Additional objects with @Tool annotation for use in this PromptRunner

Functions

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
open override fun <T> createObject(prompt: String, outputClass: Class<T>): T

Create an object of the given type using the given prompt and LLM options from context (process context or implementing class). Prompts are typically created within the scope of an

open override fun <T> createObject(messages: List<Message>, outputClass: Class<T>): T

Create an object from messages

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

Create an object of the given type

Link copied to clipboard
open override fun <T> createObjectIfPossible(prompt: String, outputClass: Class<T>): T?

Try to create an object of the given type using the given prompt and LLM options from context (process context or implementing class). Prompt is typically created within the scope of an

Link copied to clipboard
inline fun <T> PromptRunner.createObjectIfPossible(prompt: String): T?
Link copied to clipboard
open override fun <T> creating(outputClass: Class<T>): ObjectCreator<T>

Create an object creator for the given output class. Allows setting strongly typed examples.

Link copied to clipboard
open override fun evaluateCondition(condition: String, context: String, confidenceThreshold: <Error class: unknown class>): Boolean
Link copied to clipboard
fun expectResponse(response: Any?)

Add a response to the list of expected responses. This is used to simulate responses from the LLM.

Link copied to clipboard
open infix fun generateText(prompt: String): String

Generate text

Link copied to clipboard
open fun respond(messages: List<Message>): AssistantMessage

Respond in a conversation

Link copied to clipboard
Link copied to clipboard
open override fun withContextualPromptContributors(contextualPromptContributors: List<ContextualPromptElement>): PromptRunner

Add a prompt contributor that can see context

Link copied to clipboard
open override fun withGenerateExamples(generateExamples: Boolean): PromptRunner

Set whether to generate examples of the output in the prompt on a per-PromptRunner basis. This overrides platform defaults.

Link copied to clipboard
open override fun withHandoffs(vararg outputTypes: Class<*>): PromptRunner

Add a list of handoffs to agents on this platform

Link copied to clipboard
open override fun withLlm(llm: <Error class: unknown class>): PromptRunner

Specify an LLM for the PromptRunner

Link copied to clipboard
open fun withPromptContributor(promptContributor: <Error class: unknown class>): PromptRunner

Add a prompt contributor that can add to the prompt. Facilitates reuse of prompt elements.

Link copied to clipboard
open override fun withPromptContributors(promptContributors: List<<Error class: unknown class>>): PromptRunner
Link copied to clipboard
open fun withPromptElements(vararg elements: <Error class: unknown class>): PromptRunner

Add varargs of prompt contributors and contextual prompt elements.

Link copied to clipboard

Add a reference which provides tools and prompt contribution.

Link copied to clipboard
open fun withReferences(vararg references: LlmReference): PromptRunner

Add varargs of references which provide tools and prompt contributions.

Add a list of references which provide tools and prompt contributions.

Link copied to clipboard
open override fun withSubagents(vararg subagents: Subagent): PromptRunner

Add a list of subagents to hand off to.

Link copied to clipboard
open fun withSystemPrompt(systemPrompt: String): PromptRunner

Add a system prompt

Link copied to clipboard
open override fun withTemplate(templateName: String): TemplateOperations

Use operations from a given template

Link copied to clipboard
open fun withToolGroup(toolGroup: String): PromptRunner

Add a tool group to the PromptRunner

open override fun withToolGroup(toolGroup: ToolGroup): PromptRunner

Allows for dynamic tool groups to be added to the PromptRunner.

open override fun withToolGroup(toolGroup: ToolGroupRequirement): PromptRunner
Link copied to clipboard
open fun withToolGroups(toolGroups: Set<String>): PromptRunner
Link copied to clipboard
open fun withToolObject(toolObject: Any?): PromptRunner

Add a tool object to the prompt runner.

open override fun withToolObject(toolObject: ToolObject): PromptRunner

Add a tool object

Link copied to clipboard
open fun withToolObjects(vararg toolObjects: Any?): PromptRunner
Link copied to clipboard
open fun withTools(vararg toolGroups: String): PromptRunner

Add a set of tool groups to the PromptRunner