|
13 | 13 |
|
14 | 14 | use Mcp\Exception\InvalidArgumentException; |
15 | 15 | use Mcp\Schema\Content\SamplingMessage; |
| 16 | +use Mcp\Schema\Enum\SamplingContext; |
16 | 17 | use Mcp\Schema\JsonRpc\Request; |
17 | 18 | use Mcp\Schema\ModelPreferences; |
18 | 19 |
|
|
25 | 26 | */ |
26 | 27 | final class CreateSamplingMessageRequest extends Request |
27 | 28 | { |
| 29 | + protected string|int $id = 'create_sampling_message'; |
| 30 | + |
28 | 31 | /** |
29 | 32 | * @param SamplingMessage[] $messages the messages to send to the model |
30 | 33 | * @param int $maxTokens The maximum number of tokens to sample, as requested by the server. |
31 | 34 | * The client MAY choose to sample fewer tokens than requested. |
32 | | - * @param ModelPreferences|null $preferences The server's preferences for which model to select. The client MAY |
| 35 | + * @param ?ModelPreferences $preferences The server's preferences for which model to select. The client MAY |
33 | 36 | * ignore these preferences. |
34 | | - * @param string|null $systemPrompt An optional system prompt the server wants to use for sampling. The |
| 37 | + * @param ?string $systemPrompt An optional system prompt the server wants to use for sampling. The |
35 | 38 | * client MAY modify or omit this prompt. |
36 | | - * @param string|null $includeContext A request to include context from one or more MCP servers (including |
| 39 | + * @param ?SamplingContext $includeContext A request to include context from one or more MCP servers (including |
37 | 40 | * the caller), to be attached to the prompt. The client MAY ignore this request. |
38 | | - * |
39 | | - * Allowed values: "none", "thisServer", "allServers" |
40 | | - * @param float|null $temperature The temperature to use for sampling. The client MAY ignore this request. |
41 | | - * @param string[]|null $stopSequences A list of sequences to stop sampling at. The client MAY ignore this request. |
42 | | - * @param ?array<string, mixed> $metadata Optional metadata to pass through to the LLM provider. The format of |
43 | | - * this metadata is provider-specific. |
| 41 | + * Allowed values: "none", "thisServer", "allServers" |
| 42 | + * @param ?float $temperature The temperature to use for sampling. The client MAY ignore this request. |
| 43 | + * @param ?string[] $stopSequences A list of sequences to stop sampling at. The client MAY ignore this request. |
| 44 | + * @param ?array<string, mixed> $metadata Optional metadata to pass through to the LLM provider. The format of |
| 45 | + * this metadata is provider-specific. |
44 | 46 | */ |
45 | 47 | public function __construct( |
46 | 48 | public readonly array $messages, |
47 | 49 | public readonly int $maxTokens, |
48 | 50 | public readonly ?ModelPreferences $preferences = null, |
49 | 51 | public readonly ?string $systemPrompt = null, |
50 | | - public readonly ?string $includeContext = null, |
| 52 | + public readonly ?SamplingContext $includeContext = null, |
51 | 53 | public readonly ?float $temperature = null, |
52 | 54 | public readonly ?array $stopSequences = null, |
53 | 55 | public readonly ?array $metadata = null, |
|
0 commit comments