pub struct ModelResponse {
pub parts: Vec<ModelResponsePart>,
pub usage: Usage,
pub model_name: Option<String>,
pub provider: Option<ProviderInfo>,
pub finish_reason: Option<FinishReason>,
pub timestamp: Option<DateTime<Utc>>,
pub run_id: Option<RunId>,
pub conversation_id: Option<ConversationId>,
pub metadata: Metadata,
}Expand description
Response item in canonical model history.
Fields§
§parts: Vec<ModelResponsePart>Response parts returned by the model.
usage: UsageToken and request usage.
model_name: Option<String>Actual provider model name where known.
provider: Option<ProviderInfo>Provider metadata.
finish_reason: Option<FinishReason>Finish reason.
timestamp: Option<DateTime<Utc>>Response timestamp.
run_id: Option<RunId>Run identifier.
conversation_id: Option<ConversationId>Conversation identifier.
metadata: MetadataApplication metadata.
Implementations§
Source§impl ModelResponse
impl ModelResponse
Sourcepub fn text_output(&self) -> String
pub fn text_output(&self) -> String
Concatenate all text response parts.
Sourcepub fn tool_calls(&self) -> Vec<ToolCallPart>
pub fn tool_calls(&self) -> Vec<ToolCallPart>
Return all provider-neutral tool calls in the response.
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 (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 ModelResponse
impl Debug for ModelResponse
Source§impl<'de> Deserialize<'de> for ModelResponse
impl<'de> Deserialize<'de> for ModelResponse
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
impl Eq for ModelResponse
Source§impl PartialEq for ModelResponse
impl PartialEq for ModelResponse
Source§impl Serialize for ModelResponse
impl Serialize for ModelResponse
impl StructuralPartialEq for ModelResponse
Auto 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