Sycophant.Message.Content.Image (sycophant v0.4.2)

Copy Markdown

Image content part for multimodal messages.

Provide either a :url for remote images or :data with base64-encoded content. When using :data, set :media_type to indicate the format (e.g. "image/png", "image/jpeg").

Examples

# URL-based image
%Sycophant.Message.Content.Image{url: "https://example.com/photo.jpg"}

# Base64-encoded image
%Sycophant.Message.Content.Image{
  data: "iVBORw0KGgo...",
  media_type: "image/png"
}

Summary

Functions

Deserializes an image content part from a plain map.

Types

t()

@type t() :: %Sycophant.Message.Content.Image{
  data: String.t() | nil,
  media_type: String.t() | nil,
  url: String.t() | nil
}

Functions

from_map(data)

@spec from_map(map()) :: t()

Deserializes an image content part from a plain map.