Skip to content

Type Alias: AiAnswer ​

ts
type AiAnswer = 
  | {
  confidence: number;
  probability: number;
  type: "boolean";
}
  | {
  choice: string;
  confidence?: number;
  probabilities?: Record<string, number>;
  type: "choice";
}
  | {
  confidence?: number;
  probabilities?: Record<string, number>;
  score: number;
  type: "score";
};

One answer, of its question's type. A boolean's probability is P(true); a choice's and a score's distributions come only from a native engine. confidence is the vendor's, or the likeliest outcome's probability.

Released under the Apache-2.0 License.