Going with mandatory versioning soon

Greeting API.AI Developers!

We are announcing that starting June 1, 2015, the versioning v parameter will be mandatory in all api.ai calls. Introduction of the versioning support will allow us to add new functions and make improvements to api.ai that are not backwards compatible. We are using the approach proposed in Foursquare API.

Couple of examples of such changes:

  • Domains functionality that you might already have seen in the console
  • Enhancing the return formats for system entities. E.g. @sys.date entity will be handling dates both in the future and in the past.

To use it, include v=YYYYMMDD parameter when you make a request. For example, https://api.api.ai/v1/query?v=20150330&query=weather&lang=en&sessionId=123

Check out our HTTP API documentation for more details. If you have any questions, always feel free to drop us a line.

Happy coding!

Create Intents with System Entities

For your convenience, we have included pre-defined system entities. We take care of common entities so that you don’t have to. System entities include things such as countries, capitals, music artists/genres, times, dates, numbers, names, colors and more (you can find a list in the entity overview). When you use the system entities, there is variability included for incoming values (e.g. USA can be referred to as the States or the United States of America).

A simple example is found below, where we are including a few system entities for an intent to travel.

To make this intent even more robust, we can make some more improvements by using inline entities:

Here, we are defining an inline entity that includes a broad set of US destinations that you can refer to. We do this by using an inline entity format: “@{… , , ….}:alias”. The intent defines two alisases - "place" and "date" - that will be returned to you in the JSON object. You can try it out by entering this example and saying something like: “I want to visit the Statue of Liberty on Jan 3rd”.

Similarly, inline entity syntax is used to define a number of synonyms: “@{want to, wanna, have to}”. Because there was no alias added at the end of this inline entity, nothing will be returned in the JSON. This approach can be used to easily add multiple variations in one intent and reduce the number of user expressions that you need to provide.

If you find that a system entity is missing - let us know and we will fix it!

Toyota Hackathon

Hackers from around the Valley gathered at NestGSV last month for the 2014 Toyota ITC Connected Vehicle Hackathon – a 24-hour marathon programming session that gave developers a taste of working with the new Toyota API. API.AI shined brilliantly alongside other veteran sponsors such as Twilio, Sensory, SmartThings, and Pebble, impressing competing hackers and industry-leading partners alike. Within the first hour of the competition, Sleek-Geek founder JeanCarl Bisson tweeted: “Already got @api_ai working at the #toyotahackathon14. Very developer friendly!”

Toyota ITC Connected Vehicle Hackathon from NestGSV on Vimeo.

In person, the story was the same. Developers went from merely curious to outright enthusiastic about working with api.ai, which opened up seemingly endless creative possibilities for the long night ahead. With the clock ticking, the soft chatter slowly dwindled down to a hush, as the initially animated competitors settled in and quietly coordinated how to take this year’s crown.

By noon the next day (18 hours in), there was scarcely a word spoken among the exhausted hackers. Everyone was deep in the zone, fatigued but focused, and determined to power through. Out of 22 final submissions, over a third used api.ai, and the feedback from the developers was overwhelmingly positive. The judges had their work cut out for them, as the competition presented a wide range of unique and well-done integrations.

But when all was said and done, one stood above the rest. We are delighted to announce the winner for the best integration with api.ai (and a cool $1,000): Anushree Pole with CarTalk. CarTalk highlighted complex dialog interaction scenarios that allowed the user to converse with the car, in natural language, regarding the vehicle’s fuel status and other important features. Anushree gave a clever, humorous personality to the car, which added yet another dimension of natural interaction to the user experience.

“It was extremely easy to integrate api.ai in my Windows Phone App,” said Anushree. “The user interface for creating my queries was very intuitive. I was done integrating it in my app in an hour or so.”

Among the other noteworthy submissions were Down, Her, Ok Toyota, HyperConnected Car, and the Toyota Connected Dashboard Team. Anna Shi, the creator of Down, also had high praise for api.ai’s voice interface. “Overall I thought the api was very intuitive and easy to use,” she said, listing among her favorite features:

-Description of entities and intents

-Quickstart guide was short and sufficient

-Creating entities and intents were very intuitive

-Plenty of sample code to get a simple project started.

In the end, the competition was a tremendous success for everyone involved. We’d like to thank Toyota, NestGSV, all of the sponsors, hackers, and everyone who participated. Looking forward to the next big event!

Comcast Developer Experience with api.ai

Mike Fine (Comcast):

“I recently used Speaktoit’s natural language processing API (www.api.ai) to build a voice- and text-chat web app that “knows about” television shows and television actors. The project was part of a Hack Week at Comcast’s Silion Valley Innovation Center.

In just over two days, I went from having never heard of Speaktoit or api.ai to a fully functional application that had an impressive set of features. Their website made it easy to sign up, discover my API keys, learn the key concepts of the system, and set up the “entities” (enumerated objects) and “intents” (commands) that form the core of my api.ai application. I was particularly impressed with how easy it was to manually test my entity and intent set up right from within their web application, without having to write any code. Once I got the core functionality of my app running, I used their REST API to programmatically create a thousand entities. Overall, their system was easy to learn, easy to use, and just plain worked.

If you’re thinking about building an application that involves natural language processing (voice- or text-based), check out Speaktoit’s API.AI. You’ll have something impressive up and running in no time.”

During the hackathon, Mike created an application that “knows about movies”. Here is an example of how a user could interact with it:

User: Show me movies with Brad Pitt

App: Displays list of movies with Brad Pitt

User: How about ones that also have Angelina Jolie?

App: Brings up movies with both Brad Pitt and Angelina Jolie

User: Nevermind. Show me comedies from 2002 to 2010.

App: Displays list

User: Ones with Louis CK

App: Provides a list of comedies with Louis CK from 2002-2010

Getting Started in 2 Minutes

Here’s how to get started with api.ai in 2 mins:

We will be covering other functionality of api.ai in the upcoming videos. Let us know which tutorials / how-to’s you’d like to see next!