Package com.embabel.agent.api.common
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.
-
-
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. TfromPrompt(String prompt)Create an object of the desired type using the given prompt and LLM options from context (process context or implementing class). abstract TfromMessages(List<Message> messages)Create an object of the desired typed from messages -
-
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
-
fromMessages
abstract T fromMessages(List<Message> messages)
Create an object of the desired typed from messages
-
-
-
-