| 33 | const client = new IntentsClient(); |
| 34 | |
| 35 | async function listIntents() { |
| 36 | const parent = client.agentPath(projectId, location, agentId); |
| 37 | console.info(parent); |
| 38 | |
| 39 | const [intents] = await client.listIntents({ |
| 40 | parent, |
| 41 | pageSize: 100, |
| 42 | }); |
| 43 | intents.forEach(intent => { |
| 44 | console.log('===================='); |
| 45 | console.log(`Intent name: ${intent.name}`); |
| 46 | console.log(`Intent display name: ${intent.displayName}`); |
| 47 | console.log(`# Parameters: ${intent.parameters.length}`); |
| 48 | console.log(`# Training Phrases: ${intent.trainingPhrases.length}`); |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | listIntents(); |
| 53 | // [END dialogflow_cx_list_intents] |