chatbase v0.0.3 Chatbase View Source

Provides helper methods to log data to Chatbase Bot Analytics API

Link to this section Summary

Link to this section Functions

Link to this function agent_message(user_id, platform, message \\ "", intent \\ "", not_handled \\ false) View Source

Log data sent by Bot to the User

Parameters

  • user_id: String used as user identifier
  • platform: String used to denote platform, like, facebook, slack, alexa
  • message: String sent by the Bot to the User
  • intent: String classifying intent of the message
  • not_handled: Boolean type, if request handled by agent or not

Examples

cb = Chatbase.agent_message("123", "alexa", "some message", "some-intent")
Link to this function multiple_messages(list_of_maps) View Source

Log multiple messages at once, can be used in queue

Parameters

  • list_of_maps: A list containing maps

Examples

  user_data = %{
    "type" => "user",
    "user_id" => "123",
    "platform" => "alexa",
    "message" => "user message",
    "intent" => "some-intent"
  }
  agent_data = %{
    "type" => "agent",
    "user_id" => "123",
    "platform" => "alexa",
    "message" => "agent message",
    "intent" => "some-intent"
  }

  list_of_maps = [user_data, agent_data]
  cb = Chatbase.multiple_messages(list_of_maps)
Link to this function user_message(user_id, platform, message \\ "", intent \\ "", not_handled \\ false, feedback \\ false) View Source

Log data sent by User to the Bot

Parameters

  • user_id: String used as user identifier
  • platform: String used to denote platform, like, facebook, slack, alexa
  • message: String sent by the User to the Bot
  • intent: String classifying intent of the message
  • not_handled: Boolean type, if request handled by agent or not
  • feedback: Boolean type, if feedback to agent or not

Examples

cb = Chatbase.user_message("123", "alexa", "some message", "some-intent")