Skip to content

Commit 8a1d3c7

Browse files
authored
Merge pull request #12 from copilot-extensions/update-readme
Update readme for stream command
2 parents 68f90ea + db2ba75 commit 8a1d3c7

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

README.md

+24-7
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ The different SSE events in the [agent protocol](TODO) that the CLI gives debug
2121
```
2222
1. See more info about the cli tool
2323
```shell
24-
gh debug-cli -h
24+
gh debug-cli chat -h
2525
```
2626

27-
## Using the debug tool
28-
1. Run the following command `gh debug-cli -h` to see the different flags that it takes in.
27+
## Using the debug chat tool
28+
1. Run the following command `gh debug-cli chat -h` to see the different flags that it takes in.
2929
```
30-
> gh debug-cli -h
30+
> gh debug-cli chat -h
3131
This cli tool allows you to debug your agent by chatting with it locally.
3232
3333
Usage:
@@ -47,15 +47,15 @@ export URL="http://localhost:8080/agent/blackbeard"
4747
```
4848
3. When you run the CLI, you will see any flags that were previously set in your environment variables as the output.
4949
```
50-
> gh debug-cli
50+
> gh debug-cli chat
5151
Setting url to http://localhost:8080/agents/blackbeard
5252
5353
Start typing to chat with your assistant...
5454
sparklyunicorn:
5555
```
5656
4. Type something to simulate chatting with your assistant.
5757
```
58-
> gh debug-cli
58+
> gh debug-cli chat
5959
Setting url to http://localhost:8080/agents/blackbeard
6060
6161
Start typing to chat with your assistant...
@@ -114,7 +114,7 @@ assistant: Avast, @monalisa! Me apologies if I didn't quite understand yer reque
114114
```
115115
7. And if debug mode was set to false, then I would only see the confirmation prompt itself.
116116
```
117-
gh debug-cli --log-level none
117+
gh debug-cli chat --log-level none
118118
Setting url to http://localhost:8080/agents/blackbeard
119119
120120
Start typing to chat with your assistant...
@@ -127,6 +127,23 @@ Reply: [y/N]
127127
```
128128
8. Currently, the supported event types for debug mode are references, errors, and confirmations! Have fun chatting with your assistant!
129129

130+
## Using the gh debug stream tool
131+
1. To quickly parse an agent response by running command `gh debug-cli stream --file test.txt`
132+
133+
2. This tool will take llm streaming response and parse it to make it more readable
134+
135+
- In this example, if a file test.txt holds the following streamed response. Then will return the response "A closure in JavaScript is a function that retains access... " This will make repsonse more readable.
136+
137+
example of .txt file
138+
139+
```
140+
data: {"choices":[{"delta":{"content":"A closure in JavaScript "}}],"created":1727120830,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
141+
data: {"choices":[{"delta":{"content":"is a function that retains access "}}],"created":1727120831,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
142+
data: {"choices":[{"delta":{"content":"to its lexical scope, even "}}],"created":1727120832,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
143+
data: {"choices":[{"delta":{"content":"when the function is executed "}}],"created":1727120833,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
144+
data: {"choices":[{"delta":{"content":"outside that scope. "}}],"created":1727120834,"id":"chatcmpl-AAjJW0Nz9E2Gu1P6YQMFqqmn10mdR","model":"gpt-4o-2024-05-13","system_fingerprint":"fp_80a1bad4c7"}
145+
```
146+
130147
## Copilot Extensions Documentation
131148
- [Using Copilot Extensions](https://docs.github.com/en/copilot/using-github-copilot/using-extensions-to-integrate-external-tools-with-copilot-chat)
132149
- [About building Copilot Extensions](https://docs.github.com/en/copilot/building-copilot-extensions/about-building-copilot-extensions)

0 commit comments

Comments
 (0)