ClassifierQuestion interface

A single question within a multi-question ClassifierSchema.

Signature:

export declare interface ClassifierQuestion 

Properties

Property Modifiers Type Description
id string Unique identifier key in the returned ClassifierResult record.
type ClassifierQuestionType Question evaluation type.
prompt string Task instruction or natural language condition prompt (optional when examples or fittedHead are set).
options ClassifierOption[] Candidate options (required for ordinal, and for categorical unless fittedHead is set).
threshold number Decision threshold in [0.0, 1.0] for binary questions. Defaults to 0.5.
temperature number Softmax temperature override (> 0.0). When unset or <= 0, the model's calibrated temperature is used.
normalizePrior boolean Whether to normalize against the empty-context ("[None]") prior.
positiveExamples string[] Example inputs for which a binary question is true / false. With both, embedding models fit a classifier on them and prompt may be empty.
negativeExamples string[]
inputPrompt InputPrompt How examples and inputs are embedded. Only used with examples.
balanceClassWeights boolean With option examples, weights each option by N / (K * N_c), so that options with fewer examples aren't penalized. Defaults to true.
fittedHead Uint8Array Optional pre-fitted FittedHead binary payload (e.g. from exportFittedHeads()) for boolean or choice questions on embedding models. Cannot be combined with examples.

ClassifierQuestion.id

Unique identifier key in the returned ClassifierResult record.

Signature:

id: string;

ClassifierQuestion.type

Question evaluation type.

Signature:

type: ClassifierQuestionType;

ClassifierQuestion.prompt

Task instruction or natural language condition prompt (optional when examples or fittedHead are set).

Signature:

prompt?: string;

ClassifierQuestion.options

Candidate options (required for ordinal, and for categorical unless fittedHead is set).

Signature:

options?: ClassifierOption[];

ClassifierQuestion.threshold

Decision threshold in [0.0, 1.0] for binary questions. Defaults to 0.5.

Signature:

threshold?: number;

ClassifierQuestion.temperature

Softmax temperature override (> 0.0). When unset or <= 0, the model's calibrated temperature is used.

Signature:

temperature?: number;

ClassifierQuestion.normalizePrior

Whether to normalize against the empty-context ("[None]") prior.

Signature:

normalizePrior?: boolean;

ClassifierQuestion.positiveExamples

Example inputs for which a binary question is true / false. With both, embedding models fit a classifier on them and prompt may be empty.

Signature:

positiveExamples?: string[];

ClassifierQuestion.negativeExamples

Signature:

negativeExamples?: string[];

ClassifierQuestion.inputPrompt

How examples and inputs are embedded. Only used with examples.

Signature:

inputPrompt?: InputPrompt;

ClassifierQuestion.balanceClassWeights

With option examples, weights each option by N / (K * N_c), so that options with fewer examples aren't penalized. Defaults to true.

Signature:

balanceClassWeights?: boolean;

ClassifierQuestion.fittedHead

Optional pre-fitted FittedHead binary payload (e.g. from exportFittedHeads()) for boolean or choice questions on embedding models. Cannot be combined with examples.

Signature:

fittedHead?: Uint8Array;