ResourceLink
class ResourceLink implements Content
Traits
Properties
| protected null|array<string, mixed> | $meta | from HasMeta |
Methods
void
setMeta(array|string $meta, mixed $value = null)
Set response metadata using an array or key-value pair.
from
HasMeta
__construct(string $uri, string $name, string|null $mimeType = null, string|null $title = null, string|null $description = null, int|null $size = null, array $annotations = [], array $icons = [])
Create a resource link.
array
string
__toString()
Get the resource URI.
array
toArray()
Convert the resource link to an array.
Details
in
HasMeta at line 21
void
setMeta(array|string $meta, mixed $value = null)
Set response metadata using an array or key-value pair.
in
HasMeta at line 46
array
mergeMeta(array $baseArray)
Merge metadata into the given response array.
at line 26
__construct(string $uri, string $name, string|null $mimeType = null, string|null $title = null, string|null $description = null, int|null $size = null, array $annotations = [], array $icons = [])
Create a resource link.
at line 43
array
toTool(Tool $tool)
Format the link for a tool response.
at line 53
array
toPrompt(Prompt $prompt)
Format the link for a prompt response.
at line 63
array
toResource(Resource $resource)
Reject resource links in a resource response.
at line 74
string
__toString()
Get the resource URI.
at line 84
array
toArray()
Convert the resource link to an array.