Jido.Messaging.Deliver (Jido Messaging v1.0.0)

Copy Markdown View Source

Outbound message delivery pipeline through Jido.Messaging.OutboundGateway.

Handles sending messages to external channels:

  1. Creates assistant message with :sending status
  2. Routes send/edit operations through the outbound gateway
  3. Updates status to :sent or :failed
  4. Returns the persisted message

Usage

case Deliver.deliver_outgoing(MyApp.Messaging, original_message, "Hello!", context) do
  {:ok, sent_message} ->
    # Message sent and persisted
  {:error, reason} ->
    # Delivery failed
end

Summary

Functions

Edit a previously-sent message through the outbound gateway.

Edit a previously-sent media message through the outbound gateway.

Send a proactive message to a room using bridge-configured routing.

Send a proactive message using control-plane routing.

Types

context()

@type context() :: Jido.Messaging.Context.t() | map()

Functions

deliver_media_outgoing(messaging_module, original_message, media_payload, context, opts \\ [])

@spec deliver_media_outgoing(
  module(),
  Jido.Messaging.Message.t(),
  map(),
  context(),
  keyword()
) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Deliver an outgoing media payload as a reply.

deliver_outgoing(messaging_module, original_message, text, context, opts \\ [])

@spec deliver_outgoing(
  module(),
  Jido.Messaging.Message.t(),
  String.t(),
  context(),
  keyword()
) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Deliver an outgoing message as a reply.

Creates an assistant message, sends it via the channel, and updates the message status.

edit_outgoing(messaging_module, message, text, context, opts \\ [])

@spec edit_outgoing(
  module(),
  Jido.Messaging.Message.t(),
  String.t(),
  context() | map(),
  keyword()
) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Edit a previously-sent message through the outbound gateway.

edit_outgoing_media(messaging_module, message, media_payload, context, opts \\ [])

@spec edit_outgoing_media(
  module(),
  Jido.Messaging.Message.t(),
  map(),
  context() | map(),
  keyword()
) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Edit a previously-sent media message through the outbound gateway.

send_to_room(messaging_module, room_id, text, opts \\ [])

@spec send_to_room(module(), String.t(), String.t(), keyword()) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Send a proactive message to a room using bridge-configured routing.

send_to_room_via_routes(messaging_module, room_id, text, opts \\ [])

@spec send_to_room_via_routes(module(), String.t(), String.t(), keyword()) ::
  {:ok, Jido.Messaging.Message.t()} | {:error, term()}

Send a proactive message using control-plane routing.

This path resolves routes via RoomBinding + BridgeConfig + RoutingPolicy and dispatches through Jido.Messaging.OutboundRouter.