Text
class Text 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 $text)
Create text content.
array
string
__toString()
Get the text content.
array
toArray()
Convert the text content 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 20
__construct(string $text)
Create text content.
at line 29
array
toTool(Tool $tool)
Format the text for a tool response.
at line 39
array
toPrompt(Prompt $prompt)
Format the text for a prompt response.
at line 49
array
toResource(Resource $resource)
Format the text for a resource response.
at line 61
string
__toString()
Get the text content.
at line 71
array
toArray()
Convert the text content to an array.