From 411c515a13035ab995eebaae428f16de296149b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=B1=E6=BD=AE?= Date: Sun, 22 Feb 2026 21:34:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E5=BC=80=E7=9A=84=E6=99=BA=E8=83=BD?= =?UTF-8?q?=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routes/bot_manager.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/routes/bot_manager.py b/routes/bot_manager.py index 40b4b94..82b1af9 100644 --- a/routes/bot_manager.py +++ b/routes/bot_manager.py @@ -456,6 +456,7 @@ class ModelInfo(BaseModel): class BotSettingsResponse(BaseModel): """Bot 设置响应""" bot_id: str + name: str # bot 名称 model_id: Optional[str] model: Optional[ModelInfo] # 关联的模型信息 language: str @@ -1615,7 +1616,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header( async with pool.connection() as conn: async with conn.cursor() as cursor: await cursor.execute(""" - SELECT id, settings, updated_at, is_published, copied_from + SELECT id, name, settings, updated_at, is_published, copied_from FROM agent_bots WHERE id = %s """, (bot_uuid,)) @@ -1624,7 +1625,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header( if not row: raise HTTPException(status_code=404, detail="Bot not found") - bot_id, settings_json, updated_at, is_published, copied_from = row + bot_id, bot_name, settings_json, updated_at, is_published, copied_from = row settings = settings_json if settings_json else {} # 获取关联的模型信息 @@ -1655,6 +1656,7 @@ async def get_bot_settings(bot_uuid: str, authorization: Optional[str] = Header( return BotSettingsResponse( bot_id=str(bot_id), + name=bot_name, model_id=model_id, model=model_info, language=settings.get('language', 'zh'),