Skip to content

Commit 7eb87bb

Browse files
Better usage
1 parent 1f34b32 commit 7eb87bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

nodejs/examples/basic-example.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,13 @@ session.on((event) => {
3232

3333
// Send a simple message
3434
console.log("💬 Sending message...");
35-
await session.sendAndWait({ prompt: "Tell me 2+2" });
35+
const result1 = await session.sendAndWait({ prompt: "Tell me 2+2" });
36+
console.log("📝 Response:", result1?.data.content);
3637

3738
// Send another message that uses the tool
3839
console.log("💬 Sending follow-up message...");
39-
await session.sendAndWait({ prompt: "Now use lookup_fact to tell me something about Node.js." });
40+
const result2 = await session.sendAndWait({ prompt: "Use lookup_fact to tell me about 'node'" });
41+
console.log("📝 Response:", result2?.data.content);
4042

4143
// Clean up
4244
await session.destroy();

0 commit comments

Comments
 (0)