Jido.Chat.Media (Jido Chat v1.0.0)

Copy Markdown View Source

Normalized media entry used in Jido.Chat.Incoming.

Summary

Functions

Creates a media struct from map input.

Normalizes supported attachment inputs into a canonical media struct.

Normalizes a list of attachments into canonical media structs.

Returns the Zoi schema for Media.

Types

input()

t()

@type t() :: %Jido.Chat.Media{
  duration: nil | nil | integer(),
  filename: nil | nil | binary(),
  height: nil | nil | integer(),
  kind: :image | :audio | :video | :file,
  media_type: nil | nil | binary(),
  metadata: map(),
  size_bytes: nil | nil | integer(),
  url: nil | nil | binary(),
  width: nil | nil | integer()
}

Functions

new(media)

Creates a media struct from map input.

normalize(media)

@spec normalize(input()) :: t()

Normalizes supported attachment inputs into a canonical media struct.

normalize_many(media)

@spec normalize_many([input()]) :: [t()]

Normalizes a list of attachments into canonical media structs.

schema()

Returns the Zoi schema for Media.