pub enum ModelResponsePart {
Text {
text: String,
},
ProviderText {
text: String,
provider: ProviderPartInfo,
},
Thinking {
text: String,
signature: Option<String>,
},
ProviderThinking {
text: String,
signature: Option<String>,
provider: ProviderPartInfo,
},
ToolCall(ToolCallPart),
ProviderToolCall {
call: ToolCallPart,
provider: ProviderPartInfo,
},
NativeToolCall {
tool_type: String,
payload: Value,
},
NativeToolReturn {
tool_type: String,
payload: Value,
},
File {
url: String,
media_type: String,
},
Compaction {
summary: String,
},
ProviderOpaque {
item_type: String,
payload: Value,
provider: ProviderPartInfo,
},
}Expand description
Response part returned by a model.
Variants§
Text
Plain text output.
ProviderText
Plain text output with provider-private replay metadata.
Thinking
Reasoning or thinking output.
ProviderThinking
Reasoning or thinking output with provider-private replay metadata.
Fields
provider: ProviderPartInfoProvider replay metadata.
ToolCall(ToolCallPart)
Provider-neutral tool call.
ProviderToolCall
Provider-neutral tool call with provider-private replay metadata.
Fields
call: ToolCallPartTool call visible to runtime tool execution.
provider: ProviderPartInfoProvider replay metadata, including output item ID and namespaces.
NativeToolCall
Provider-native tool call payload.
NativeToolReturn
Provider-native tool return payload.
File
File returned by the model.
Compaction
Compaction summary.
ProviderOpaque
Opaque provider output item kept for same-provider replay.
Implementations§
Source§impl ModelResponsePart
impl ModelResponsePart
Sourcepub fn thinking(&self) -> Option<(&str, Option<&str>)>
pub fn thinking(&self) -> Option<(&str, Option<&str>)>
Return thinking text and signature for reasoning-like parts.
Sourcepub const fn tool_call(&self) -> Option<&ToolCallPart>
pub const fn tool_call(&self) -> Option<&ToolCallPart>
Return a function-style tool call when present.
Sourcepub const fn provider_part(&self) -> Option<&ProviderPartInfo>
pub const fn provider_part(&self) -> Option<&ProviderPartInfo>
Return provider replay metadata when present.
Sourcepub fn is_compaction(&self) -> bool
pub fn is_compaction(&self) -> bool
Return true when this response part is a compaction boundary.
Trait Implementations§
Source§impl Clone for ModelResponsePart
impl Clone for ModelResponsePart
Source§fn clone(&self) -> ModelResponsePart
fn clone(&self) -> ModelResponsePart
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more