ACPex.Schema.Types.ContentBlock.Image (ACPex v0.1.1)

Copy Markdown View Source

Image content block.

Represents image data in a prompt or message.

Required Fields

  • type - Always "image" for this variant
  • data - Base64-encoded image data
  • mime_type - MIME type of the image (e.g., "image/png")

Optional Fields

  • uri - Optional URI for the image source
  • annotations - Additional annotations (map)
  • meta - Additional metadata (map)

Example

%ACPex.Schema.Types.ContentBlock.Image{
  type: "image",
  data: "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  mime_type: "image/png",
  uri: "file:///path/to/image.png"
}

JSON Representation

{
  "type": "image",
  "data": "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",
  "mimeType": "image/png",
  "uri": "file:///path/to/image.png"
}

Summary

Functions

Creates a changeset for validation.

Types

t()

@type t() :: %ACPex.Schema.Types.ContentBlock.Image{
  annotations: map() | nil,
  data: String.t(),
  meta: map() | nil,
  mime_type: String.t(),
  type: String.t(),
  uri: String.t() | nil
}

Functions

changeset(struct \\ %__MODULE__{}, params)

@spec changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset for validation.

Required Fields

  • data - Must be present
  • mime_type - Must be present

The type field defaults to "image".