pub struct ContentPart {
pub text: Option<String>,
pub function_call: Option<FunctionCall>,
pub function_response: Option<FunctionResponse>,
pub thought: Option<bool>,
pub thought_signature: Option<String>,
}Expand description
Represents a content part that may include thought signatures.
Fields§
§text: Option<String>The text content of the part.
function_call: Option<FunctionCall>Function call information if this part contains a function call.
function_response: Option<FunctionResponse>Function response information if this part contains a function response.
thought: Option<bool>Indicates if this part contains thought content.
thought_signature: Option<String>Encrypted thought signature for preserving reasoning context across turns.
Implementations§
Source§impl ContentPart
impl ContentPart
Sourcepub fn function_call(name: impl Into<String>, args: Value) -> Self
pub fn function_call(name: impl Into<String>, args: Value) -> Self
Creates a new function call content part.
Sourcepub fn function_response(name: impl Into<String>, response: Value) -> Self
pub fn function_response(name: impl Into<String>, response: Value) -> Self
Creates a new function response content part.
Sourcepub fn with_thought_signature(self, signature: impl Into<String>) -> Self
pub fn with_thought_signature(self, signature: impl Into<String>) -> Self
Adds a thought signature to this content part.
Sourcepub fn as_thought(self) -> Self
pub fn as_thought(self) -> Self
Marks this content part as containing thought content.
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 · 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 PartialEq for ContentPart
impl PartialEq for ContentPart
Source§impl Serialize for ContentPart
impl Serialize 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