TextPart class final
Human- or model-authored prose, typically rendered as Markdown.
Constructors
- TextPart(String text)
-
Creates a text part holding
text.const - TextPart.buffered(StringBuffer buffer)
-
Creates a text part whose content is accumulated in
buffer, materialized to a String lazily on first read of text. -
TextPart.fromJson(Map<
String, Object?> json) -
Reconstructs a TextPart from
json.factory
Properties
- buffer → StringBuffer?
-
The live accumulation buffer backing this part, or
nullfor an ordinary part. Internal to the streaming reducer, which appends the next delta in place rather than rebuilding the string.no setter - hashCode → int
-
The hash code for this object.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- text → String
-
The textual content.
no setter
Methods
-
copyWith(
{String? text}) → TextPart -
Returns a copy with
textreplaced. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> -
Serializes this part, including its
typediscriminator.override -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override