提示词添加车辆预先提取和手机号多次拼接输入
This commit is contained in:
56
docs/chat-stream-mode.md
Normal file
56
docs/chat-stream-mode.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# /chat 流式响应模式说明
|
||||
|
||||
## 接口地址
|
||||
|
||||
```
|
||||
POST http://localhost:8000/chat?stream=true
|
||||
```
|
||||
|
||||
## 请求参数
|
||||
|
||||
| 参数 | 类型 | 必填 | 说明 |
|
||||
|------|------|------|------|
|
||||
| sessionId | string | 是 | 会话 ID |
|
||||
| timeStamp | string | 是 | 时间戳 |
|
||||
| text | string | 是 | 用户输入文本 |
|
||||
| stream | bool | 否 | 设为 true 启用流式响应 |
|
||||
|
||||
## SSE 事件类型
|
||||
|
||||
| 事件类型 | 说明 | 数据格式 |
|
||||
|----------|------|----------|
|
||||
| `stage_code` | 阶段状态码 | `{"nextStageCode": "0000", "nextStage": "结束通话"}` |
|
||||
| `text_delta` | 流式文本片段 | `{"text": "您好..."}` |
|
||||
| `done` | 流式结束 | `{"status": "completed"}` |
|
||||
| `error` | 错误信息 | `{"msg": "错误描述", "code": "500"}` |
|
||||
|
||||
## 状态码映射
|
||||
|
||||
| 状态码 | 含义 |
|
||||
|--------|------|
|
||||
| 0000 | 结束通话 |
|
||||
| 0001 | 转接人工 |
|
||||
| 0002 | 语义无法识别转接人工 |
|
||||
| 0003 | 有人伤转接人工 |
|
||||
| 1001 | 未准备好通话 |
|
||||
| 1002 | 通话中 |
|
||||
| 2000 | 进入单车拍照 |
|
||||
| ... | ... |
|
||||
|
||||
## 示例
|
||||
|
||||
### 请求
|
||||
|
||||
```bash
|
||||
python examples/stream_chat.py session-001 "发生了交通事故"
|
||||
```
|
||||
|
||||
### 响应
|
||||
|
||||
```
|
||||
Status: 200
|
||||
--------------------------------------------------
|
||||
[stage_code] {"nextStageCode": "1002", "nextStage": "通话中"}
|
||||
[text_delta] {"text": "您好,请问发生了什么情况?"}
|
||||
[done] {"status": "completed"}
|
||||
```
|
||||
@@ -1,6 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Simple CLI script to interact with /chat endpoint in stream mode.
|
||||
Stream Chat CLI - 与 /chat 端点进行流式交互的脚本。
|
||||
|
||||
用法:
|
||||
python stream_chat.py <session_id> <消息>
|
||||
|
||||
示例:
|
||||
python stream_chat.py test-001 "发生了交通事故"
|
||||
|
||||
输出说明:
|
||||
- [stage_code]: 阶段状态码,如 {"nextStageCode": "0000", "nextStage": "结束通话"}
|
||||
- [text_delta]: 流式文本片段
|
||||
- [done]: 流式结束
|
||||
- [error]: 错误信息
|
||||
"""
|
||||
|
||||
import asyncio
|
||||
|
||||
4710
workflow/20251108/事故信息采集20251108.json
Normal file
4710
workflow/20251108/事故信息采集20251108.json
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user