View Source Glific.Dialogflow (Glific v5.1.6)

Module to communicate with DialogFlow v2. This module was taken directly from: https://github.com/resuelve/flowex/

I pulled it into our repository since the comments were in Spanish and it did not seem to be maintained, that we could not use as is. The dependency list was quite old etc.

Link to this section Summary

Functions

Execute a webhook action, could be either get or post for now

Get the list of all intents from the NLP agent

The request controller which sends and parses requests.

Link to this section Functions

Link to this function

execute(action, context, message)

View Source
@spec execute(
  Glific.Flows.Action.t(),
  Glific.Flows.FlowContext.t(),
  Glific.Messages.Message.t()
) :: :ok

Execute a webhook action, could be either get or post for now

Link to this function

get_intent_list(organization_id)

View Source
@spec get_intent_list(non_neg_integer()) ::
  {:ok,
   GoogleApi.Dialogflow.V2.Model.GoogleCloudDialogflowV2ListIntentsResponse.t()}
  | {:ok, Tesla.Env.t()}
  | {:ok, list()}
  | {:error, any()}

Get the list of all intents from the NLP agent

Link to this function

request(organization_id, method, path, body)

View Source
@spec request(non_neg_integer(), atom(), String.t(), String.t() | map()) :: tuple()

The request controller which sends and parses requests.