Table of Contents

TTMSMCPSamplingMessageContent Class

Payload of one conversation turn: text, an image, an audio fragment, a request to invoke a tool, or the outcome of such an invocation.

API unit family: TMS.MCP.Sampling Inherits from: TPersistent

Syntax

TTMSMCPSamplingMessageContent = class(TPersistent)

Remarks

Only the members that belong to TTMSMCPSamplingMessageContent.ContentType are serialized; the others are ignored. Prefer the class functions below, which return an instance whose kind and members are already consistent.

Properties

Name Description
AudioData Audio bytes, base64-encoded. Used when TTMSMCPSamplingMessageContent.ContentType is smctAudio.
AudioMimeType Media type of the audio, for example 'audio/wav'.
ContentType Kind of payload this content carries, which selects the members that are serialized. Defaults to smctText.
ImageData Image bytes, base64-encoded. Used when TTMSMCPSamplingMessageContent.ContentType is smctImage.
ImageMimeType Media type of the image, for example 'image/png'.
IsError When True, the tool outcome is reported to the model as a failure; when False, as a normal result.
Text Text of the turn. Used when TTMSMCPSamplingMessageContent.ContentType is smctText.
ToolInput Arguments for the tool invocation. Used when TTMSMCPSamplingMessageContent.ContentType is smctToolUse.
ToolName Name of the tool the model wants to invoke. Used when TTMSMCPSamplingMessageContent.ContentType is smctToolUse.
ToolResultContent Items making up the outcome of a tool invocation. Used when TTMSMCPSamplingMessageContent.ContentType is smctToolResult.
ToolUseId Identifier of a tool invocation.

Methods

Name Description
CreateAudio Creates audio content.
CreateImage Creates image content.
CreateText Creates text content.
CreateToolResult Creates content carrying the outcome of a tool invocation.
CreateToolUse Creates content describing a tool the model wants to invoke.
ToJSON Builds the payload representation for the current payload kind.