final | |
|---|---|
readonly | |
extends |
JsonRpcRequest<array{jsonrpc: '2.0', id: (int|non-empty-string), method: 'sampling/createMessage', params: array{_meta?: array<string, mixed>, messages: list<template-type<SamplingMessage, Arrayable, 'T'>>, maxTokens: int<0, max>, modelPreferences?: template-type<ModelPreferences, Arrayable, 'T'>, systemPrompt?: non-empty-string, includeContext?: ('allServers'|'none'|'thisServer'), temperature?: float, stopSequences?: list<non-empty-string>, metadata?: array<string, mixed>}}> |
implements |
ServerRequest |
A request from the server to sample an LLM via the client. The client has full discretion over which model to select. The client should also inform the user before beginning sampling, to allow them to inspect the request (human in the loop) and decide whether to approve it.
| Methods | ||
|---|---|---|
public
|
__construct(
RequestId $id,
list<SamplingMessage> $messages,
int<0, max> $maxTokens,
null|ModelPreferences $modelPreferences = null,
null|non-empty-string $systemPrompt = null,
null|'allServers'|'none'|'thisServer' $includeContext = null,
null|float $temperature = null,
null|list<non-empty-string> $stopSequences = null,
null|array<string, mixed> $metadata = null,
null|array<string, mixed> $meta = null,
)
|
# |
| Methods inherited from Nexus\Mcp\Schema\Message\JsonRpcRequest |
|---|
toArray() |
| Methods inherited from Nexus\Mcp\Schema\Request\Request |
|---|
jsonSerialize() |
| Methods inherited from Nexus\Mcp\Schema\Message\Message |
|---|
validateJsonRpc() |
| Constants inherited from Nexus\Mcp\Schema\Message\JsonRpcMessage |
|---|
|
| Properties inherited from Nexus\Mcp\Schema\Message\JsonRpcRequest |
|---|
$jsonrpc, $id |
| Properties inherited from Nexus\Mcp\Schema\Request\Request |
|---|
$method, $params |