Skip to content

Commit

Permalink
Switch api.ai to dialogflow (#25)
Browse files Browse the repository at this point in the history
* Switch api.ai to dialogflow
* Cleanup
  • Loading branch information
van100j authored Jun 12, 2021
1 parent cc65f01 commit 7d9a5bf
Show file tree
Hide file tree
Showing 8 changed files with 3,967 additions and 167 deletions.
4 changes: 3 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
NODE_ENV=development
PORT=4040
WSURL=http://localhost:4040
APIAI_CLIENT_TOKEN=YOUR_API_AI_CLIENT_ACCESS_TOKEN
GOOGLE_API_KEY=YOUR_GOOGLE_TIMEZONE_API_TOKEN
GOOGLE_APPLICATION_CREDENTIALS_PKEY="-----BEGIN PRIVATE KEY-----\...YOUR...\n...PKEY...\n-----END PRIVATE KEY-----\n"
GOOGLE_APPLICATION_CREDENTIALS_CLIENT_EMAIL=[email protected]
DIALOGFLOW_PROJECT_ID=YOUR_PROJECT_ID
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ A simple bot app which enables users to ask about the current date and time, cal

## Requirements

The app is built using [Angular](https://angular.io/) on the front end, [Express](https://expressjs.com/) on the back end, and [API.AI](https://api.ai/)'s API to process and understand natural language.
The app is built using [Angular](https://angular.io/) on the front end, [Express](https://expressjs.com/) on the back end, and ~~[API.AI](https://api.ai/)'s API~~ [Dialogflow](https://cloud.google.com/dialogflow/) to process and understand natural language.

You will need:
- [Node.js](https://nodejs.org/en/), and [npm](https://docs.npmjs.com/getting-started/installing-node) or [Yarn](https://yarnpkg.com/en/)
- [API.AI account](https://console.api.ai/api-client/#/login)
- ~~[API.AI account](https://console.api.ai/api-client/#/login)~~ [Google Cloud account](https://console.cloud.google.com/), and [setup it up to start using Dialogflow](https://cloud.google.com/dialogflow/es/docs/quick/setup)

You will also need [Google Maps API](https://developers.google.com/maps/get-started/) key, as we'll use some of their APIs to get data related to locations and timezones, specifically:
- The [Google Maps Geocoding API](https://developers.google.com/maps/documentation/geocoding/start) — to get location related data
- The [Google Time Zone API](https://developers.google.com/maps/documentation/timezone/intro) — to get location's timezone data.

Once you've created your [API.AI account](https://console.api.ai/api-client/#/login) go ahead and create your [Agent](https://api.ai/docs/agents). Then, in your created Agent, import the [intents](./data/intents) and [entities](./data/entities) used in this example.
Once you've created your ~~[API.AI account](https://console.api.ai/api-client/#/login)~~ [Google Cloud account](https://console.cloud.google.com/) go ahead and create your [Agent](https://cloud.google.com/dialogflow/es/docs/quick/build-agent). Then, in your created Agent, import the [intents](./data/intents) and [entities](./data/entities) used in this example.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class AppComponent implements OnInit, OnDestroy {
tz: this.timezone
};

this.ws$.next(JSON.stringify(input));
this.ws$.next(input);
this.pushMsg(input, true);
this.botIsTyping = true;
}
Expand Down
Loading

0 comments on commit 7d9a5bf

Please sign in to comment.