Omni.Answer.Choice (Omni v2.0.0)

Copy Markdown View Source

The answer to an Omni.Question.Choice.

%Omni.Answer.Choice{
  choice: :infra,
  probabilities: [billing: 0.02, infra: 0.95, other: 0.03],
  confidence: 0.93
}

Struct fields

  • :choice - the most likely choice, by the question's key
  • :probabilities - {key, probability} for every choice, in the question's order and with its keys
  • :confidence - the provider's confidence in the choice, or nil when it gives none. Hosts compute it differently, so compare it only within one provider; the probabilities are the portable result

Summary

Types

t()

The answer to a choice question.

Functions

Creates a choice answer from a keyword list or map of fields.

Types

t()

@type t() :: %Omni.Answer.Choice{
  choice: Omni.Question.key(),
  confidence: float() | nil,
  probabilities: [{Omni.Question.key(), float()}]
}

The answer to a choice question.

Functions

new(attrs)

@spec new(Enumerable.t()) :: t()

Creates a choice answer from a keyword list or map of fields.