MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

dialogflow/listTrainingPhrases.js:17–37  ·  view source on GitHub ↗
(projectId, intentId)

Source from the content-addressed store, hash-verified

15'use strict';
16
17async function main(projectId, intentId) {
18 // [START dialogflow_list_training_phrases]
19 const {IntentsClient} = require('@google-cloud/dialogflow');
20
21 // Create the intents client
22 const intentClient = new IntentsClient();
23
24 // Specify working intent
25 const intentName = `projects/${projectId}/agent/intents/${intentId}`;
26
27 // Compose the get-intent request
28 const getIntentRequest = {
29 name: intentName,
30 intentView: 'INTENT_VIEW_FULL',
31 };
32
33 const intent = await intentClient.getIntent(getIntentRequest);
34
35 console.log(intent[0].trainingPhrases);
36 // [END dialogflow_list_training_phrases]
37}
38
39process.on('unhandledRejection', err => {
40 console.error(err.message);

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected