Table of Contents

TTMSMCPSamplingRequest Class

Request with which a server asks the connected client to run a model completion on its behalf and to return the generated reply.

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

Syntax

TTMSMCPSamplingRequest = class(TPersistent)

Remarks

The client owns the model connection, so the server never contacts a model itself: it supplies the conversation and the sampling settings, and the client decides which model runs and whether to run it at all. The reply comes back as a TTMSMCPSamplingResult. This runs in the opposite direction from an elicitation request, which asks the client application and the person using it for input rather than for a model completion. Use TTMSMCPSamplingRequest.CreateBuilder for a compact way to assemble a request.

Properties

Name Description
IncludeContext How much of the surrounding session the client should attach to the request. Defaults to scitNone.
MaxTokens Upper limit on the number of tokens the model may generate for the reply.
Messages Conversation sent to the model, in the order it should be read.
Metadata Additional provider-specific settings, passed through to the client unchanged.
ModelPreferences Guidance on which model the client should pick for this request.
StopSequences Texts that end generation as soon as the model produces one of them, one sequence per line.
SystemPrompt Instructions that steer the model, sent alongside the conversation rather than as one of its turns.
Temperature Sampling temperature, from 0 for the most predictable output to 1 for the most varied.
ToolChoice Constraint on how the model may use the offered tools, such as leaving the choice open or requiring one particular tool.
Tools Definitions of the tools the model may invoke while it generates the reply.

Methods

Name Description
CreateBuilder Creates a builder that assembles a request through chained calls.
ToJSON Builds the payload of the completion request.

Used by