CreateMessageResult extension type

The client's response to a sampling/create_message request from the server.

The client should inform the user before returning the sampled message, to allow them to inspect the response (human in the loop) and decide whether to allow the server to see it.

on
Implemented types

Constructors

CreateMessageResult({required Role role, required List<SamplingMessageContentBlock> content, required String model, String? stopReason, Meta? meta})
factory
CreateMessageResult.fromMap(Map<String, Object?> _value)

Properties

content → List<SamplingMessageContentBlock>
The content of the message.
no setterinherited
isInputRequired → bool
Whether the server asked for more input before it can answer, which makes this an InputRequiredResult.
no setterinherited
meta → Meta?
The _meta property/parameter is reserved by MCP to allow clients and servers to attach additional metadata to their interactions.
no setterinherited
model → String
The name of the model that generated the message.
no setter
resultType → String
The type of this result, which determines how to parse it.
no setterinherited
role → Role
The role of the message.
no setterinherited
stopReason → String?
The reason why sampling stopped, if known.
no setter

Methods

toJson() → Map<String, Object?>
The JSON representation of this object.