ClaudeCode.Content.ImageBlock (ClaudeCode v0.36.3)

View Source

Represents an image content block within a Claude message.

Image blocks contain image data either as base64-encoded content or as a URL reference. They appear in user messages (vision input) and can also appear in tool results.

Source types

  • "base64" — inline image with data and media_type
  • "url" — remote image referenced by url

Summary

Types

source()

@type source() ::
  %{type: :base64, media_type: String.t(), data: String.t()}
  | %{type: :url, url: String.t()}

t()

@type t() :: %ClaudeCode.Content.ImageBlock{source: source(), type: :image}

Functions

new(data)

@spec new(map()) :: {:ok, t()} | {:error, atom() | {:missing_fields, [atom()]}}