pub struct Response {
pub model: String,
pub answers: BTreeMap<String, Answer>,
pub usage: Usage,
pub request_id: Option<String>,
pub body: Value,
}Expand description
The result of a System One call.
answers: one answer per question, under the id the question usedmodel: the versioned model that answered, such asjev-1.13.0, even when the call named an alias likejev-latest. Store it next to anything you keep, so a threshold can be traced to the model it was tuned on.usage: tokens usedrequest_id: thex-typesafe-request-idheader, for support requestsbody: the decoded JSON body, for fields this client doesn’t know yet
Fields§
§model: String§answers: BTreeMap<String, Answer>§usage: Usage§request_id: Option<String>§body: ValueImplementations§
Source§impl Response
impl Response
pub fn answer(&self, id: &str) -> Option<&Answer>
Sourcepub fn noul(&self, id: &str) -> Option<&NoulAnswer>
pub fn noul(&self, id: &str) -> Option<&NoulAnswer>
The answer to the Noul asked under id.
Sourcepub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
pub fn choice(&self, id: &str) -> Option<&ChoiceAnswer>
The answer to the Choice asked under id.
Sourcepub fn score(&self, id: &str) -> Option<&ScoreAnswer>
pub fn score(&self, id: &str) -> Option<&ScoreAnswer>
The answer to the Score asked under id.
Trait Implementations§
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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