Giter Site home page Giter Site logo

dialogflow-nodejs-client's People

Contributors

brandon-pereira avatar coreyroach avatar defijesus avatar gugic avatar jsalwen avatar jwbrew avatar lilia-simeonova avatar oprog avatar richardgroves avatar tiff avatar xvir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dialogflow-nodejs-client's Issues

issue saving intent in developer console

hi
i am facing trouble in saving intent. Although i created entities properly and after creating parameter values and speech response it says "Some values in parameters are unresolved:$hotelName".
$hotelName is value for corresponding parameter hotelName and entity @$hotelName.

Adding bot to user's channel doesn't turn it on

The bot only responds to default bot_channel it created, but once you add it to custom channel created by user, it doesn't do anything.

Seems like it needs to handle ('channelAdded') event with subsequent channel.join() to make it happen?

Would be great to have this functionality by default, without requiring custom server.

Using domains.

The examples served well for me but when I am using domains for example News, I am not getting any responses. No fulfilment. How to use domains? Anything explicit?

Thanks!

Missing exceptions.js file from repository, what am I missing?

I cloned repo and I can't find the /module/exceptions.js file. I cannot find that file in repo browser on here too. But the file is there if I install library with npm install (ver 3.0.1)

I'm not a github nor nodejs expert here, any hint, how do I get that file via git?

Content of the file is below:

/*!
 * apiai
 * Copyright(c) 2015 http://api.ai/
 * Apache 2.0 Licensed
 */

'use strict';

var util = require('util');

exports.ServerError = module.exports.ServerError = ServerError;

util.inherits(ServerError, Error);

function ServerError (statusCode, responseBody, message) {
    var self = this;

    Error.captureStackTrace(this, ServerError);

    self.statusCode = statusCode;
    self.responseBody = responseBody;

    this.name = this.constructor.name;
    this.message = message;

    ServerError.super_.apply(this, []);
}

Thanks

cors support on the requests

Just completed my app but when it comes to running it on a local server, I am getting an error "Client was not configured properly". But I don't see this error when I use CORS plugin on my chrome. This is the stack trace :

Fetch API cannot load https://api.api.ai/v1/query?v=20150910. Request header field api-request-source is not allowed by Access-Control-Allow-Headers in preflight response.

Please help me resolve this. Its all going good for development but when it comes to deploying, I am stuck.

bot working differently in apiai site and node sdk

Hi i have developed some bot, when i am calling from api.ai site it is working fine. But if i call it from node SDK it is not working incase of intents having fulfillments. i am getting default response for the same request.

i need to Develop intelligent chatbot

i am planning to develop intelligent chatbot what are the requirements are required to develop chatbot.
1.Front end which language i need to use and back end which one i need to use.
2.any inbuilt temp lets are available?if it is not available please specify if any???
3.which operating System is best to build Chatbots Windows or ubuntu or MacOS.
4.How to start to build chatbot??? Please specify????

ServerError - Wrong response status code.

responseBody: '{\n "id": "fd0d8064-e7f1-49e8-be8f-acf49bd450ae",\n "timestamp": "2016-11-16T19:44:02.09Z",\n "status": {\n "code": 400,\n "errorType": "bad_request",\n "errorDetails": "Required \u0027sessionId\u0027 parameter is empty."\n }\n}',

ServerError : Wrong response status code

I had tried to run "voice_request.js" example, but error has occurred like this.

ServerError : Wrong response status Code, statuesCode 502
The server encountered a temporary error and could not complete yout request Please try again in 30 seconds.

It seems that apiai server's speech recognition function isn't working now.
How could I solve this situation?

Does the text_request_with_entities.js work?

Hi,

I'm trying to test apiai.
Created the test agent with one intent.

Copied my developer access token to the code and launched the script.

Here is my response:
image

Are we sure that this example is working?
As I expected - it would create correspondent entities inside my agent.

Regards,

Typescript issue building index.d.ts

With typescript version 2.1.6:

node_modules/apiai/index.d.ts(25,5): error TS2666: Exports and export assignments are not permitted in module augmentations.

Commit vs release

Hello!

Can you release the 4.0.3 with getContextRequest pleaseeeeeee

getcontext1

ECONNREFUSED 54.192.188.124:443

Code:
var apiai = require('apiai');

var app = apiai("Client access token");

var request = app.textRequest('help', {
sessionId: 'unique-sesssion-id'
});

request.on('response', function(response) {
console.log(response);
});

request.on('error', function(error) {
console.log(error);
});

request.end();

Response:
{ Error: connect ECONNREFUSED 54.192.188.124:443
at Object.exports._errnoException (util.js:1022:11)
at exports._exceptionWithHostPort (util.js:1045:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '54.192.188.124',
port: 443 }

Access token : Client access token.
session-id : Some random value.

When i tried the same code in cloud9 ide , its able to fetch the exact response.
Is this error had to do something with the proxy setting?

i am not sure what mistake i am doing. i need help in figuring out this connection issue.

(With solution ->) Request header field api-request-source is not allowed by Access-Control-Allow-Headers

Hi there,

The API seems to block requests with the following message: "Request header field api-request-source is not allowed by Access-Control-Allow-Headers"

I saw that in the code here:
https://github.com/api-ai/apiai-nodejs-client/blob/master/module/request.js
on line 55 where the header is set up, the api-request-source header is added:
'api-request-source': self.requestSource

but in the documentation here: https://api.ai/docs/reference/agent/query#post_query

That header isn't there. After removing it from the code of the Node.js SDK, the request worked perfectly.

Should this be removed?

Best,
Jan

sys.unit-currency is no longer returning expected value

sys.unit-currency is failing our requests as it is no longer returning the expected value and formatted currency.

Previously, when a user said: 10 dollars, 10 euros, 10 dollar the output was in the format:

parameters.unit-currency.amount: 10
parameters.unit-currency.currency: USD for dollars
parameters.unit-currency.currency: EUR for euros

Today I am noticing that the output is the plain text that the user says:

parameters.unit-currency: 10 dollars

Application timezone not set?

The timezone of the application never seemed to be set, and request.js is using it.
Is there a way we can set the timezone for a request?

Follow Up intents will not work with this code

As the code for session IDs is creating the new session everytime.
The follow up intents are not working with this code.
Also the uuid.v4 is not working for follow up intents. v1 is working.

API.AI team, please correct and take the session IDs outside the constructor, I have done it and this way the follow up intents are working correctly

proxy

It should be exposed the request properties to set the proxy

V4.0.0 documentation vs. endpoint mismatch for /userEntities

Looks like something's amuck with the official documentation for POST /v1/userEntities versus what POST /v1/userEntities is actually accepting, and I believe was previously documented as.

I've been posting to the /userEntities endpoint just fine using v3.0.3 for for quite sometime. "Upgrading" to v4.0.0 breaks this method. (This module should also include tests and much better and more complete documentation.) The author redefines the structure that's accepted to the documentation but returns as a bad request. Looks like some kind of botched endpoint version migration happening here.

Previously documented and currently accepted JSON by the /userEntries endpoint:

{
   "sessionId":"12345",
   "name":"city",
   "extend":false,
   "entries":[
      {
         "value":"New York",
         "synonyms":[
            "New York",
            "Big Apple"
         ]
      }
   ]
}

Newly documented and currently unaccepted JSON by the /userEntries endpoint see example:

{
    sessionId: sessionId,
    entities: [{
        name: 'Application',
        sessionId: sessionId,
        extend: false,
        entries: [
            {
                value: 'Firefox',
                synonyms: ['Firefox']
            },
            {
                value: 'XCode',
                synonyms: ['XCode']
            },
            {
                value: 'Sublime Text',
                synonyms: ['Sublime Text']
            }
        ]
    }]
};

Having to return to V3.0.3 until this is resolved. Thanks.

Typings

do you plan to include TypeScript Typings for this project?
if no, would you merge a typings pull request if someone provided one (like me)?

try/catch around response processing is unhelpful

Around https://github.com/api-ai/api-ai-node-js/blob/master/module/request.js#L41 there is a try/catch block around the processing of the response from the server, if it fails then the error callback is called.

This has just caused me a bunch of problems in that I had an error in my response handling code which gets silently consumed and then my error callback code runs - I'd consider that the request.on('error', function(error) {}); function should only be called when the server has returned an error - its not designed to handle errors in our own response code - we should do that, and with your try/catch eating them they show up in a very odd way.

Would suggest removing that try/catch and letting user supplied code handle it's own errors when dealing with the response.

Bug in example

https://github.com/api-ai/api-ai-node-js/blob/master/examples/text_request_with_entities.js

{ Error
at IncomingMessage. (/bot/playgroud/node_modules/apiai/module/request.js:60:29)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
statusCode: 400,
responseBody: '{\n "id": "b47b02a24----ab6",\n "timestamp": "2017-01-23T12:34:13.652Z",\n "status": {\n "co
de": 400,\n "errorType": "bad_request",\n "errorDetails": "Required 'sessionId' parameter is empty."\n }\n}',
name: 'ServerError',
message: 'Wrong response status code.' }

simplest webhook to echo user entry

I'm really having problems firing a node.js webhook action from my api.ai bot. can anyone point me at the simplest possible example of a node webhook that just echoes the user entry so I can go from there ? appreciate it.

How to upload custom entities

I see that the documentation has not mentioned anything about using the /entities endpoint. Can you kindly clarify how I can add/udpate/delete custom entities

API.AI speech recognition is going to be deprecated soon.

Is this true
screenshot001
when trying to run the fllowing sample a get an error.
`var fs = require("fs");

// var apiai = require("../module/apiai");
var apiai = require("apiai");

var app = apiai("token", {
language: 'eng'
});

var request = app.voiceRequest();

request.on('response', function(response) {
console.log(response);
});

request.on('error', function(error) {
console.log(error);
});

fs.readFile("1.wav", function(error, buffer) {
if (error) {
console.log(error);
} else {
request.write(buffer);
}

request.end();

});`

Is there a way to send a textRequest with a slot already filled?

I am working on a voice assistant that is location aware and I want to be able to fill the location slot with the initial request. Say something like "bot, turn the lights off" which would trigger an intent with a location slot. I tried sending it in context but that doesn't seem to fill the slot?

Wisdom not working on node

Wisdom is working on api-ai dashboard. see below image
http://prntscr.com/cnptu0

I have integrated the api-ai in my node app (Free version)
but its not working in there

here is the response I am getting.

{  
   "id":"0d113e16-e69b-417b-9f69-d34dd9f594c9",
   "timestamp":"2016-09-29T10:38:19.87Z",
   "result":{  
      "source":"agent",
      "resolvedQuery":"Who was Albert Einstein?",
      "contexts":[  

      ],
      "metadata":{  
      },
      "fulfillment":{  
         "speech":""
      },
      "score":0
   },
   "status":{  
      "code":200,
      "errorType":"success"
   }
   "sessionId":"00000000-0000-0000-0000-000000000000"
}

please guide me on this issue. What I am missing

ServerError: Wrong response status code.

Hi ,

I have created several Intents but for some of them when i am using the NodeJS SDK the response is coming on error inside the below code with the error as ServerError: Wrong response status code.

request.on('error', function(error) {
console.log(error);
});
This works find from the api.ai test console. Please advise

Change "name" in package.json from apaai

If you try to run npm install apiai you will get the following:

npm install apiai
npm WARN package.json [email protected] license should be a valid SPDX license expression
npm WARN install Refusing to install apiai as a dependency of itself

The name in package.json conflicts with the package "apiai". A simple change to something like "api-ai-node-js" will fix the problem.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.