-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Hu <[email protected]>
- Loading branch information
1 parent
5c4f631
commit fd01f19
Showing
8 changed files
with
479 additions
and
378 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
[TOC] | ||
|
||
## Chat Message | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "sendMessage/request", | ||
"metadata": { | ||
"callback": "responseFunctionName", | ||
"parent": "b67937dd845afdf59dec505efafd2d18854cb2b147ae0cecd7f266d856373137" | ||
}, | ||
"payload": { | ||
"context": [ | ||
{ | ||
"languageId": "python", | ||
"path": "xxx/a.py", | ||
"startLine": 1, | ||
"content": "adkfjj\n" | ||
}, | ||
{ | ||
"command": "ls -l", | ||
"content": "adkfjj\n" | ||
} | ||
], | ||
"message": "Hello" | ||
} | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
- success | ||
|
||
**round 1** | ||
|
||
```json | ||
{ | ||
"action": "sendMessage/response", | ||
"metadata": { | ||
"currentChunkId": 1, | ||
"isFinalChunk": false, | ||
"finishReason": "", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"message": "Hello!", | ||
"user": "Daniel Hu <[email protected]>", | ||
"date": "Wed Oct 18 09:02:42 2023 +0800", | ||
"promptHash": "" | ||
} | ||
} | ||
``` | ||
|
||
**round 2** | ||
|
||
```json | ||
{ | ||
"action": "sendMessage/response", | ||
"metadata": { | ||
"currentChunkId": 2, | ||
"isFinalChunk": false, | ||
"finishReason": "", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"message": "Hello!\nHow can I assist you?", | ||
"user": "Daniel Hu <[email protected]>", | ||
"date": "Wed Oct 18 09:02:42 2023 +0800", | ||
"promptHash": "" | ||
} | ||
} | ||
``` | ||
|
||
**round 3** | ||
|
||
```json | ||
{ | ||
"action": "sendMessage/response", | ||
"metadata": { | ||
"currentChunkId": 3, | ||
"isFinalChunk": true, | ||
"finishReason": "success", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"message": "Hello!\nHow can I assist you?", | ||
"user": "Daniel Hu <[email protected]>", | ||
"date": "Wed Oct 18 09:02:42 2023 +0800", | ||
"promptHash": "b67937dd845afdf59dec505efafd2d18854cb2b147ae0cecd7f266d856373137" | ||
} | ||
} | ||
``` | ||
|
||
- failed | ||
|
||
```json | ||
{ | ||
"action": "sendMessage/response", | ||
"metadata": { | ||
"currentChunkId": 0, | ||
"isFinalChunk": true, | ||
"finishReason": "error", | ||
"error": "Network error." | ||
}, | ||
"payload": null | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
## Insert Code | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "insertCode/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": { | ||
"content": "adkfjj\n" | ||
} | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
```json | ||
{ | ||
"action": "insertCode/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": null | ||
} | ||
``` | ||
|
||
## Replace All Content | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "replaceFileContent/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": { | ||
"content": "adkfjj\n" | ||
} | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
```json | ||
{ | ||
"action": "replaceFileContent/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": null | ||
} | ||
``` | ||
|
||
## View Diff | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "viewDiff/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": { | ||
"content": "package ai.devchat" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## Query Command List | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "listCommands/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": null | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
```json | ||
{ | ||
"action": "listCommands/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"commands": [ | ||
{ | ||
"name": "code", | ||
"description": "Generate code with a general template embedded into the prompt." | ||
}, | ||
{ | ||
"name": "release_note", | ||
"description": "Generate a release note for the given commit log." | ||
} | ||
] | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
## Add Context(Add to DevChat) | ||
|
||
### Java to JS (notify) | ||
|
||
```json | ||
{ | ||
"action": "addContext/notify", | ||
"metadata": null, | ||
"payload": { | ||
"path": "src/main/Hello.java", | ||
"startLine": 1, | ||
"languageId": "Java", | ||
"content": "public static void main(..." | ||
} | ||
} | ||
``` | ||
|
||
## List Contexts | ||
|
||
### JS to Java (command) | ||
|
||
```json | ||
{ | ||
"action": "listContexts/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": null | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
```json | ||
{ | ||
"action": "listContexts/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"contexts": [ | ||
{ | ||
"command": "git diff -cached", | ||
"description": "xxx." | ||
}, | ||
{ | ||
"command": "git diff HEAD", | ||
"description": "xxx." | ||
} | ||
] | ||
} | ||
} | ||
``` | ||
|
||
## Get Context with Command | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "addContext/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": { | ||
"command": "git diff --cached" | ||
} | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
```json | ||
{ | ||
"action": "addContext/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": { | ||
"command": "git diff --cached", | ||
"content": "xxx" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## Set or Update key | ||
|
||
### JS to Java | ||
|
||
```json | ||
{ | ||
"action": "setOrUpdateKey/request", | ||
"metadata": { | ||
"callback": "responseFunctionName" | ||
}, | ||
"payload": { | ||
"key": "DC.abcdef123456" | ||
} | ||
} | ||
``` | ||
|
||
### Java to JS | ||
|
||
- success | ||
|
||
```json | ||
{ | ||
"action": "setOrUpdateKey/response", | ||
"metadata": { | ||
"status": "success", | ||
"error": "" | ||
}, | ||
"payload": null | ||
} | ||
``` | ||
|
||
- failed | ||
|
||
```json | ||
{ | ||
"action": "setOrUpdateKey/response", | ||
"metadata": { | ||
"status": "Failed", | ||
"error": "Failed to set key." | ||
}, | ||
"payload": null | ||
} | ||
``` |
Oops, something went wrong.