ChoiceQuestionSpec

@ApiStatus.Experimental
class ChoiceQuestionSpec : Question<ClassificationResult>

A question that asks the model to pick one option from a closed set.

Types

Link copied to clipboard
@ApiStatus.Experimental
class Builder

Collects the definition of one choice question. Each call to build returns a new question, and later changes to the builder do not affect questions it already built. A builder is not safe for use from several threads at once.

Properties

Link copied to clipboard
open override val instructions: String

The text that tells the model what to decide.

Link copied to clipboard
open override val kind: QuestionKind

The kind of the question, which matches its result type.

Link copied to clipboard
open override val name: String

The caller-owned name of the question. It is unique within a spec and names the answer in a response.

Link copied to clipboard

The options in declared order. The list cannot be modified. Option ids are unique.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard

Checks that a result fits this question and returns it unchanged. A selection must name one of the options. Results without a selection always fit.