pub struct ModelResponse {
pub content: String,
pub model: String,
pub finish_reason: String,
pub input_tokens: u64,
pub output_tokens: u64,
pub structured: Option<Value>,
}Expand description
A response from a chat model.
Fields§
§content: StringThe generated text content.
model: StringThe model that actually served the request (may differ from requested).
finish_reason: StringFinish reason: “stop”, “length”, “tool_calls”, “content_filter”.
input_tokens: u64Input tokens consumed.
output_tokens: u64Output tokens generated.
structured: Option<Value>Structured output parsed from JSON (for structured_output() calls).
Trait Implementations§
Source§impl Clone for ModelResponse
impl Clone for ModelResponse
Source§fn clone(&self) -> ModelResponse
fn clone(&self) -> ModelResponse
Returns a duplicate of the value. Read more
1.0.0 · 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 ModelResponse
impl RefUnwindSafe for ModelResponse
impl Send for ModelResponse
impl Sync for ModelResponse
impl Unpin for ModelResponse
impl UnsafeUnpin for ModelResponse
impl UnwindSafe for ModelResponse
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