pub enum ContentPart {
Text {
text: String,
},
Reasoning {
text: String,
},
FileData {
file_uri: String,
mime_type: Option<String>,
},
InlineData {
mime_type: String,
data: ByteBufB64,
},
ToolCall {
name: String,
args: Json,
call_id: Option<String>,
},
ToolOutput {
name: String,
output: Json,
call_id: Option<String>,
remote_id: Option<Principal>,
},
Action {
name: String,
payload: Json,
recipients: Option<Vec<Principal>>,
signature: Option<ByteBufB64>,
},
Any(Json),
}Expand description
A single content item inside a chat message.
The enum supports Anda’s normalized content types while preserving unknown
provider-specific JSON payloads in ContentPart::Any.
Variants§
Trait 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
Source§impl From<Resource> for ContentPart
impl From<Resource> for ContentPart
Source§impl From<String> for ContentPart
impl From<String> for ContentPart
Source§impl From<Value> for ContentPart
impl From<Value> for ContentPart
Source§impl PartialEq for ContentPart
impl PartialEq for ContentPart
Source§fn eq(&self, other: &ContentPart) -> bool
fn eq(&self, other: &ContentPart) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ContentPart
impl Serialize for ContentPart
impl Eq for ContentPart
impl StructuralPartialEq for ContentPart
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.