ObjectCreator

interface ObjectCreator<T>

Create an object of the given type from a prompt or messages. Allows setting strongly typed examples.

Functions

Link copied to clipboard
abstract fun fromMessages(messages: List<Message>): T

Create an object from messages

Link copied to clipboard
open fun fromPrompt(prompt: String): T

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

Link copied to clipboard
abstract fun withExample(description: String, value: T): ObjectCreator<T>

Add an example of the desired output to the prompt. This will be included in JSON.