File size: 455 Bytes
d58e081
87996a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import { Botcierge } from "../src/index.ts";

const client = new Botcierge();

const utterances = [
  "I'm hungry",
  "I want to remember something",
  "I want to buy a package",
  "Create a flow plan for tomorrow",
];

const results = await Promise.all(utterances.map(u => client.query_intent(u)));

results.forEach((r, i) => {
  console.log(`"${utterances[i]}"`);
  console.log(`  → ${r.domain} / ${r.intent} [${r.confidence}]`);
  console.log();
});