Packages

Rasa is an open source machine learning framework to automate text-and voice-based conversations. https://github.com/RasaHQ/rasa This library provides tools to communicate and control a Rasa application from Elixir.

Current section

Files

Jump to
rasa_sdk lib rasa_sdk actions action.ex
Raw

lib/rasa_sdk/actions/action.ex

defmodule RasaSdk.Actions.Action do
alias RasaSdk.Actions.Context
@callback name() :: String.t()
@callback run(Context.t()) :: Context.t()
defmacro __using__(_) do
quote do
@behaviour RasaSdk.Actions.Action
import RasaSdk.Actions.Context
import RasaSdk.Actions.Events
def name() do
"#{__MODULE__}"|>String.split(".")|>Enum.reverse|>Enum.at(0)|>Macro.underscore()
end
def run(%Context{} = context) do
context
end
defoverridable name: 0,
run: 1
end
end
end