Crystal client for Dialogflow https://krthr.github.io/dialogflow-crystal/

Travis CI Docs GitHub release GitHub

dialogflow

Crystal client for Dialogflow

Installation

  1. Add the dependency to your shard.yml:
  dependencies:
    dialogflow:
      github: krthr/dialogflow-crystal
  1. Run shards install

Usage

require "dialogflow"

Dialogflow.init(
  project_id: "PROJECT_ID",
  credentials: {
    :private_key  => "PRIVATE_KEY",
    :client_email => "CLIENT_EMAIL",
  }
)

Dialogflow::Sessions.detect_intent "123", {
  "queryInput" => {
    "text" => {
      "text"         => "Hi",
      "languageCode" => "en",
    },
  },
} # => Hi, im a robot.

Dialogflow::Sessions.detect_intent "123", {
  "queryInput" => {
    "text" => {
      "text"         => "Hola",
      "languageCode" => "es",
    },
  },
} # => Hola, soy un robot.

See API

Contributing

  1. Fork it (https://github.com/krthr/dialogflow-crystal/fork)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors

  • krthr - creator and maintainer
Github statistic:
  • 2
  • 0
  • 0
  • 0
  • 0
  • 16 days ago

License:

MIT License

Links: