pub enum ContentPart {
Text {
text: String,
},
Thinking {
text: String,
},
ToolCall {
content: ToolCall,
},
ToolResult {
content: ToolResult,
},
Resource {
content: Resource,
},
ResourceRef {
content: ResourceReference,
},
PromptRequest {
content: PromptRequest,
},
PromptResult {
content: PromptResult,
},
Image {
content: ImageSource,
},
Video {
content: VideoSource,
},
Audio {
content: AudioSource,
},
Document {
content: DocumentSource,
},
}Expand description
A typed content part in a CMF message.
Discriminated by the content_type field. Each variant wraps
either a text string or a domain object.
Mirrors the Python ContentPartUnion discriminated union in
cpex/framework/cmf/message.py.
Variants§
Text
Plain text content.
Thinking
Chain-of-thought reasoning.
ToolCall
Tool/function invocation request.
ToolResult
Result from tool execution.
Fields
§
content: ToolResultResource
Embedded resource with content.
ResourceRef
Lightweight resource reference.
Fields
§
content: ResourceReferencePromptRequest
Prompt template invocation request.
Fields
§
content: PromptRequestPromptResult
Rendered prompt template result.
Fields
§
content: PromptResultImage
Image content.
Fields
§
content: ImageSourceVideo
Video content.
Fields
§
content: VideoSourceAudio
Audio content.
Fields
§
content: AudioSourceDocument
Document content.
Fields
§
content: DocumentSourceTrait Implementations§
Source§impl Clone for ContentPart
impl Clone for ContentPart
Source§fn clone(&self) -> ContentPart
fn clone(&self) -> ContentPart
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 ContentPart
impl Debug for ContentPart
Source§impl<'de> Deserialize<'de> for ContentPart
impl<'de> Deserialize<'de> for ContentPart
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
Auto Trait Implementations§
impl Freeze for ContentPart
impl RefUnwindSafe for ContentPart
impl Send for ContentPart
impl Sync for ContentPart
impl Unpin for ContentPart
impl UnsafeUnpin for ContentPart
impl UnwindSafe for ContentPart
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