Skip to content

JavaScript Skill that allows you to have a conversation with Misty

License

Notifications You must be signed in to change notification settings

cameron-gq/misty-conversation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

misty-conversation

This JavaScript Skill lives on the Misty robot and allows you to have a conversation with Misty.

The skill uses Google DialogFlow so you can easily train Misty to recognize custom phrases and respond accordingly.

Requirements

  • Misty II robot
  • Google Cloud account with free trial or billing enabled

Video

Getting Started

Create an Agent in DialogFlow

DialogFlow is powered by Google machine learning and makes it easy to create conversational interfaces by simply adding training phrases and fulfillment responses. We will use DialogFlow to take an audio recording from Misty, convert it to text, find an appropriate response based on the training phrases, and send an audio file of the response back to Misty.

  1. Go to DialogFlow and sign in

  2. Click "Create Agent", name it "Misty", choose "Create a new Google project" and click Create

    Create Agent
  3. Create a new intent and call it "misty.age"

  4. Add Training phrases, Responses and click Save

    Age Intent

    NOTE: DialogFlow does NOT do a simple direct match to the Training phrases. Instead, it feeds the training phrases into a machine learning engine so that the intent will match on anything that's relatively close to the training phrases you enter.

Get Credentials for the Service Account in Google Cloud

When you create an Agent in DialogFlow it automatically creates a corresponding Google Cloud Project and a Service Account to use for authenticating requests. To send requests to DialogFlow, we have to send along an Access Token for authorization. Access Tokens only last 1 hour so we have to retrieve them often. We must download credentials for the Service Account to use in our request for an Access Token. We will create a signed JWT in JavaScript as part of the Misty Skill and request the Access Token directly.

  1. Open Settings for your agent in DialogFlow

  2. Click on the Service Account link

    Service Account
  3. Open the menu for the Service Account named "DialogFlow Integrations" and choose "Create Key"

    Create Key
  4. Choose JSON for the key type and click "Create". A JSON file will automatically download to your computer.

    Save JSON
  5. Open the JSON file and copy project_id, private_key_id, private_key, and client_email into "Conversation.json"

Upload the Conversation Skill to Misty

  1. Upload Conversation.js and Conversation.json to Misty using the Skill Runner

Talk to Misty

  1. Start the skill and say "Hey Misty"

  2. Wait for the beep and then say "How old are you?"

  3. Misty should respond with one of your phrases.

Next Steps

  1. Open your Agent in DialogFlow and add as many new Intents as you want!

    Jokes

About

JavaScript Skill that allows you to have a conversation with Misty

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published