Embedded resource content block.
Represents embedded resource contents in a prompt or message. The resource can be either text or binary data.
Required Fields
type- Always "resource" for this variantresource- Embedded resource contents (map with text or blob data)
Optional Fields
annotations- Additional annotations (map)meta- Additional metadata (map)
Resource Structure
The resource field should contain either:
Text Resource
%{
"uri" => "file:///path/to/file.txt",
"text" => "file contents...",
"mimeType" => "text/plain"
}Blob Resource
%{
"uri" => "file:///path/to/file.bin",
"blob" => "base64-encoded-data...",
"mimeType" => "application/octet-stream"
}Example
%ACPex.Schema.Types.ContentBlock.Resource{
type: "resource",
resource: %{
"uri" => "file:///home/user/config.json",
"text" => "{\"setting\": \"value\"}",
"mimeType" => "application/json"
}
}JSON Representation
{
"type": "resource",
"resource": {
"uri": "file:///home/user/config.json",
"text": "{\"setting\": \"value\"}",
"mimeType": "application/json"
}
}
Summary
Functions
Creates a changeset for validation.
Types
Functions
@spec changeset(t(), map()) :: Ecto.Changeset.t()
Creates a changeset for validation.
Required Fields
resource- Must be present and contain either text or blob data
The type field defaults to "resource".