Interface ObjectCreator

  • All Implemented Interfaces:

    
    public interface ObjectCreator<T extends Object>
    
                        

    Interface to create objects of the given type from a prompt or messages. Allows setting strongly typed examples.

    • 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 ObjectCreator<T> withExample(String description, T value) Add an example of the desired output to the prompt.
      T fromPrompt(String prompt) Create an object of the desired type using the given prompt and LLM options from context (process context or implementing class).
      abstract T fromMessages(List<Message> messages) Create an object of the desired typed from messages
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • withExample

         abstract ObjectCreator<T> withExample(String description, T value)

        Add an example of the desired output to the prompt. This will be included in JSON. It is possible to call this method multiple times. This will override PromptRunner.withGenerateExamples

      • fromPrompt

         T fromPrompt(String prompt)

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