MessageBuilder class
Message builder for creating messages with provider-specific extensions
Provider-Specific Content: Providers can add specialized content blocks through their extensions. These blocks are stored alongside universal text blocks and processed by each provider according to their specific requirements.
API Conversion:
- Universal content blocks are processed by all providers
- Provider-specific content blocks are processed only by their respective providers
- Each provider's _buildRequestBody handles mixed content appropriately
- Available extensions
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
-
addBlock(
ContentBlock block) → void -
anthropicConfig(
void configure(AnthropicMessageBuilder)) → MessageBuilder -
Available on MessageBuilder, provided by the AnthropicMessageBuilderExtension extension
Configure Anthropic-specific features -
build(
) → ChatMessage -
name(
String name) → MessageBuilder -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
text(
String text) → MessageBuilder -
tools(
List< Tool> tools) → MessageBuilder - Add tools to this message
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
assistant(
) → MessageBuilder -
system(
) → MessageBuilder -
user(
) → MessageBuilder