From 398a7440405f52c8606f272b27f01c1bb12361a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E5=8D=9A?= <1016318004@qq.com> Date: Mon, 10 Feb 2025 21:19:55 +0800 Subject: [PATCH] revert --- apps/entities/request_data.py | 2 +- apps/routers/chat.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/entities/request_data.py b/apps/entities/request_data.py index 708999ba..b70ff1e4 100644 --- a/apps/entities/request_data.py +++ b/apps/entities/request_data.py @@ -26,7 +26,7 @@ class RequestData(BaseModel): group_id: Optional[str] = Field(default=None, alias="groupId", description="群组ID") language: str = Field(default="zh", description="语言") files: list[str] = Field(default=[], description="文件列表") - app: RequestDataApp = Field(default=[], description="应用列表") + app: list[RequestDataApp] = Field(default=[], description="应用列表") features: RequestDataFeatures = Field(description="消息功能设置") diff --git a/apps/routers/chat.py b/apps/routers/chat.py index 1216f639..7d06a604 100644 --- a/apps/routers/chat.py +++ b/apps/routers/chat.py @@ -130,8 +130,8 @@ async def chat( if await Activity.is_active(user_sub): raise HTTPException(status_code=status.HTTP_429_TOO_MANY_REQUESTS, detail="Too many requests") - if post_body.app and post_body.app.app_id: - await AppCenterManager.update_recent_app(user_sub, post_body.app.app_id) + if post_body.app and post_body.app[0].app_id: + await AppCenterManager.update_recent_app(user_sub, post_body.app[0].app_id) res = chat_generator(post_body, user_sub, session_id) return StreamingResponse( content=res, -- Gitee