From a5d1233b969f66219cf183ec43349089169f1f88 Mon Sep 17 00:00:00 2001 From: dragon8git <928532756@qq.com> Date: Sat, 31 Jan 2026 18:13:40 +0800 Subject: [PATCH] =?UTF-8?q?Update=20session.md=20|=20=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 停止会话 --- docs/api/session.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/api/session.md b/docs/api/session.md index 489ac7f7..11961136 100644 --- a/docs/api/session.md +++ b/docs/api/session.md @@ -10,8 +10,10 @@ | PUT | `/sessions/:id` | 更新会话 | | DELETE | `/sessions/:id` | 删除会话 | | POST | `/sessions/:session_id/generate_title` | 生成会话标题 | +| POST | `/sessions/:session_id/stop` | 停止会话 | | GET | `/sessions/continue-stream/:session_id` | 继续未完成的会话 | + ## POST `/sessions` - 创建会话 **请求**: @@ -344,6 +346,26 @@ curl --location 'http://localhost:8080/api/v1/sessions/ceb9babb-1e30-41d7-817d-f } ``` +## POST `/sessions/:session_id/stop` - 停止会话 + +**请求**: + +```curl +curl --location 'http://localhost:8080/api/v1/sessions/7c966c74-610e-4516-8d5b-05e14b2e4ee0/stop' \ +--header 'X-API-Key: sk-An-W8T4tdZDbWKJgfwgdea5rS8ue_mRhCTZ8Smhnvku-bWEE' \ +--header 'Content-Type: application/json' \ +--data '{"message_id":"ebbf7e53-dfe6-44d5-882f-36a4104910b5"}' +``` + +**响应**: + +```json +{ + "message": "Session stopped successfully", + "success": true +} +``` + ## GET `/sessions/continue-stream/:session_id` - 继续未完成的会话 **查询参数**: