Cairnloop.Notifier behaviour (cairnloop v0.1.0)

Copy Markdown View Source

Behaviour for notifying the host application of important Cairnloop events.

Summary

Callbacks

Called when a conversation is resolved. Metadata may contain :sentiment, :intent, etc.

Called when a service level agreement (SLA) is breached.

Callbacks

on_conversation_resolved(conversation, metadata)

@callback on_conversation_resolved(conversation :: struct(), metadata :: map()) ::
  :ok | any()

Called when a conversation is resolved. Metadata may contain :sentiment, :intent, etc.

on_sla_breach(conversation, sla, metadata)

@callback on_sla_breach(conversation :: struct(), sla :: struct(), metadata :: map()) ::
  :ok | {:error, term()} | any()

Called when a service level agreement (SLA) is breached.