🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

ng-dialog-flow

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng-dialog-flow

#### Dialogflow is an enterprise-grade NLU platform that makes it easy for developers to design and integrate conversational user interfaces into mobile apps, web applications, devices, and bots.

latest
npmnpm
Version
0.0.9
Version published
Maintainers
1
Created
Source

Installation

Dialogflow is an enterprise-grade NLU platform that makes it easy for developers to design and integrate conversational user interfaces into mobile apps, web applications, devices, and bots.

'ng-dialog-flow' 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-dialog-flow

yarn add ng-dialog-flow

Usage

Import Main Module


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


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

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).subscribe(res=>{
console.log(res);
 });

   }

}




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;
}

Contributing

Please feel free to fork this package and contribute by submitting a pull request to enhance the functionalities.Repo name ng-dialog-flow .

How can I thank you?

Don't forget to follow me on twitter !

Thanks! Ajani Eniola Solomon.

Keywords

Ionic

FAQs

Package last updated on 20 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts