Skip to content
Node.js client for Dialogflow: Design and integrate a conversational user interface into your applications and devices.
Branch: master
Clone or download
renovate and yoshi-automation chore(deps): update dependency nyc to v14
chore(deps): update dependency nyc to v14

This PR contains the following updates:

| Package | Type | Update | Change | References |
|---|---|---|---|---|
| nyc | devDependencies | major | [`^13.0.0` -> `^14.0.0`](https://diff.intrinsic.com/nyc/13.3.0/14.0.0) | [source](https://togithub.com/istanbuljs/nyc) |

---

### Release Notes

<details>
<summary>istanbuljs/nyc</summary>

### [`v14.0.0`](https://togithub.com/istanbuljs/nyc/blob/master/CHANGELOG.md#&#8203;1400httpsgithubcomistanbuljsnyccomparev1330v1400-2019-04-15)

[Compare Source](https://togithub.com/istanbuljs/nyc/compare/v13.3.0...v14.0.0)

##### Bug Fixes

-   Add `cwd` option to instrument command ([#&#8203;1024](https://togithub.com/istanbuljs/nyc/issues/1024)) ([051d95a](https://togithub.com/istanbuljs/nyc/commit/051d95a))
-   Add config values to hash salt ([#&#8203;988](https://togithub.com/istanbuljs/nyc/issues/988)) ([7ac325d](https://togithub.com/istanbuljs/nyc/commit/7ac325d)), closes [#&#8203;522](https://togithub.com/istanbuljs/nyc/issues/522)
-   Exclude negated not working with '--all' switch ([#&#8203;977](https://togithub.com/istanbuljs/nyc/issues/977)) ([91de23c](https://togithub.com/istanbuljs/nyc/commit/91de23c))
-   Make --all work for transpiled code ([#&#8203;1047](https://togithub.com/istanbuljs/nyc/issues/1047)) ([18e04ba](https://togithub.com/istanbuljs/nyc/commit/18e04ba))
-   Resolve absolute paths in nyc instrument ([#&#8203;1012](https://togithub.com/istanbuljs/nyc/issues/1012)) ([3cb1861](https://togithub.com/istanbuljs/nyc/commit/3cb1861)), closes [#&#8203;1014](https://togithub.com/istanbuljs/nyc/issues/1014)
-   Set processinfo pid/ppid to actual numbers ([#&#8203;1057](https://togithub.com/istanbuljs/nyc/issues/1057)) ([32f75b0](https://togithub.com/istanbuljs/nyc/commit/32f75b0))
-   Use a single instance of nyc for all actions of main command. ([#&#8203;1059](https://togithub.com/istanbuljs/nyc/issues/1059)) ([b909575](https://togithub.com/istanbuljs/nyc/commit/b909575))

##### Features

-   Add `delete` option to instrument command ([#&#8203;1005](https://togithub.com/istanbuljs/nyc/issues/1005)) ([d6db551](https://togithub.com/istanbuljs/nyc/commit/d6db551))
-   Add `include` and `exclude` options to instrument command ([#&#8203;1007](https://togithub.com/istanbuljs/nyc/issues/1007)) ([8da097e](https://togithub.com/istanbuljs/nyc/commit/8da097e))
-   Add processinfo index, add externalId ([#&#8203;1055](https://togithub.com/istanbuljs/nyc/issues/1055)) ([8dcf180](https://togithub.com/istanbuljs/nyc/commit/8dcf180))
-   Add support for nyc.config.js ([#&#8203;1019](https://togithub.com/istanbuljs/nyc/issues/1019)) ([3b203c7](https://togithub.com/istanbuljs/nyc/commit/3b203c7))
-   Add support to exclude files on coverage report generation ([#&#8203;982](https://togithub.com/istanbuljs/nyc/issues/982)) ([509c6aa](https://togithub.com/istanbuljs/nyc/commit/509c6aa))
-   Add test-exclude args to check-coverage and report subcommands. ([0fc217e](https://togithub.com/istanbuljs/nyc/commit/0fc217e))
-   Always build the processinfo temp dir ([#&#8203;1061](https://togithub.com/istanbuljs/nyc/issues/1061)) ([c213469](https://togithub.com/istanbuljs/nyc/commit/c213469))
-   Enable `es-modules` option for nyc instrument command ([#&#8203;1006](https://togithub.com/istanbuljs/nyc/issues/1006)) ([596b120](https://togithub.com/istanbuljs/nyc/commit/596b120))
-   Fix excludeAfterRemap functionality. ([36bcc0b](https://togithub.com/istanbuljs/nyc/commit/36bcc0b))
-   Implement `nyc instrument --complete-copy` ([#&#8203;1056](https://togithub.com/istanbuljs/nyc/issues/1056)) ([2eb13c6](https://togithub.com/istanbuljs/nyc/commit/2eb13c6))
-   Remove bundling ([#&#8203;1017](https://togithub.com/istanbuljs/nyc/issues/1017)) ([b25492a](https://togithub.com/istanbuljs/nyc/commit/b25492a))
-   Support turning off node_modules default exclude via `exclude-node-modules` option ([#&#8203;912](https://togithub.com/istanbuljs/nyc/issues/912)) ([b7e16cd](https://togithub.com/istanbuljs/nyc/commit/b7e16cd))
-   Add support for `--exclude-node-modules` to subcommands. ([#&#8203;1053](https://togithub.com/istanbuljs/nyc/issues/1053)) ([e597c46](https://togithub.com/istanbuljs/nyc/commit/e597c46))

##### BREAKING CHANGES

-   The `--exclude-after-remap` option is now functional and enabled by default.  This causes the `include` and `exclude` lists to be processed after using source maps to determine the original filename of sources.
-   Add a file named 'index.json' to the .nyc_output/processinfo directory, which has a different format from the other files in this dir.
-   Change the data type of the pid/ppid fields in processinfo files
-   `nyc instrument` now honors `include` and `exclude` settings, potentially resulting in some files that were previously instrumented being ignored.
-   The `plugins` option has been renamed to `parser-plugins`.
-   The logic involving include/exclude processing has changed.  Results should be verified to ensure all desired sources have coverage data.
-   `nyc instrument` now enables the `--es-module` option by default.  This can cause failures to instrument scripts which violate `'use strict'` rules.

</details>

---

### Renovate configuration

📅 **Schedule**: "after 9am and before 3pm" (UTC).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻️ **Rebasing**: Whenever PR is stale, or if you modify the PR title to begin with "`rebase!`".

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- renovate-rebase -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://togithub.com/marketplace/renovate). View repository job log [here](https://renovatebot.com/dashboard#googleapis/nodejs-dialogflow).

#321 automerged by dpebot
Latest commit 5e61d60 Apr 16, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github chore: move CONTRIBUTING.md to root (#274) Feb 7, 2019
.kokoro chore: publish to npm using wombat (#304) Mar 20, 2019
protos/google/cloud/dialogflow feat: support audio config Apr 2, 2019
samples docs: fix docs 404 in samples/docs (#316) Apr 3, 2019
src feat: support audio config Apr 2, 2019
system-test chore: remove unused deps (#212) Nov 9, 2018
test feat: support audio config Apr 2, 2019
.cloud-repo-tools.json
.eslintignore chore: update nyc and eslint configs (#248) Dec 11, 2018
.eslintrc.yml Enable prefer-const in the eslint config (#167) Sep 20, 2018
.gitignore Run the synth generator and update config (#161) Sep 19, 2018
.jsdoc.js build: check broken links in generated docs (#254) Jan 15, 2019
.nycrc
.prettierignore Dialogflow API (#5) Nov 15, 2017
.prettierrc Dialogflow API (#5) Nov 15, 2017
CHANGELOG.md
CODE_OF_CONDUCT.md Dialogflow API (#5) Nov 15, 2017
CONTRIBUTING.md docs: update links in contrib guide (#283) Feb 14, 2019
LICENSE docs: update the readme (#232) Dec 3, 2018
README.md docs: update contributing path in README (#275) Feb 8, 2019
codecov.yaml
package.json chore(deps): update dependency nyc to v14 Apr 16, 2019
renovate.json chore: update the renovate config (#237) Dec 5, 2018
synth.metadata feat: support audio config Apr 2, 2019
synth.py fix(docs): dialogflow isnt published under @Google-Cloud scope (#266) Jan 28, 2019

README.md

Google Cloud Platform logo

Dialogflow: Node.js Client

release level npm version codecov

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.

Using the client library

  1. Select or create a Cloud Platform project.

  2. Enable billing for your project.

  3. Enable the Dialogflow API.

  4. Set up authentication with a service account so you can access the API from your local workstation.

  5. Install the client library:

     npm install --save dialogflow
    
  6. Try an example:

const dialogflow = require('dialogflow');
const uuid = require('uuid');

/**
 * Send a query to the dialogflow agent, and return the query result.
 * @param {string} projectId The project to be used
 */
async function runSample(projectId = 'your-project-id') {
  // A unique identifier for the given session
  const sessionId = uuid.v4();

  // Create a new session
  const sessionClient = new dialogflow.SessionsClient();
  const sessionPath = sessionClient.sessionPath(projectId, sessionId);

  // The text query request.
  const request = {
    session: sessionPath,
    queryInput: {
      text: {
        // The query to send to the dialogflow agent
        text: 'hello',
        // The language used by the client (en-US)
        languageCode: 'en-US',
      },
    },
  };

  // Send request and log result
  const responses = await sessionClient.detectIntent(request);
  console.log('Detected intent');
  const result = responses[0].queryResult;
  console.log(`  Query: ${result.queryText}`);
  console.log(`  Response: ${result.fulfillmentText}`);
  if (result.intent) {
    console.log(`  Intent: ${result.intent.displayName}`);
  } else {
    console.log(`  No intent matched.`);
  }
}

Samples

Samples are in the samples/ directory. The samples' README.md has instructions for running the samples.

Sample Source Code Try it
Detect Intent (Text) source code Open in Cloud Shell
Create Knowledge Base source code Open in Cloud Shell
Get Knowledge Base source code Open in Cloud Shell
list Knowledge Base source code Open in Cloud Shell
list Knowledge Base source code Open in Cloud Shell
create Document source code Open in Cloud Shell
list Documents source code Open in Cloud Shell
Get Document source code Open in Cloud Shell
delete Document source code Open in Cloud Shell
detect Intent with sentiment analysis source code Open in Cloud Shell
detect Intent with text-to-speech response source code Open in Cloud Shell
detect Intent with Knowledge Base source code Open in Cloud Shell
Detect Intent (Audio) source code Open in Cloud Shell
Detect Intent (Streaming) source code Open in Cloud Shell
Create Entity source code Open in Cloud Shell
Delete Entity source code Open in Cloud Shell
Create Intent source code Open in Cloud Shell
Delete Intent source code Open in Cloud Shell
Create Context source code Open in Cloud Shell
Delete Context source code Open in Cloud Shell
Create Session Entity Type source code Open in Cloud Shell
Delete Session Entity Type source code Open in Cloud Shell

The Dialogflow Node.js Client API Reference documentation also contains samples.

Versioning

This library follows Semantic Versioning.

This library is considered to be in beta. This means it is expected to be mostly stable while we work toward a general availability release; however, complete stability is not guaranteed. We will address issues and requests against beta libraries with a high priority.

More Information: Google Cloud Platform Launch Stages

Contributing

Contributions welcome! See the Contributing Guide.

License

Apache Version 2.0

See LICENSE

What's Next

Read more about the client libraries for Cloud APIs, including the older Google APIs Client Libraries, in Client Libraries Explained.

You can’t perform that action at this time.