pub struct SystemOneResponse {
pub model: String,
pub answers: BTreeMap<String, Answer>,
pub usage: Usage,
pub request_id: Option<String>,
}Expand description
The response to a SystemOneRequest.
Fields§
§model: StringThe versioned ID of the model that actually answered, which may differ from the alias supplied in the request.
answers: BTreeMap<String, Answer>Answers keyed by the question IDs supplied in the request.
usage: UsageToken usage, defaulting to 0 per field when the server omits it.
request_id: Option<String>The x-typesafe-request-id response header, when present.
Implementations§
Source§impl SystemOneResponse
impl SystemOneResponse
Sourcepub fn noul(&self, id: &str) -> Option<&NoulAnswer>
pub fn noul(&self, id: &str) -> Option<&NoulAnswer>
Returns the noul answer for id, when that question was answered as
a noul.
Sourcepub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
pub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
Returns the choice answer for id, when that question was answered
as a choice.
Sourcepub fn score(&self, id: &str) -> Option<&ScoreAnswer>
pub fn score(&self, id: &str) -> Option<&ScoreAnswer>
Returns the score answer for id, when that question was answered as
a score.
Sourcepub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
pub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
Iterates every (id, noul answer) pair.
Sourcepub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
pub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
Iterates every (id, choice answer) pair.
Sourcepub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
pub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
Iterates every (id, score answer) pair.
Trait Implementations§
Source§impl Clone for SystemOneResponse
impl Clone for SystemOneResponse
Source§impl Debug for SystemOneResponse
impl Debug for SystemOneResponse
Source§impl PartialEq for SystemOneResponse
impl PartialEq for SystemOneResponse
impl StructuralPartialEq for SystemOneResponse
Auto 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