pub struct SystemOneResponse {
pub model: String,
pub answers: IndexMap<String, Answer>,
pub usage: Usage,
}Expand description
The response to a system_one evaluation.
Answers are keyed by the same ids used in the request’s question map.
Fields§
§model: StringThe model that performed the evaluation.
answers: IndexMap<String, Answer>One Answer per question, keyed by question id.
usage: UsageToken usage for the request.
Implementations§
Source§impl SystemOneResponse
impl SystemOneResponse
Sourcepub fn get(&self, id: &str) -> Option<&Answer>
pub fn get(&self, id: &str) -> Option<&Answer>
Get the answer for a question id, regardless of its type.
Sourcepub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
pub fn nouls(&self) -> impl Iterator<Item = (&str, &NoulAnswer)>
Iterate over all Answer::Noul answers.
Sourcepub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
pub fn choices(&self) -> impl Iterator<Item = (&str, &ChoiceAnswer)>
Iterate over all Answer::Choice answers.
Sourcepub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
pub fn scores(&self) -> impl Iterator<Item = (&str, &ScoreAnswer)>
Iterate over all Answer::Score answers.
Sourcepub fn noul(&self, id: &str) -> Option<&NoulAnswer>
pub fn noul(&self, id: &str) -> Option<&NoulAnswer>
Get a NoulAnswer by question id, if it is a noul answer.
Sourcepub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
pub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
Get a ChoiceAnswer by question id, if it is a choice answer.
Sourcepub fn score(&self, id: &str) -> Option<&ScoreAnswer>
pub fn score(&self, id: &str) -> Option<&ScoreAnswer>
Get a ScoreAnswer by question id, if it is a score answer.
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 moreSource§impl Debug for SystemOneResponse
impl Debug for SystemOneResponse
Source§impl<'de> Deserialize<'de> for SystemOneResponse
impl<'de> Deserialize<'de> for SystemOneResponse
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
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