Group chat widget based on HTML/CSS/JS, Firebase, Dialogflow
- Setup a Firebase account on https://firebase.google.com/
- Create a Google project in the Firebase console
- Setup a DialogFlow account on https://console.dialogflow.com/api-client/#/login
- Link your Google project with Dialogflow
- Initialize API by passing your Firebase API key and Dialogflow Access Token as options
var fcg = new FirebaseAIGroupChat({firebaseAPIKey:"",dialogflowAccessToken:""});
- Generate a Dialogflow response: Call the
getDFResponse(message, beforeSendFunc, successFunc, errorFunc)
javascript function to generate a Dialogflow response for a messagefcg.getDFResponse(message, beforeSendFunc, successFunc, errorFunc);
- Trigger a Dialogflow event: Call the
triggerDFEvent(eventName, beforeSendFunc, successFunc, errorFunc)
javascript function to trigger a Dialogflow event such as WELCOMEfcg.triggerDFEvent('WELCOME', beforeSendFunc, successFunc, errorFunc);
- Fork it!
- Create your feature branch:
git checkout -b firebase-ai-groupchat
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin firebase-ai-groupchat
- Submit a pull request :D
- Version 1.0: Chat interface with automatic responses generated using Dialogflow
Messaging interface based on Fabio Ottaviani's work on codepen: http://cdpn.io/jqOBqp
MIT license