CreateMessageRequestParams class

Parameters for a sampling/createMessage request.

Inheritance
Annotations
  • @Deprecated('Deprecated as of protocol version 2026-07-28 (SEP-2577). ' 'Remains in the specification for at least twelve months.')

Constructors

CreateMessageRequestParams({required List<SamplingMessage> messages, ModelPreferences? modelPreferences, String? systemPrompt, String? includeContext, num? temperature, required int maxTokens, List<String>? stopSequences, Map<String, Object?>? metadata, List<Tool>? tools, ToolChoice? toolChoice})
Creates a CreateMessageRequestParams.
CreateMessageRequestParams.toMCP(Map<String, Object?> map)
Builds a CreateMessageRequestParams from a decoded MCP JSON map.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
includeContext String?
A request to include context from one or more MCP servers (including the caller), to be attached to the prompt.
getter/setter pair
maxTokens int
The requested maximum number of tokens to sample (to prevent runaway completions).
getter/setter pair
messages List<SamplingMessage>
getter/setter pair
metadata Map<String, Object?>?
Optional metadata to pass through to the LLM provider.
getter/setter pair
modelPreferences ModelPreferences?
The server's preferences for which model to select.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stopSequences List<String>?
getter/setter pair
systemPrompt String?
An optional system prompt the server wants to use for sampling.
getter/setter pair
temperature num?
getter/setter pair
toolChoice ToolChoice?
Controls how the model uses tools.
getter/setter pair
tools List<Tool>?
Tools that the model may use during generation.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toMap() Map<String, Object?>
Converts this CreateMessageRequestParams into a JSON-compatible map.
override
toString() String
A string representation of this object.
inherited

Operators

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