Package com.embabel.agent.api.common
Interface PromptRunner.Rendering
-
- All Implemented Interfaces:
public interface PromptRunner.RenderingFluent interface for rendering templates and generating LLM responses. Provides operations for:
Creating strongly-typed objects from rendered templates
Generating text from rendered templates
Responding in conversations with templates as system prompts
Instances are obtained via PromptRunner.rendering.
-
-
Method Summary
Modifier and Type Method Description abstract <T extends Any> TcreateObject(Class<T> outputClass, Map<String, Object> model)Create an object of the given type using the given model to render the template and LLM options from context. abstract StringgenerateText(Map<String, Object> model)Generate text using the given model to render the template and LLM options from context. abstract AssistantMessagerespondWithSystemPrompt(Conversation conversation, Map<String, Object> model)Respond in the conversation using the rendered template as system prompt. -
-
Method Detail
-
createObject
abstract <T extends Any> T createObject(Class<T> outputClass, Map<String, Object> model)
Create an object of the given type using the given model to render the template and LLM options from context.
- Parameters:
outputClass- the class of objects to createmodel- the model data to use for template rendering- Returns:
the created object of type T
-
generateText
abstract String generateText(Map<String, Object> model)
Generate text using the given model to render the template and LLM options from context.
- Parameters:
model- the model data to use for template rendering- Returns:
the generated text
-
respondWithSystemPrompt
abstract AssistantMessage respondWithSystemPrompt(Conversation conversation, Map<String, Object> model)
Respond in the conversation using the rendered template as system prompt.
- Parameters:
conversation- the conversation so farmodel- the model data to render the system prompt template with.- Returns:
the assistant message response
-
-
-
-