Closed sreekanthpalagiri closed 5 years ago
@sreekanthpalagiri are you attempting to load dialogflow in the frontend of your application? as of right now our libraries do not work in a front-end context.
CC: @alexander-fenster is dialogflow on your radar for some of the work we're doing around making our gRPC libraries webpackable?
@bcoe We won't be able to support streaming calls in browser (e.g. streamingDetectIntent
), other than that, we'll be more than happy to try converting dialogflow to browser version and see how it works!
One thing that will be different compared to the current client library usage is that we'll need to use google-auth-library
OAuth2Client
to perform the complete OAuth2 workflow (redirect to authentication URL, accept the code, request a token). There will be no service account key support for browser usage.
cc: @ramya-ramalingam, @LibanOdowa
Thanks @alexander-fenster, @bcoe . I have now created a java service to connect to dialog flow and we will have front end call it. I will look to update our project when browser support is available.
Sounds like this is safe to close, please let us know if that is not the case.
I am building a chat bot using angular. I have used exact same code list on this page to query my intent, i am getting the below issue:
ERROR Error: Uncaught (in promise): TypeError: gax.GrpcClient is not a constructor TypeError: gax.GrpcClient is not a constructor at new SessionsClient (sessions_client.js:80) at getintentdetails.ts:23 at Generator.next ()
at tslib.es6.js:73
at new ZoneAwarePromise (zone-evergreen.js:876)
at Module.awaiter (tslib.es6.js:69)
at getintentdet (getintentdetails.ts:9)
at ChatComponent.addMessagefromUser (chat.component.ts:32)
at Object.eval [as handleEvent] (ChatComponent.html:27)
at handleEvent (core.js:34789)
at resolvePromise (zone-evergreen.js:797)
at new ZoneAwarePromise (zone-evergreen.js:879)
at Module.awaiter (tslib.es6.js:69)
at getintentdet (getintentdetails.ts:9)
at ChatComponent.addMessagefromUser (chat.component.ts:32)
at Object.eval [as handleEvent] (ChatComponent.html:27)
at handleEvent (core.js:34789)
at callWithDebugContext (core.js:36407)
at Object.debugHandleEvent [as handleEvent] (core.js:36043)
at dispatchEvent (core.js:22533)
Code that i am using:
const dialogflow = require('dialogflow').v2; const uuid = require('uuid');
/**
export async function getintentdet(projectId: String) { // A unique identifier for the given session const sessionId = uuid.v4();
}
My package.json:
{ "name": "applsupporbot", "version": "0.0.0", "scripts": { "ng": "ng", "start": "ng serve", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e" }, "private": true, "dependencies": { "@angular/animations": "^8.0.3", "@angular/cdk": "^8.0.1", "@angular/common": "~8.0.1", "@angular/compiler": "^8.1.2", "@angular/compiler-cli": "^8.1.2", "@angular/core": "^8.0.2", "@angular/forms": "~8.0.1", "@angular/material": "^8.0.1", "@angular/platform-browser": "~8.0.1", "@angular/platform-browser-dynamic": "~8.0.1", "@angular/router": "~8.0.1", "axios": "^0.19.0", "crypto": "^1.0.1", "dialogflow": "^0.10.3", "google-gax": "^1.1.5", "googleapis": "^41.0.1", "grpc": "^1.22.2", "ng-gapi": "0.0.73", "ngx-avatar": "^3.7.0", "rxjs": "^6.4.0", "tslib": "^1.9.0", "zone.js": "~0.9.1" }, "devDependencies": { "@angular-devkit/build-angular": "~0.800.0", "@angular/cli": "^8.1.2", "@angular/language-service": "~8.0.1", "@types/jasmine": "~3.3.8", "@types/jasminewd2": "~2.0.3", "@types/node": "^8.10.51", "codelyzer": "^5.0.0", "jasmine-core": "~3.4.0", "jasmine-spec-reporter": "~4.2.1", "karma": "~4.1.0", "karma-chrome-launcher": "~2.2.0", "karma-coverage-istanbul-reporter": "~2.0.1", "karma-jasmine": "~2.0.1", "karma-jasmine-html-reporter": "^1.4.0", "protractor": "~5.4.0", "ts-node": "~7.0.0", "tslint": "~5.15.0", "typescript": "~3.4.3" }, "browser": { "google-gax": false, "fs": false, "crypto": false, "http": false, "http2": false, "https": false, "net": false, "os": false, "path": false, "stream": false, "zlib": false, "tls": false, "child_process": false } }