ios-chatbot icon indicating copy to clipboard operation
ios-chatbot copied to clipboard

Chatbot with API.AI and Google Cloud APIs

This sample demonstrates how to build an iOS chatbot with Google Cloud Vision, Speech, and Translate APIs and API.AI.

English Demo The Google Assistant / Google Home Demo

Prerequisites

Quickstart

  • Clone this repo and cd into this directory.
  • Run pod install to download and build Cocoapods dependencies.
  • Open the project by running open ChatBot.xcworkspace.
  • In CBDefines.m, replace your google API key with the API key obtained above.
  • Build and run the app.

API keys

  1. Create a new project on https://console.cloud.google.com.
  2. Enable Billing.
  3. Go to API Manager.
  4. Go to Credentials
  5. Create credentials. Choose API Key.
  6. Replace @"your google API key" with your google API key in CBDefines.m

API.AI

Optionally, follow these steps to create your own API.AI agents.

  1. Create TourGuide agent.
  2. Go to Settings and import api.ai/TourGuide.zip.
  3. (Optional steps to support Chinese) Create TourGuideChinese agent with language set to Chinese.
  4. Go to Settings and import api.ai/TourGuideChinese.zip
  5. Replace CBApiAiToken with your API.AI token in CBDefines.m. You can find your token from the API.AI agent setting page.

Chinese Demo

Chinese Demo

License

This sample is released under the Apache 2.0 license.

Disclaimer

This is not an official Google product.

Authors

Chang Luo and Bob Liu