ToolContent class abstract base

One piece of what a tool answers: words, a picture, a sound, a resource or a link to one, as the protocol's content objects say them.

An abstract base class, not sealed. The protocol adds kinds of content in its own releases; a sealed type would make each of them a break for every exhaustive switch here and in a host. A kind this build has no class for arrives as ToolOtherContent, with its JSON as it came, so a result read and written again keeps it rather than turning it into empty words.

Implementers

Constructors

ToolContent()
const
ToolContent.fromJson(Map<String, Object?> json)
Reads one of the protocol's content objects: text, image, audio, resource and resource_link by their own classes, anything else as ToolOtherContent.
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, Object?>
The protocol's content object.
toString() → String
A string representation of this object.
inherited

Operators

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