pub struct ChoiceAnswer {
pub choice: String,
pub probabilities: BTreeMap<String, f64>,
pub confidence: f64,
}Expand description
The answer to a Choice.
choice: the most probable optionprobabilities: every option mapped to its probability; they sum to 1confidence: how concentrated the distribution is, from 0 to 1. It is not the probability that the choice is right.
Fields§
§choice: String§probabilities: BTreeMap<String, f64>§confidence: f64Implementations§
Source§impl ChoiceAnswer
impl ChoiceAnswer
Sourcepub fn probability(&self, option: &str) -> f64
pub fn probability(&self, option: &str) -> f64
The probability of option, or 0 if the answer doesn’t list it.
Trait Implementations§
Source§impl Clone for ChoiceAnswer
impl Clone for ChoiceAnswer
Source§fn clone(&self) -> ChoiceAnswer
fn clone(&self) -> ChoiceAnswer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChoiceAnswer
impl Debug for ChoiceAnswer
Source§impl PartialEq for ChoiceAnswer
impl PartialEq for ChoiceAnswer
impl StructuralPartialEq for ChoiceAnswer
Auto Trait Implementations§
impl Freeze for ChoiceAnswer
impl RefUnwindSafe for ChoiceAnswer
impl Send for ChoiceAnswer
impl Sync for ChoiceAnswer
impl Unpin for ChoiceAnswer
impl UnsafeUnpin for ChoiceAnswer
impl UnwindSafe for ChoiceAnswer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more