Interface PromptRunner.Rendering

  • All Implemented Interfaces:

    
    public interface PromptRunner.Rendering
    
                        

    Fluent 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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      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.
      abstract String generateText(Map<String, Object> model) Generate text using the given model to render the template and LLM options from context.
      abstract AssistantMessage respondWithSystemPrompt(Conversation conversation, Map<String, Object> model) Respond in the conversation using the rendered template as system prompt.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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 create
        model - 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 far
        model - the model data to render the system prompt template with.
        Returns:

        the assistant message response