Image
class Image 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 $data, string $mimeType = 'image/png')
Create image content from raw bytes.
array
string
__toString()
Get the raw image bytes.
array
toArray()
Convert the image 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 $data, string $mimeType = 'image/png')
Create image content from raw bytes.
at line 29
array
toTool(Tool $tool)
Format the image for a tool response.
at line 39
array
toPrompt(Prompt $prompt)
Format the image for a prompt response.
at line 49
array
toResource(Resource $resource)
Format the image for a resource response.
at line 61
string
__toString()
Get the raw image bytes.
at line 71
array
toArray()
Convert the image content to an array.