pub enum Content {
Text(TextPart),
Reasoning(ReasoningPart),
Custom {
kind: String,
provider_options: Option<ProviderOptions>,
},
ReasoningFile {
data: FileData,
media_type: String,
provider_options: Option<ProviderOptions>,
},
File(FilePart),
ToolApprovalRequest(ToolApprovalRequest),
Source(Source),
ToolCall(ToolCallPart),
ToolResult(ToolResult),
}Expand description
One generated content unit.
Discriminated by type on the wire; identical tags to ai-sdk.
Variants§
Text(TextPart)
Plain text.
Reasoning(ReasoningPart)
Reasoning trace.
Custom
Provider-specific opaque content.
Fields
§
provider_options: Option<ProviderOptions>Provider-specific options.
ReasoningFile
File generated as part of a reasoning trace.
Fields
§
provider_options: Option<ProviderOptions>Provider-specific options.
File(FilePart)
File generated by the model.
ToolApprovalRequest(ToolApprovalRequest)
Tool the provider wants to execute, pending user approval.
Source(Source)
Citation / grounding source.
ToolCall(ToolCallPart)
Tool call requested by the model.
ToolResult(ToolResult)
Tool result reported by the provider (provider-executed tools).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Content
impl<'de> Deserialize<'de> for Content
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 StructuralPartialEq for Content
Auto Trait Implementations§
impl Freeze for Content
impl RefUnwindSafe for Content
impl Send for Content
impl Sync for Content
impl Unpin for Content
impl UnsafeUnpin for Content
impl UnwindSafe for Content
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