Skip to content

Commit 9b6fbd8

Browse files
Simplify
1 parent 3d57c5c commit 9b6fbd8

5 files changed

Lines changed: 641 additions & 30 deletions

File tree

go/samples/chat.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package main
33
import (
44
"bufio"
55
"context"
6-
"encoding/json"
76
"fmt"
87
"os"
98
"strings"
@@ -37,8 +36,7 @@ func main() {
3736
}
3837
case copilot.ToolExecutionStart:
3938
if event.Data.ToolName != nil {
40-
args, _ := json.Marshal(event.Data.Arguments)
41-
output = fmt.Sprintf("[tool: %s %s]", *event.Data.ToolName, args)
39+
output = fmt.Sprintf("[tool: %s]", *event.Data.ToolName)
4240
}
4341
}
4442
if output != "" {

nodejs/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ npm install @github/copilot-sdk
1515
Try the interactive chat sample (from the repo root):
1616

1717
```bash
18-
cd nodejs/samples
18+
cd nodejs
19+
npm ci
20+
npm run build
21+
cd samples
1922
npm install
2023
npm start
2124
```

nodejs/samples/chat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ async function main() {
1010
if (event.type === "assistant.reasoning") {
1111
output = `[reasoning: ${event.data.content}]`;
1212
} else if (event.type === "tool.execution_start") {
13-
output = `[tool: ${event.data.toolName} ${JSON.stringify(event.data.arguments)}]`;
13+
output = `[tool: ${event.data.toolName}]`;
1414
}
1515
if (output) console.log(`\x1b[34m${output}\x1b[0m`);
1616
});

0 commit comments

Comments
 (0)