Creating
Fluent interface for creating strongly-typed objects from LLM responses. Provides configuration options for:
Adding examples
Filtering properties
Enabling/disabling validation
Instances are obtained via PromptRunner.creating.
Parameters
the type of object to create
Inheritors
Functions
Create an object of the desired type from messages.
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 @Action method that provides access to domain object instances, offering type safety.
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
Add multiple examples using vararg syntax. Each example will be added as a prompt contributor to improve LLM output quality.
Add multiple examples from a list or other iterable. Each example will be added as a prompt contributor to improve LLM output quality.
Exclude the given properties when creating an object.
Excludes the given properties when creating an object.
Disables validation of created objects.
Include the given properties when creating an object.
Includes the given properties when creating an object.
Add a filter that determines which properties are to be included when creating an object.
Set whether to validate created objects.