final | |
|---|---|
readonly | |
implements |
Arrayable<array{resource: template-type<ResourceContents, Arrayable, 'T'>, type: 'resource', annotations?: template-type<Annotations, Arrayable, 'T'>, _meta?: template-type<MetaObject, Arrayable, 'T'>}>, ContentBlock |
The contents of a resource, embedded into a prompt or tool call result. It is up to the client how best to render embedded resources for the benefit of the LLM and/or the user.
| Methods | ||
|---|---|---|
public
|
__construct(
BlobResourceContents|TextResourceContents $resource,
Annotations $annotations = new Annotations(),
MetaObject $meta = new MetaObject(),
)
|
# |
public
static
|
fromArray(array<string, mixed> $data): static
|
# |
public
|
toArray(): array
|
# |
public
|
jsonSerialize(): array
|
# |
| Constants | |||
|---|---|---|---|
public
|
string |
TYPE = 'resource'
|
# |
| Properties | |||
|---|---|---|---|
public
|
BlobResourceContents|TextResourceContents
|
$resource
|
# |
public
|
Annotations
|
$annotations
|
# |
public
|
MetaObject
|
$meta
|
# |