#[non_exhaustive]pub struct SystemOneResponse {
pub model: String,
pub usage: Usage,
pub answers: IndexMap<String, Answer>,
pub raw: Value,
pub meta: ResponseMeta,
}Expand description
The result of a System One call.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.model: StringThe model that answered.
usage: UsageToken usage.
answers: IndexMap<String, Answer>Answers keyed by question name, in server order. Answer types unknown to this SDK version
are skipped (with a tracing warning) and remain visible in SystemOneResponse::raw.
raw: ValueThe full decoded body. Object keys follow serde_json::Map ordering (sorted unless your
build enables serde_json’s preserve_order); the typed fields above keep server order.
meta: ResponseMetaHTTP metadata.
Implementations§
Source§impl SystemOneResponse
impl SystemOneResponse
Sourcepub fn request_id(&self) -> Option<&str>
pub fn request_id(&self) -> Option<&str>
The x-typesafe-request-id header.
Sourcepub fn noul(&self, name: &str) -> Option<&NoulAnswer>
pub fn noul(&self, name: &str) -> Option<&NoulAnswer>
The answer to name, if it is a Noul.
Sourcepub fn choice(&self, name: &str) -> Option<&ChoiceAnswer>
pub fn choice(&self, name: &str) -> Option<&ChoiceAnswer>
The answer to name, if it is a Choice.
Sourcepub fn score(&self, name: &str) -> Option<&ScoreAnswer>
pub fn score(&self, name: &str) -> Option<&ScoreAnswer>
The answer to name, if it is a Score.
Sourcepub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
pub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
All Noul answers.
Sourcepub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
pub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
All Choice answers.
Sourcepub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
pub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
All Score answers.
Trait Implementations§
Source§impl Clone for SystemOneResponse
impl Clone for SystemOneResponse
Source§fn clone(&self) -> SystemOneResponse
fn clone(&self) -> SystemOneResponse
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 moreAuto Trait Implementations§
impl Freeze for SystemOneResponse
impl RefUnwindSafe for SystemOneResponse
impl Send for SystemOneResponse
impl Sync for SystemOneResponse
impl Unpin for SystemOneResponse
impl UnsafeUnpin for SystemOneResponse
impl UnwindSafe for SystemOneResponse
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