Botfuel v0.1.0 Botfuel View Source

Documentation for the Botfuel main module.

Link to this section Summary

Functions

Send the question to the bot platform and return all answers that match it

Extract the entities of the provided sentence and parameters

Creates a new client process with the provided API app_id and app_key as a map

Run the provided sentence through the spellchecking platform

Link to this section Functions

Link to this function classify(sentence) View Source
classify(String.t()) :: {:ok, [Botfuel.Classify.t()]} | {:error, atom()}

Send the question to the bot platform and return all answers that match it.

Link to this function extract_entity(params) View Source
extract_entity(Botfuel.Entity.t()) ::
  {:ok, [Botfuel.Entity.Response.t()]} | {:error, atom()}

Extract the entities of the provided sentence and parameters.

They must be packed in a %Botfuel.Entity{} struct. You can learn more about what dimensions are authoriezd by checking the Botfuel.Entity.dimension type.

Creates a new client process with the provided API app_id and app_key as a map.

The Botfuel.Client module can be started by hand in a supervision tree as well, without much more ceremony. API id and key retrieval are left to the user according to their method of choice (config.ex, environment variables, HashiCorp Vault, etc).

Link to this function spellcheck(sentence, lang, distance \\ 2) View Source
spellcheck(String.t(), String.t(), non_neg_integer()) ::
  {:ok, Botfuel.Entity.t()} | {:error, atom()}

Run the provided sentence through the spellchecking platform.

The accepted parameters are:

  • sentence: the sentence to be checked
  • lang: the language to check. Must be either “FR” or “EN”.
  • distance: the maximum authorized distance (1 or 2)