Prompt Runner
User code should always use this interface to execute prompts. Typically obtained from an OperationContext or ActionContext parameter, via OperationContext.ai A PromptRunner is immutable once constructed, and has determined LLM and hyperparameters. Use the "with" methods to evolve the state to your desired configuration before executing createObject, generateText or other LLM invocation methods. Thus, a PromptRunner can be reused within an action implementation. A contextual facade to LlmOperations.
See also
Inheritors
Properties
Whether to generate examples for the prompt. Defaults to unknown: Set to false if generating your own examples.
Tool groups exposed. This will include directly registered tool groups and tool groups resolved from ToolGroups.
Additional objects with @Tool annotation for use in this PromptRunner
Functions
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
Create an object from messages
Create an object of the given type
Generate text
Respond in a conversation
Add a prompt contributor that can see context
Set whether to generate examples of the output in the prompt on a per-PromptRunner basis. This overrides platform defaults.
Add a list of handoffs to agents on this platform
Specify an LLM for the PromptRunner
Add a prompt contributor that can add to the prompt. Facilitates reuse of prompt elements.
Add varargs of prompt contributors and contextual prompt elements.
Add a reference which provides tools and prompt contribution.
Add varargs of references which provide tools and prompt contributions.
Add a list of references which provide tools and prompt contributions.
Add a list of subagents to hand off to.
Add a system prompt
Use operations from a given template
Allows for dynamic tool groups to be added to the PromptRunner.
Add a tool group to the PromptRunner
Add a tool object
Add a tool object to the prompt runner.
Add a set of tool groups to the PromptRunner