elixir_wit v0.1.0 Wit

The client for the WIT API that contains the low-level functions for APIs such as /message and /converse. It also contains the high level function such as run_actions to run module implementing the actions and also the interactive API that runs the actions by getting message from the console.

Summary

Functions

Calls the run_actions using the text gotten from console and keeps on running till user exits. The user can exit by pressing Enter which will prompt the user to quit or not

Calls the /converse API and sses the default and custome actions defined in the module to return back the response to the /converse API and update the context until the /converse API returns back stop or max_steps have reached (whichever comes first)

Functions

converse(access_token, session_id, text \\ "", context \\ %{})

Specs

converse(String.t, String.t, String.t, map) ::
  {:ok, Wit.Models.Response.Converse.t} |
  {:error, String.t, map}

Calls the /converse API

interactive(access_token, session_id, module, context \\ %{})

Specs

interactive(String.t, String.t, atom, map) :: {:ok, map}

Calls the run_actions using the text gotten from console and keeps on running till user exits. The user can exit by pressing Enter which will prompt the user to quit or not.

message(access_token, text, context \\ %{}, thread_id \\ "", msg_id \\ "", total_outcomes \\ 1)

Specs

message(String.t, String.t, map, String.t, String.t, integer) ::
  {:ok, Wit.Models.Response.Message.t} |
  {:error, String.t, map}

Calls the /message API

run_actions(access_token, session_id, module, text \\ "", context \\ %{}, max_steps \\ 5)

Specs

run_actions(String.t, String.t, atom, String.t, map, integer) :: any

Calls the /converse API and sses the default and custome actions defined in the module to return back the response to the /converse API and update the context until the /converse API returns back stop or max_steps have reached (whichever comes first).