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.
npm install ng-dialogflow
yarn install ng-dialogflow
import { NgDialogFlowModule,NgDialogFlowService} from 'ng-dialog-flow';
@NgModule({
declarations: [
//....
],
imports: [
//...
NgDialogFlowModule.forRoot({token:'xxxxxxxxxxx'})
],
})
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);
}
}
- message
- timezone
- sessionid
- lang
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;
}
*** DialogFlow Angular Ionic **