Table of Contents

TTMSMCPSamplingResult.FromJSON Method

Creates a reply from the payload the client sent back.

API unit family: TMS.MCP.Sampling Declaring type: TTMSMCPSamplingResult

Syntax

class function FromJSON(const AJson: TJSONObject): TTMSMCPSamplingResult; static;

Parameters

Name Description
AJson Reply payload to read the model, stop reason, speaker and content from.

Returns

A new reply owned by the caller. A stop reason that is not one of the standard names is stored as ssrCustom with the original wording kept in TTMSMCPSamplingResult.CustomStopReason, and the speaker falls back to the assistant when the payload does not name one. Tool arguments are copied rather than referenced, so the payload can be released independently.