CategoryMapping

@ApiStatus.Experimental
class CategoryMapping<T : Any>(instructions: String, values: Map<Category, T>)

A closed category domain paired with caller-owned values. Structural collections are copied; value references are retained and may themselves be mutable. Values, including Class tokens, never enter provider requests and are never instantiated or populated from model output. Categories follow the supplied map's iteration order; pass an ordered map for stable provider order.

Parameters

instructions

what the model is asked, for example "Which kind of animal is this?"

values

the categories and the value each one maps to

Constructors

Link copied to clipboard
constructor(instructions: String, values: Map<Category, T>)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The single source of category IDs and descriptions for requests and result mapping.

Functions

Link copied to clipboard

Resolve a valid selection, retaining non-selection variants and their evidence unchanged.

Link copied to clipboard

Returns a request that classifies the input with this mapping's spec.

Link copied to clipboard

Returns the classification spec built from this mapping's instructions and categories.