Skip to content

Add SEP-1577 sampling with tools support#1018

Open
chemicL wants to merge 1 commit into
mainfrom
sep-1577-sampling-with-tools
Open

Add SEP-1577 sampling with tools support#1018
chemicL wants to merge 1 commit into
mainfrom
sep-1577-sampling-with-tools

Conversation

@chemicL

@chemicL chemicL commented Jun 10, 2026

Copy link
Copy Markdown
Member

Introduces parallel V2 sampling types (SamplingMessageV2, CreateMessageWithToolsRequest/Result, ToolUseContent, ToolResultContent, ToolChoice) alongside the existing V1 types, leaving the legacy wire format byte-identical. Servers call createMessageWithTools on the exchange; a version gate refuses multi-content or tools payloads when the negotiated protocol version is older than 2025-11-25. Clients opt in via samplingWithTools(handler) on the builder, which advertises sampling.tools in the capability handshake. StopReason gains TOOL_USE.

Introduces parallel V2 sampling types (SamplingMessageV2,
CreateMessageWithToolsRequest/Result, ToolUseContent, ToolResultContent,
ToolChoice) alongside the existing V1 types, leaving the legacy wire format
byte-identical. Servers call createMessageWithTools on the exchange; a version
gate refuses multi-content or tools payloads when the negotiated protocol
version is older than 2025-11-25. Clients opt in via samplingWithTools(handler)
on the builder, which advertises sampling.tools in the capability handshake.
StopReason gains TOOL_USE.

Signed-off-by: Dariusz Jędrzejczyk <2554306+chemicL@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant