Package com.embabel.agent.api.common
Interface PromptRunnerOperations
-
- All Implemented Interfaces:
public interface PromptRunnerOperationsUser-facing interface for executing prompts. These are what are executed on a finally configured PromptRunner.
-
-
Method Summary
Modifier and Type Method Description StringgenerateText(String prompt)Generate text <T extends Any> TcreateObject(String prompt, Class<T> outputClass)Create an object of the given type using the given prompt and LLM options from context (process context or implementing class). abstract <T extends Any> TcreateObject(List<Message> messages, Class<T> outputClass)Create an object from messages <T extends Any> TcreateObjectIfPossible(String prompt, Class<T> outputClass)Try to create an object of the given type using the given prompt and LLM options from context (process context or implementing class). abstract <T extends Any> TcreateObjectIfPossible(List<Message> messages, Class<T> outputClass)abstract AssistantMessagerespond(List<Message> messages)Respond in a conversation abstract TemplateOperationswithTemplate(String templateName)Use operations from a given template abstract BooleanevaluateCondition(String condition, String context, Double confidenceThreshold)-
-
Method Detail
-
generateText
String generateText(String prompt)
Generate text
-
createObject
<T extends Any> T createObject(String prompt, Class<T> outputClass)
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
-
createObject
abstract <T extends Any> T createObject(List<Message> messages, Class<T> outputClass)
Create an object from messages
-
createObjectIfPossible
<T extends Any> T createObjectIfPossible(String prompt, Class<T> outputClass)
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
-
createObjectIfPossible
abstract <T extends Any> T createObjectIfPossible(List<Message> messages, Class<T> outputClass)
-
respond
abstract AssistantMessage respond(List<Message> messages)
Respond in a conversation
-
withTemplate
abstract TemplateOperations withTemplate(String templateName)
Use operations from a given template
-
evaluateCondition
abstract Boolean evaluateCondition(String condition, String context, Double confidenceThreshold)
-
-
-
-