interface Content implements Arrayable, Stringable

Methods

array
toArray()

Get the instance as an array.

array
toTool(Tool $tool)

Format the content for a tool response.

array
toPrompt(Prompt $prompt)

Format the content for a prompt response.

array
toResource(Resource $resource)

Format the content for a resource response.

void
setMeta(array|string $meta, mixed $value = null)

Set content metadata.

string
__toString()

Get the content as a string.

Details

in Arrayable at line 17
array toArray()

Get the instance as an array.

Return Value

array

at line 23
array toTool(Tool $tool)

Format the content for a tool response.

Parameters

Tool $tool

Return Value

array

at line 30
array toPrompt(Prompt $prompt)

Format the content for a prompt response.

Parameters

Prompt $prompt

Return Value

array

at line 37
array toResource(Resource $resource)

Format the content for a resource response.

Parameters

Resource $resource

Return Value

array

at line 44
void setMeta(array|string $meta, mixed $value = null)

Set content metadata.

Parameters

array|string $meta
mixed $value

Return Value

void

at line 49
string __toString()

Get the content as a string.

Return Value

string