Jido.Messaging.Message (Jido Messaging v1.0.0)

Copy Markdown View Source

Canonical persisted runtime message model for Jido.Messaging.

Summary

Functions

Creates a message with generated ID and timestamps.

Returns the Zoi schema for Message.

Types

t()

@type t() :: %Jido.Messaging.Message{
  content: [any()],
  delivery_external_room_id: nil | nil | binary(),
  external_id: nil | nil | binary(),
  external_reply_to_id: nil | nil | binary(),
  external_thread_id: nil | nil | binary(),
  id: binary(),
  inserted_at:
    nil
    | nil
    | %DateTime{
        calendar: term(),
        day: term(),
        hour: term(),
        microsecond: term(),
        minute: term(),
        month: term(),
        second: term(),
        std_offset: term(),
        time_zone: term(),
        utc_offset: term(),
        year: term(),
        zone_abbr: term()
      },
  metadata: map(),
  reactions: map(),
  receipts: map(),
  reply_to_id: nil | nil | binary(),
  role: :user | :assistant | :system | :tool,
  room_id: binary(),
  sender_id: binary(),
  status: :sending | :sent | :delivered | :read | :failed,
  thread_id: nil | nil | binary(),
  updated_at:
    nil
    | nil
    | %DateTime{
        calendar: term(),
        day: term(),
        hour: term(),
        microsecond: term(),
        minute: term(),
        month: term(),
        second: term(),
        std_offset: term(),
        time_zone: term(),
        utc_offset: term(),
        year: term(),
        zone_abbr: term()
      }
}

Functions

new(attrs)

Creates a message with generated ID and timestamps.

schema()

Returns the Zoi schema for Message.