@comate/zulu 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +64 -14
- package/dist/bundle/index.js +8 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
1
|
# Zulu CLI
|
|
2
2
|
|
|
3
3
|
## 环境
|
|
4
|
-
* nodejs >=
|
|
4
|
+
* nodejs >= 18
|
|
5
5
|
* ripgrep >= 12 需要手动安装该库
|
|
6
6
|
|
|
7
7
|
## 安装
|
|
8
|
+
|
|
9
|
+
### 安装 Zulu-CLI
|
|
10
|
+
```shell
|
|
11
|
+
npm install -g @comate/zulu
|
|
12
|
+
```
|
|
13
|
+
|
|
8
14
|
### 安装 ripgrep
|
|
9
15
|
以下是在不同操作系统和包管理器中安装`ripgrep`的常见命令:
|
|
10
16
|
#### MacOS
|
|
11
17
|
```shell
|
|
12
18
|
brew install ripgrep
|
|
13
19
|
```
|
|
14
|
-
####
|
|
15
|
-
|
|
20
|
+
#### Windows
|
|
21
|
+
```shell
|
|
22
|
+
winget install BurntSushi.ripgrep.MSVC
|
|
23
|
+
```
|
|
24
|
+
#### Ubuntu/Debian
|
|
16
25
|
```shell
|
|
17
26
|
sudo apt update
|
|
18
27
|
sudo apt install ripgrep
|
|
19
28
|
```
|
|
20
|
-
|
|
29
|
+
#### CentOS
|
|
21
30
|
```shell
|
|
22
31
|
sudo yum install epel-release
|
|
23
32
|
sudo yum install ripgrep
|
|
24
33
|
```
|
|
25
|
-
|
|
26
|
-
```shell
|
|
27
|
-
winget install BurntSushi.ripgrep.MSVC
|
|
28
|
-
```
|
|
34
|
+
|
|
29
35
|
#### 验证安装
|
|
30
36
|
安装完成后,可以使用以下命令验证:
|
|
31
37
|
```shell
|
|
@@ -33,10 +39,6 @@ rg --version
|
|
|
33
39
|
```
|
|
34
40
|
选择适合你操作系统和包管理器的命令即可。推荐使用系统自带的包管理器,这样更容易管理和更新。
|
|
35
41
|
|
|
36
|
-
### 安装 Zulu-CLI
|
|
37
|
-
```shell
|
|
38
|
-
npm install -g @comate/zulu
|
|
39
|
-
```
|
|
40
42
|
|
|
41
43
|
## 网络
|
|
42
44
|
默认请求`https://comate.baidu.com`,如果环境未知,请执行`zulu --ping`测试连通性,如果不通:
|
|
@@ -58,8 +60,13 @@ zulu run --query="你好" --license=xxxx
|
|
|
58
60
|
| run | 是 | --query | 问题的内容 |
|
|
59
61
|
| run | | --cwd | 工作路径,默认执行时所在地址 |
|
|
60
62
|
| run | | --ripgrep | ripgrep的绝对路径 |
|
|
61
|
-
| run | | --max | max模式的模型id
|
|
62
|
-
| run | | --
|
|
63
|
+
| run | | --max | max模式的模型id。注意,指定模型只能在首轮对话生效,中途无法更换模型|
|
|
64
|
+
| run | | --normal | normal模式的模型id。注意,指定模型只能在首轮对话生效,中途无法更换模型|
|
|
65
|
+
| run | | --conversation | conversation id,如果需要多轮对话,将上一轮对话的id传入此参数,详情见下文 |
|
|
66
|
+
| run | | --delay | 模型调用的延迟时间,单位毫秒 |
|
|
67
|
+
| list | 是 | --license | license的值 |
|
|
68
|
+
| list | | --max | 获取max模式支持的模型信息 |
|
|
69
|
+
| list | | --normal | 获取normal模式支持的模型信息 |
|
|
63
70
|
| | | --ping | 测试网络连通性 |
|
|
64
71
|
| | | --help | 帮助 |
|
|
65
72
|
| | | --version | 版本号 |
|
|
@@ -75,6 +82,49 @@ zulu run --query="你好" --license=xxxx
|
|
|
75
82
|
| HTTP_HOST | string | 设置服务地址,默认是 https://comate.baidu.com |
|
|
76
83
|
| DEBUG | boolean | 打开调试日志 |
|
|
77
84
|
|
|
85
|
+
## 多轮对话 Conversation 使用注意事项
|
|
86
|
+
|
|
87
|
+
1. 以一次普通的生成结果为例,`conversation`的值为`conversationInfo.id`
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"type": "partial-message-data",
|
|
92
|
+
"conversationInfo": {
|
|
93
|
+
"id": "12af9af4-xxxxxx", // 这里就是 conversation id
|
|
94
|
+
"status": "Running",
|
|
95
|
+
"type": "E2EBotConversation",
|
|
96
|
+
"utime": 1755840911964,
|
|
97
|
+
"ctime": 1755840911957
|
|
98
|
+
},
|
|
99
|
+
"messages": [
|
|
100
|
+
{
|
|
101
|
+
"id": "e884b828-xxxxxx",
|
|
102
|
+
"userMessageId": "50039910",
|
|
103
|
+
"role": "assistant",
|
|
104
|
+
"status": "completed",
|
|
105
|
+
"content": {},
|
|
106
|
+
"elements": [
|
|
107
|
+
{
|
|
108
|
+
"id": "1f89ded8-xxxxxxx",
|
|
109
|
+
"type": "TEXT",
|
|
110
|
+
"status": "success",
|
|
111
|
+
"content": "我是Zulu,专注软件工程的智能体,助力实现从需求到代码的全流程开发。请问有什么具体的开发任务需要我协助您完成吗?例如代码开发、问题调试或性能优化等。",
|
|
112
|
+
"composer": {
|
|
113
|
+
"markdown": "",
|
|
114
|
+
"tasks": []
|
|
115
|
+
},
|
|
116
|
+
"isErrorMessage": false
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
2. `conversation`指定的历史轮次必须在本地存在。历史记录在`~/.comate-engine/store`,以`chat_session_`开头,结尾即`conversation`
|
|
125
|
+
|
|
126
|
+
3. 多轮对话中途无法变更模型
|
|
127
|
+
|
|
78
128
|
|
|
79
129
|
## 调试
|
|
80
130
|
* 使用环境变量`DEBUG=true`,`STDOUT`会显示debug级别的日志
|