Skip to main content

Answer

Struct Answer 

Source
pub struct Answer {
Show 45 fields pub kind: QuestionType, pub probabilities: IndexMap<String, f64>, pub confidence: Option<f64>, pub choice: Option<String>, pub noul: Option<f64>, pub score: Option<f64>, pub legend: Option<IndexMap<String, String>>, pub selected: Option<Vec<String>>, pub threshold: Option<f64>, pub set_confidence: Option<f64>, pub action: Option<String>, pub answer: Option<String>, pub expected_costs: Option<IndexMap<String, f64>>, pub calibration: Option<String>, pub refused: Option<String>, pub max_error: Option<String>, pub evidence: Option<Vec<EvidenceSpan>>, pub objective: Option<MultiObjective>, pub expected_score: Option<f64>, pub constraints_applied: Option<Value>, pub tool: Option<String>, pub tools: Option<Vec<String>>, pub call: Option<bool>, pub multi: Option<bool>, pub ranking: Option<Vec<ToolRanking>>, pub deferred: Option<bool>, pub experimental: Option<bool>, pub label: Option<String>, pub top_label: Option<String>, pub labels: Option<Vec<String>>, pub scores: Option<IndexMap<String, f64>>, pub automated: Option<Automation>, pub claims: Option<IndexMap<String, ClaimResult>>, pub all_supported: Option<bool>, pub not_supported: Option<Vec<String>>, pub compressed: Option<String>, pub kept: Option<Vec<usize>>, pub units: Option<Vec<CompressionUnit>>, pub unit: Option<CompressionUnitKind>, pub original_chars: Option<usize>, pub compressed_chars: Option<usize>, pub ratio: Option<f64>, pub data: Option<IndexMap<String, Value>>, pub fields: Option<IndexMap<String, ExtractField>>, pub extra: Map<String, Value>,
}
Expand description

Native answer. Fields used by other question types are absent. Unknown fields are retained in extra.

Fields§

§kind: QuestionType

Question type.

§probabilities: IndexMap<String, f64>

Native probabilities (for multi: independent P(yes) values).

§confidence: Option<f64>

Native max probability for choice, noul, score and act. Multi uses set_confidence.

§choice: Option<String>

Chosen key for choice.

§noul: Option<f64>

P(yes) for noul.

§score: Option<f64>

Weighted zero-based score.

§legend: Option<IndexMap<String, String>>

Displayed option texts for score, indexed by key.

§selected: Option<Vec<String>>

Selected keys for multi.

§threshold: Option<f64>

Multi selection threshold.

§set_confidence: Option<f64>

Probability of precisely the selected set for multi.

§action: Option<String>

Chosen action for act.

§answer: Option<String>

Most probable outcome for act.

§expected_costs: Option<IndexMap<String, f64>>

Expected costs by action for act.

§calibration: Option<String>

Calibration status for act.

§refused: Option<String>

Refused automatic action for act.

§max_error: Option<String>

Message when the requested certified threshold is unavailable.

§evidence: Option<Vec<EvidenceSpan>>

Evidence offsets count Unicode characters, not bytes or UTF-16 code units.

§objective: Option<MultiObjective>

Multi selection objective; absent for legacy threshold responses.

§expected_score: Option<f64>

Expected score of the selected set.

§constraints_applied: Option<Value>

Constraint diagnostics preserved from the server.

§tool: Option<String>

Selected single tool, null on certified deferral.

§tools: Option<Vec<String>>

Selected tools in multi mode.

§call: Option<bool>

Whether the result selects an actual tool.

§multi: Option<bool>

Whether this is a multi-tool result.

§ranking: Option<Vec<ToolRanking>>

Ranked tool candidates.

§deferred: Option<bool>

Whether the automatic decision was deferred.

§experimental: Option<bool>

Experimental task marker.

§label: Option<String>

Single classification label.

§top_label: Option<String>

Top classification label.

§labels: Option<Vec<String>>

Selected classification labels.

§scores: Option<IndexMap<String, f64>>

Classification probabilities.

§automated: Option<Automation>

Task-specific certified automation; null values mean unavailable.

§claims: Option<IndexMap<String, ClaimResult>>

Per-claim verification results.

§all_supported: Option<bool>

Whether every claim is supported.

§not_supported: Option<Vec<String>>

Flagged claim keys.

§compressed: Option<String>

Source-preserving compressed text.

§kept: Option<Vec<usize>>

Kept source unit indices.

§units: Option<Vec<CompressionUnit>>

Source unit spans in Unicode code points.

§unit: Option<CompressionUnitKind>

Compression segmentation.

§original_chars: Option<usize>

Source Unicode code point count.

§compressed_chars: Option<usize>

Compressed Unicode code point count.

§ratio: Option<f64>

Compressed/source character ratio.

§data: Option<IndexMap<String, Value>>

Nested extracted data; missing values are null.

§fields: Option<IndexMap<String, ExtractField>>

Extraction field provenance and probabilities.

§extra: Map<String, Value>

Future native fields.

Trait Implementations§

Source§

impl Clone for Answer

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Answer

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Answer

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more