Jido.Chat.Content.Video (Jido Chat v1.0.0)

Copy Markdown View Source

Video content block for messages.

Represents a video attachment.

Fields

  • url - URL to the video file (optional if data is provided)
  • data - Base64-encoded video data (optional if url is provided)
  • media_type - MIME type (e.g., "video/mp4")
  • duration - Duration in seconds (optional)
  • width - Video width in pixels (optional)
  • height - Video height in pixels (optional)
  • thumbnail_url - URL to thumbnail image (optional)

Examples

Video.new("https://example.com/clip.mp4")
Video.new("https://example.com/clip.mp4", media_type: "video/mp4", duration: 30)

Summary

Functions

Creates a new video content block from base64-encoded data.

Creates a new video content block from a URL.

Returns the Zoi schema for Video content

Types

t()

@type t() :: %Jido.Chat.Content.Video{
  data: nil | nil | binary(),
  duration: nil | nil | integer(),
  height: nil | nil | integer(),
  media_type: nil | nil | binary(),
  thumbnail_url: nil | nil | binary(),
  type: :video,
  url: nil | nil | binary(),
  width: nil | nil | integer()
}

Functions

from_base64(data, media_type, opts \\ [])

Creates a new video content block from base64-encoded data.

new(url, opts \\ [])

Creates a new video content block from a URL.

Options

  • :media_type - MIME type of the video
  • :duration - Duration in seconds
  • :width - Video width in pixels
  • :height - Video height in pixels
  • :thumbnail_url - URL to thumbnail image

schema()

Returns the Zoi schema for Video content