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
array
mergeMeta(array $baseArray)

Merge metadata into the given response array.

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
toTool(Tool $tool)

Format the link for a tool response.

array
toPrompt(Prompt $prompt)

Format the link for a prompt response.

array
toResource(Resource $resource)

Reject resource links in a resource response.

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.

Parameters

array|string $meta
mixed $value

Return Value

void

in HasMeta at line 46
array mergeMeta(array $baseArray)

Merge metadata into the given response array.

Parameters

array $baseArray

Return Value

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.

Parameters

string $uri
string $name
string|null $mimeType
string|null $title
string|null $description
int|null $size
array $annotations
array $icons

at line 43
array toTool(Tool $tool)

Format the link for a tool response.

Parameters

Tool $tool

Return Value

array

at line 53
array toPrompt(Prompt $prompt)

Format the link for a prompt response.

Parameters

Prompt $prompt

Return Value

array

at line 63
array toResource(Resource $resource)

Reject resource links in a resource response.

Parameters

Resource $resource

Return Value

array

at line 74
string __toString()

Get the resource URI.

Return Value

string

at line 84
array toArray()

Convert the resource link to an array.

Return Value

array