Skip to content

Commit d306123

Browse files
committed
sdk readme: Add handleEvent in the first run example
1 parent ace76c3 commit d306123

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdk/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ async function main() {
3131
const run1 = await client.run({
3232
agent: 'base',
3333
prompt: 'Create a simple calculator class',
34+
handleEvent: (event) => {
35+
console.log(event) // Log all events
36+
},
3437
})
3538

3639
// Continue the same session with a follow-up
@@ -39,8 +42,7 @@ async function main() {
3942
prompt: 'Add unit tests for the calculator',
4043
previousRun: run1,
4144
handleEvent: (event) => {
42-
// Log all events
43-
console.log('Progress:', event)
45+
console.log(event) // Log all events
4446
},
4547
})
4648

0 commit comments

Comments
 (0)