BooleanQuestion
struct BooleanQuestion: Sendable, EquatableConfiguration for evaluating a natural-language boolean predicate.
-
init(condition:threshold:temperature:normalizePrior:positiveExamples:negativeExamples:inputPrompt:fittedHead:)
Creates a new
BooleanQuestioninstance.Declaration
Swift
init(condition: String = "", threshold: Float = 0.5, temperature: Float = 0.0, normalizePrior: Bool = false, positiveExamples: [String] = [], negativeExamples: [String] = [], inputPrompt: InputPrompt = .unspecified, fittedHead: Data? = nil) -
Creates an examples-only
BooleanQuestion.Throws
DecisionMakerError.invalidArgumentif either example list is empty, contains an empty string, orthresholdis outside[0.0, 1.0].Declaration
Swift
init(positiveExamples: [String], negativeExamples: [String], inputPrompt: InputPrompt = .unspecified, threshold: Float = 0.5, temperature: Float = 0.0) throws -
Natural-language condition statement to evaluate as
trueorfalse.May be empty when both
positiveExamplesandnegativeExamplesare provided, or whenfittedHeadis provided.Declaration
Swift
var condition: String -
Optional pre-fitted
FittedHeadbinary payload for embedding models.Declaration
Swift
var fittedHead: Data? -
How examples and inputs are embedded when examples are provided.
Declaration
Swift
var inputPrompt: InputPrompt -
Example inputs that should evaluate to
false.Must be provided together with
positiveExamples. Supported only by embedding models; other models throwDecisionMakerError.failedToEvaluate.Declaration
Swift
var negativeExamples: [String] -
Whether to subtract the empty-context prior log-odds before thresholding.
Cannot be
truewhen examples orfittedHeadare provided (DecisionMakerError.invalidArgument).Declaration
Swift
var normalizePrior: Bool -
Example inputs that should evaluate to
true.Must be provided together with
negativeExamples. Supported only by embedding models; other models throwDecisionMakerError.failedToEvaluate.Declaration
Swift
var positiveExamples: [String] -
Softmax temperature override (
0.0uses the model's calibrated default).Declaration
Swift
var temperature: Float -
Probability threshold in
[0.0, 1.0]above whichBooleanResult.valueistrue.Declaration
Swift
var threshold: Float