StructuredOutput

sealed interface StructuredOutput<T>(source)

Defines how structured outputs should be generated.

Can be StructuredOutput.Manual or StructuredOutput.Native

Parameters

T

The type of structured data.

Inheritors

Types

Link copied to clipboard
data class Manual<T>(val structure: StructuredData<T, *>) : StructuredOutput<T>

Instructs the model to produce structured output through explicit prompting.

Link copied to clipboard
data class Native<T>(val structure: StructuredData<T, *>) : StructuredOutput<T>

Leverages a model's built-in structured output capabilities.

Properties

Link copied to clipboard
abstract val structure: StructuredData<T, *>

The definition of a structure.