Table of Contents

TTMSMCPSamplingRequestBuilder Class

Assembles a completion request through chained calls, each of which returns the builder so that a whole request can be written as one expression.

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

Syntax

TTMSMCPSamplingRequestBuilder = class(TPersistent)

Remarks

Take the finished request with TTMSMCPSamplingRequestBuilder.Build, which hands ownership of it to the caller; the builder itself must still be released afterwards. A builder that is released before the request has been taken releases the request with it.

Methods

Name Description
AddAssistantMessage Appends a text turn attributed to the assistant, to replay an earlier model reply as part of the history.
AddImageMessage Appends an image turn attributed to the user.
AddStopSequence Adds a text that ends generation as soon as the model produces it.
AddUserMessage Appends a text turn attributed to the user.
Build Returns the assembled request and hands ownership of it to the caller.
WithCostPriority Sets how much weight the client should give to keeping the cost low.
WithIncludeContext Sets how much of the surrounding session the client should attach.
WithIntelligencePriority Sets how much weight the client should give to the capability of the model.
WithMaxTokens Sets the upper limit on the number of tokens the model may generate.
WithModelHint Adds a model name the client should prefer.
WithSpeedPriority Sets how much weight the client should give to answering quickly.
WithSystemPrompt Sets the instructions that steer the model.
WithTemperature Sets the sampling temperature.