pub struct ChoiceAnswer {
pub choice: String,
pub probabilities: HashMap<String, f64>,
pub confidence: f64,
}Expand description
probabilities is a full distribution (sums to 1) over the criteria keys.
confidence is required (per spec). f64 for wire-format precision.
Fields§
§choice: StringSelected option identifier matching one of the keys in question criteria.
probabilities: HashMap<String, f64>Normalized probability distribution over all criteria options summing to 1.0.
confidence: f64Model confidence score in [0.0, 1.0] derived from the probability distribution.
Trait Implementations§
Source§impl Clone for ChoiceAnswer
impl Clone for ChoiceAnswer
Source§impl Debug for ChoiceAnswer
impl Debug for ChoiceAnswer
Source§impl<'de> Deserialize<'de> for ChoiceAnswer
impl<'de> Deserialize<'de> for ChoiceAnswer
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for ChoiceAnswer
impl JsonSchema for ChoiceAnswer
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ChoiceAnswer
impl PartialEq for ChoiceAnswer
Source§impl Serialize for ChoiceAnswer
impl Serialize 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