class Notification 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 $method, array $params)

Create notification content.

array
toTool(Tool $tool)

Reject a notification used as tool result content.

array
toPrompt(Prompt $prompt)

Reject a notification used as prompt result content.

array
toResource(Resource $resource)

Reject a notification used as resource result content.

string
__toString()

Get the notification method.

array
toArray()

Convert the notification 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 24
__construct(string $method, array $params)

Create notification content.

Parameters

string $method
array $params

at line 33
array toTool(Tool $tool)

Reject a notification used as tool result content.

Parameters

Tool $tool

Return Value

array

at line 44
array toPrompt(Prompt $prompt)

Reject a notification used as prompt result content.

Parameters

Prompt $prompt

Return Value

array

at line 55
array toResource(Resource $resource)

Reject a notification used as resource result content.

Parameters

Resource $resource

Return Value

array

at line 64
string __toString()

Get the notification method.

Return Value

string

at line 74
array toArray()

Convert the notification to an array.

Return Value

array