0.0
No commit activity in last 3 years
No release in over 3 years
Clova API - SDK of the LINE Clova Smart Speaker API for Ruby. Developed as part of an internship at LINE Corp.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.16
~> 10.0
~> 3.0

Runtime

~> 2.1
 Project Readme

Clova-Speech

Installation

Add this line to your application's Gemfile:

gem 'clova-speech' 

And then execute:

$ bundle install

Usage

Use of this SDK assumes prior creation of a skill at the LINE Clova Dev Portal.

An example implementation of this gem, can be found in a sample skill at Clova Calculator Skill. While this example utilizies Sinatra to handle HTTP requests, any method should work.

Add this line to your Ruby program:

require 'clova'

Handling requests/responses

In order to handle the requests and provide the desired response, create a class that inherits from Clova::Skill. Within the class, the function names handle_launch, handle_intent, handle_event, handle_session_end. Within these functions we can define the way our skill responses to Launch, Intent, Event, and Session Ended requests respectively.

Example usage:

class CustomSkillName < Clova::Skill
  def handle_launch:
    #response to launch request
  end
  
  def handle_intent:
    #response to intent request
  end
   
  def handle_session_end:
  
  end

Handling Intent Requests

In order to gain the information from an Intent Request, you must access the slot of the request. (Check here for more information on the structure of Intent Requests)

Example: to access the information in slot num:

request.find_slot_value_by(:num)

An simple implementation can be seen in ClovaCalculatorSkill

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.