pub struct Content {
pub parts: Vec<Part>,
pub role: Option<Role>,
}
Expand description
Content of a message
Fields§
§parts: 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_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
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