yiyan-browser-agent 1.5.0 → 1.5.1

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.
Files changed (2) hide show
  1. package/README.md +39 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -190,6 +190,13 @@ yiyan-agent "北京天气,15个字"
190
190
  }
191
191
  ```
192
192
 
193
+ **`newChat` 参数说明:**
194
+
195
+ | 值 | 行为 | 适用场景 |
196
+ |---|---|---|
197
+ | `true` (默认) | 点击"新对话"按钮,开启全新对话,AI 无历史记忆 | 新任务、独立问题 |
198
+ | `false` | 在当前对话中继续,AI 会记住之前的内容 | 多轮对话、上下文关联任务 |
199
+
193
200
  **Response:**
194
201
  ```json
195
202
  {
@@ -200,6 +207,38 @@ yiyan-agent "北京天气,15个字"
200
207
  }
201
208
  ```
202
209
 
210
+ ### newChat 参数使用案例
211
+
212
+ 验证 `newChat` 参数的效果(连续对话 vs 新对话):
213
+
214
+ **Windows CMD:**
215
+ ```cmd
216
+ # 第一次请求 - 告诉AI你的名字
217
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d "{\"task\":\"我叫小明\"}"
218
+
219
+ # 第二次请求 - newChat=false,AI应记得你叫小明
220
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d "{\"task\":\"我叫什么名字\",\"newChat\":false}"
221
+
222
+ # 第三次请求 - newChat=true,AI应不记得你叫小明(新对话)
223
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d "{\"task\":\"我叫什么名字\",\"newChat\":true}"
224
+ ```
225
+
226
+ **Ubuntu / Linux:**
227
+ ```bash
228
+ # 第一次请求 - 告诉AI你的名字
229
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d '{"task":"我叫小明"}'
230
+
231
+ # 第二次请求 - newChat=false,AI应记得你叫小明
232
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d '{"task":"我叫什么名字","newChat":false}'
233
+
234
+ # 第三次请求 - newChat=true,AI应不记得你叫小明(新对话)
235
+ curl -X POST http://localhost:9527/task -H "Content-Type: application/json" -d '{"task":"我叫什么名字","newChat":true}'
236
+ ```
237
+
238
+ **预期结果:**
239
+ - 第二次请求 (`newChat=false`):AI 回答"小明"
240
+ - 第三次请求 (`newChat=true`):AI 回答"不知道"或"你没有告诉我"
241
+
203
242
  ### Windows CMD (curl)
204
243
 
205
244
  ```cmd
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yiyan-browser-agent",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "AI coding agent powered by Yiyan (文心一言) via browser automation — no API key needed",
5
5
  "main": "src/index.js",
6
6
  "bin": {