pub enum Part {
Thinking {
thinking: String,
signature: Option<String>,
},
Text {
text: String,
},
InlineData {
mime_type: String,
data: Vec<u8>,
},
FileData {
mime_type: String,
file_uri: String,
},
FunctionCall {
name: String,
args: Value,
id: Option<String>,
thought_signature: Option<String>,
},
FunctionResponse {
function_response: FunctionResponseData,
id: Option<String>,
},
ServerToolCall {
server_tool_call: Value,
},
ServerToolResponse {
server_tool_response: Value,
},
}Expand description
Core traits and types.
Always available regardless of feature flags. Includes:
Variants§
Thinking
Thinking/reasoning trace from a thinking-capable model.
Must be placed before Text in the enum so that #[serde(untagged)]
deserialization matches {"thinking": "..."} before falling through to Text.
Text
InlineData
FileData
File data referenced by URI (URL or cloud storage path).
This allows referencing external files without embedding the data inline. Providers that don’t support URI-based content can fetch and convert to InlineData.
§Example
use adk_core::Part;
let image_url = Part::FileData {
mime_type: "image/jpeg".to_string(),
file_uri: "https://example.com/image.jpg".to_string(),
};Fields
FunctionCall
Fields
FunctionResponse
Fields
function_response: FunctionResponseDataServerToolCall
Server-side tool call data from Gemini 3 built-in tool invocations. Stored as opaque JSON to avoid coupling core types to provider-specific schemas.
ServerToolResponse
Server-side tool response data from Gemini 3 built-in tool invocations. Stored as opaque JSON to avoid coupling core types to provider-specific schemas.
Implementations§
Source§impl Part
impl Part
Sourcepub fn text(&self) -> Option<&str>
pub fn text(&self) -> Option<&str>
Returns the text content if this is a Text part, None otherwise
Sourcepub fn is_thinking(&self) -> bool
pub fn is_thinking(&self) -> bool
Returns true if this part is a Thinking variant
Sourcepub fn thinking_text(&self) -> Option<&str>
pub fn thinking_text(&self) -> Option<&str>
Returns the thinking text content if this is a Thinking part, None otherwise
Sourcepub fn mime_type(&self) -> Option<&str>
pub fn mime_type(&self) -> Option<&str>
Returns the MIME type if this part has one (InlineData or FileData)