Socket
Socket
Sign inDemoInstall

ng-dialog-flow

Package Overview
Dependencies
5
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ng-dialog-flow

#### An Angular / Ionic library for DialogFlow . Powered by [DialogFlow](www.dialogflow.com) .You will need an _Access Token_ from DialogFlow to access the full function of this machine learning/natural language processing library. ___


Version published
Maintainers
1
Created

Readme

Source

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 npm i ng-dialog-flow

yarn install npm i 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;
}

keywords

DialogFlow Angular Ionic

FAQs

Last updated on 20 Oct 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc