StructuredRequest

sealed interface StructuredRequest<T>(source)

Defines how structured outputs should be generated.

Can be StructuredRequest.Manual or StructuredRequest.Native

Parameters

T

The type of structured data.

Inheritors

Types

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

Instructs the model to produce structured output through explicit prompting.

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

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

Properties

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

The definition of a structure.