pub struct ChatResponse {
pub id: String,
pub model: String,
pub role: String,
pub object_type: String,
pub text: String,
pub stop_reason: String,
pub usage: Usage,
pub tool_calls: Vec<String>,
}Fields§
§id: String§model: String§role: String§object_type: String§text: String§stop_reason: String§usage: Usage§tool_calls: Vec<String>Implementations§
Source§impl ChatResponse
impl ChatResponse
pub fn parse(proto: Protocol, v: &Value) -> Self
Sourcepub fn stop_reason_is_known(&self, proto: Protocol) -> bool
pub fn stop_reason_is_known(&self, proto: Protocol) -> bool
Canonical stop reasons for the protocol, normalised across both.
Sourcepub fn stopped_at_limit(&self, proto: Protocol) -> bool
pub fn stopped_at_limit(&self, proto: Protocol) -> bool
True when the response signals “output was cut at the token ceiling”.
Sourcepub fn stopped_at_sequence(&self, proto: Protocol) -> bool
pub fn stopped_at_sequence(&self, proto: Protocol) -> bool
True when the response signals “a stop sequence terminated the output”.
pub fn id_prefix_ok(&self, proto: Protocol) -> bool
Trait Implementations§
Source§impl Clone for ChatResponse
impl Clone for ChatResponse
Source§fn clone(&self) -> ChatResponse
fn clone(&self) -> ChatResponse
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 ChatResponse
impl Debug for ChatResponse
Source§impl Default for ChatResponse
impl Default for ChatResponse
Source§fn default() -> ChatResponse
fn default() -> ChatResponse
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChatResponse
impl RefUnwindSafe for ChatResponse
impl Send for ChatResponse
impl Sync for ChatResponse
impl Unpin for ChatResponse
impl UnsafeUnpin for ChatResponse
impl UnwindSafe for ChatResponse
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