Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

SAP-archive/starter-ruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Recast.AI starter kit Ruby

A starter kit for developing bots on the Recast.AI platform.

Note: This project is currently in beta version and can be modified at any time.

Requirements

Ruby version

We recommand use ruby 2.3+

Recast.AI account

Create an account on the Recast.AI platform and follow this quick tutorial to create your first bot on the interface.

Usage

Installation

First clone the project:

git clone git@github.com:RecastAI/starter-ruby.git my-bot && cd my-bot

Then, install the dependencies:

bundle

Fill the config file

Fill the config.rb at the root of your project with your Recast token and (optionally) the language and the port you want to use.

ENV['REQUEST_TOKEN'] ||= 'YOUR_TOKEN'
ENV['LANGUAGE'] ||= nil
ENV['PORT'] ||= '5000'

This configuration will be loaded by the bot.rb file in case they are not already present in the environment.

To complete your Recast.AI token and your language:

  • Go to your bot page
  • Click on the settings icon (the gear on the right of your screen)
  • Copy your request token
  • Set the default language of your bot as either 'en', 'fr', ...

Run locally

ruby bot.rb

Note: Next steps, only if you have connected your bot to channels, using the Bot Connector tool

  • Download ngrok
  • Launch: ngrok http 5000
  • Copy the url ngrok outputs
  • Paste it in the Recast.AI interface: Go to your bot page, click on the RUN tab and edit your current bot webhook
  • Chat with your bot on the channels you've configured ;)

Documentation

Code Documentation
Receiving messages The Recast.AI SDK
Sending messages The Recast.AI SDK
Rich messaging Messages payloads

More

You can view the whole API reference at man.recast.ai. You can follow us on Twitter at @recastai for updates and releases.

License

Copyright (c) [2017] Recast.AI

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.