Synaptic.Voice.TurnRouter (synaptic v0.3.0-alpha.12)

View Source

Normalizes application-owned routing decisions for speech received while an orchestrated voice workflow is busy.

The application may provide a one-argument function, a module implementing classify/1, or an MFA tuple. Synaptic owns the single-flight state machine; the application only decides what the new utterance means.

Summary

Types

action()

@type action() ::
  :continue | :replace | :enqueue | :cancel | :ambiguous | :confirm | :decline

decision()

@type decision() :: %{
  :action => action(),
  optional(:request) => String.t() | nil,
  optional(:acknowledgement) => String.t() | nil
}

Functions

classify(router, context)

@spec classify(term(), map()) :: {:ok, decision()} | {:error, term()}