Part
class Part(val text: String? = null, val inlineData: Blob? = null, val fileData: FileData? = null, val functionCall: FunctionCall? = null, val functionResponse: FunctionResponse? = null, val thought: Boolean? = null, val thoughtSignature: ByteArray? = null, val videoMetadata: VideoMetadata? = null, val toolCall: ToolCall? = null, val toolResponse: ToolResponse? = null, val partMetadata: Map<String, Any?>? = null)
A part of a multi-modal prompt or response.
A Part can contain one of the following:
text: Plain text.
inlineData: Binary data (e.g., image, audio).
fileData: Data from a file.
functionCall: A call to a function.
functionResponse: The response from a function call.
toolCall: A tool call the model ran on its own server side.
toolResponse: The output of a server-side tool call.
Constructors
Link copied to clipboard
constructor(text: String? = null, inlineData: Blob? = null, fileData: FileData? = null, functionCall: FunctionCall? = null, functionResponse: FunctionResponse? = null, thought: Boolean? = null, thoughtSignature: ByteArray? = null, videoMetadata: VideoMetadata? = null, toolCall: ToolCall? = null, toolResponse: ToolResponse? = null, partMetadata: Map<String, Any?>? = null)
Types
Properties
Link copied to clipboard
A call to a function.
Link copied to clipboard
The response from a function call.
Link copied to clipboard
Binary data (e.g., image, audio).
Link copied to clipboard
Arbitrary key-value metadata associated with this part. The map must be JSON serializable.
Link copied to clipboard
An opaque signature for the thought.
Link copied to clipboard
The output of a server-side tool call, to be echoed back alongside its ToolCall.
Link copied to clipboard
Metadata for a video part (segment offsets and frame rate).
Functions
Link copied to clipboard
fun copy(text: String? = this.text, inlineData: Blob? = this.inlineData, fileData: FileData? = this.fileData, functionCall: FunctionCall? = this.functionCall, functionResponse: FunctionResponse? = this.functionResponse, thought: Boolean? = this.thought, thoughtSignature: ByteArray? = this.thoughtSignature, videoMetadata: VideoMetadata? = this.videoMetadata, toolCall: ToolCall? = this.toolCall, toolResponse: ToolResponse? = this.toolResponse, partMetadata: Map<String, Any?>? = this.partMetadata): Part