Part class sealed

A single unit of content (text, media, function call, etc.).

Exactly one field must be set.

Implementers

Constructors

Part.base64(String data, String mimeType)
Creates an inline data part from base64-encoded data.
factory
Part.bytes(List<int> bytes, String mimeType)
Creates an inline data part from raw bytes.
factory
Part.file(String fileUri, {String? mimeType})
Creates a file reference part.
factory
Part.fromJson(Map<String, dynamic> json)
Creates a Part from JSON.
factory
Part.functionCall(String name, {Map<String, dynamic>? args})
Creates a function call part.
factory
Part.functionResponse(String name, Map<String, dynamic> response, {String? id})
Creates a function response part.
factory
Part.text(String text)
Creates a text part.
factory
Part.toolCall(ToolType toolType, {Map<String, dynamic>? args, String? id})
Creates a tool call part.
factory
Part.toolResponse(ToolType toolType, {Map<String, dynamic>? response, String? id})
Creates a tool response part.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts to JSON.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited