Skip to content

An ionic /Angular library that allow you integrate google Dialogflow api to your ionic/Angular application

Notifications You must be signed in to change notification settings

ajanieniolasolomon/ng-dialogflow

Repository files navigation

Installation

An Angular / Ionic library for DialogFlow . Powered by DialogFlow .You will need an Access Token from DialogFlow to access the full function of this machine learning/natural language processing library.


GitHub licenseBuild Status Maintenancesaythanks

npm install ng-dialogflow

yarn install ng-dialogflow

Usage

Import Main Module

import { NgDialogFlowModule,NgDialogFlowService} from 'ng-dialog-flow';


@NgModule({
 declarations: [
   //....
   ],
  imports: [
   //...
    NgDialogFlowModule.forRoot({token:'xxxxxxxxxxx'})
  ],
  })

Add to service

import { Injectable } from '@angular/core';
import { NgDialogFlowService } from 'ng-dialog-flow';

@Injectable({
providedIn: 'root'
})
export class AppService {

constructor(private service: NgDialogFlowService) { }

ask(mess: string) {
 return  this.service.askQuestion(mess);

   }

}



More

askQuestion

Request parameters:

  • message
  • timezone
  • sessionid
  • lang

Response object

 export interface Message {
	platform: string;
	textToSpeech: string;
	type: string;
}

export interface Fulfillment {
	messages: Message[];
	speech: string;
}

export interface Metadata {
	intentId: string;
	intentName: string;
	webhookForSlotFillingUsed: string;
	webhookUsed: string;
}

export interface Parameter {
	fruit: string[];
}

export interface Result {
	action: string;
	actionIncomplete: boolean;
	contexts: string[];
	fulfillment: Fulfillment;
	metadata: Metadata;
	parameters: Parameter;
	resolvedQuery: string;
	score: number;
	source: string;
}

export interface Statu {
	code: number;
	errorType: string;
}

export interface RootObject {
	id: string;
	lang: string;
	result: Result;
	sessionId: string;
	status: Statu;
	timestamp: string;
}

keyword

*** DialogFlow Angular Ionic **

About

An ionic /Angular library that allow you integrate google Dialogflow api to your ionic/Angular application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published