Repository navigation
Expand file tree
/
Copy pathModelHint.php
More file actions
53 lines (48 loc) · 1.58 KB
/
Copy pathModelHint.php
File metadata and controls
53 lines (48 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mcp\Schema;
/**
* Hints to use for model selection.
*
* Keys not declared here are currently left unspecified by the spec and are up to the client to interpret.
*
* @author Kyrian Obikwelu <koshnawaza@gmail.com>
*
* @deprecated since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28.
* Integrate with an LLM provider's API directly instead.
*/
class ModelHint implements \JsonSerializable
{
/**
* @param string|null $name A hint for a model name.
*
* The client SHOULD treat this as a substring of a model name; for example:
* - `claude-3-5-sonnet` should match `claude-3-5-sonnet-20241022`
* - `sonnet` should match `claude-3-5-sonnet-20241022`, `claude-3-sonnet-20240229`, etc.
* - `claude` should match any Claude model
*
* The client MAY also map the string to a different provider's model name or a different model family, as long as it fills a similar niche; for example:
* - `gemini-1.5-flash` could match `claude-3-haiku-20240307`
*/
public function __construct(
public readonly ?string $name = null,
) {
}
/**
* @return array{name: string}|array{}
*/
public function jsonSerialize(): array
{
if (null === $this->name) {
return [];
}
return ['name' => $this->name];
}
}