pub struct Content {
pub parts: Option<Vec<Part>>,
pub role: Option<Role>,
}
Expand description
Core primitive types for building requests and parsing responses Content of a message
Fields§
§parts: Option<Vec<Part>>
Parts of the content
role: Option<Role>
Role of the content
Implementations§
Source§impl Content
impl Content
Sourcepub fn function_call(function_call: FunctionCall) -> Self
pub fn function_call(function_call: FunctionCall) -> Self
Create a new content with a function call
Sourcepub fn function_call_with_thought(
function_call: FunctionCall,
thought_signature: impl Into<String>,
) -> Self
pub fn function_call_with_thought( function_call: FunctionCall, thought_signature: impl Into<String>, ) -> Self
Create a new content with a function call and thought signature
Sourcepub fn text_with_thought_signature(
text: impl Into<String>,
thought_signature: impl Into<String>,
) -> Self
pub fn text_with_thought_signature( text: impl Into<String>, thought_signature: impl Into<String>, ) -> Self
Create a new text content with thought signature
Sourcepub fn thought_with_signature(
text: impl Into<String>,
thought_signature: impl Into<String>,
) -> Self
pub fn thought_with_signature( text: impl Into<String>, thought_signature: impl Into<String>, ) -> Self
Create a new thought content with thought signature
Sourcepub fn function_response(function_response: FunctionResponse) -> Self
pub fn function_response(function_response: FunctionResponse) -> Self
Create a new content with a function response
Sourcepub fn function_response_json(name: impl Into<String>, response: Value) -> Self
pub fn function_response_json(name: impl Into<String>, response: Value) -> Self
Create a new content with a function response from name and JSON value
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 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