pub struct CompletionResponse {
pub choice: ModelChoice,
pub reasoning: Option<String>,
pub usage: Option<Usage>,
}Expand description
The full response returned by a CompletionModel.
Fields§
§choice: ModelChoiceWhat the model decided to do this turn.
This is always the model’s final answer — a chain-of-thought /
“thinking” trace, if the provider returns one, never ends up here.
See reasoning instead.
reasoning: Option<String>The model’s raw reasoning / chain-of-thought trace, if the provider
exposes one for this request (e.g. Anthropic extended thinking,
Gemini “thinking” parts, DeepSeek’s reasoning_content) and the
model actually produced one this turn.
Most callers can ignore this field entirely — choice is always the
straight answer. It’s here for callers who specifically want to show
or log the reasoning trace alongside the answer.
usage: Option<Usage>Token usage, if the provider reported it.
Trait Implementations§
Source§impl Clone for CompletionResponse
impl Clone for CompletionResponse
Source§fn clone(&self) -> CompletionResponse
fn clone(&self) -> CompletionResponse
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 moreAuto Trait Implementations§
impl Freeze for CompletionResponse
impl RefUnwindSafe for CompletionResponse
impl Send for CompletionResponse
impl Sync for CompletionResponse
impl Unpin for CompletionResponse
impl UnsafeUnpin for CompletionResponse
impl UnwindSafe for CompletionResponse
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