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 responses index.ex
Raw

lib/rasa_sdk/responses/index.ex

defmodule RasaSDK.Responses.Index do
@moduledoc """
This module handles getting a list of all the responses available and outputting them in a format
that can be used by the rasa chatbot during training.
"""
alias RasaSDK.Responses.Registry
import Plug.Conn
def init(opts), do: opts
def call(conn, opts) do
responses = Registry.list_keys(opts)
conn
|> put_resp_content_type("application/json")
|> send_resp(200, Poison.encode!(responses))
end
end