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
Sourcepub fn inline_data(
mime_type: impl Into<String>,
data: impl Into<String>,
) -> Self
pub fn inline_data( mime_type: impl Into<String>, data: impl Into<String>, ) -> Self
Create a new content with inline data (blob data)
Sourcepub fn function_response_multimodal(function_response: FunctionResponse) -> Self
pub fn function_response_multimodal(function_response: FunctionResponse) -> Self
Create function response content with multimodal parts.
The FunctionResponse carries its multimodal data (inline images, file references)
in its own parts field, matching the Gemini wire format where inlineData/fileData
entries are nested inside the functionResponse object.