From 839f36d079c008168fbd87da6068f61bbddc6431 Mon Sep 17 00:00:00 2001 From: masong <2416930761@qq.com> Date: Thu, 31 Jul 2025 16:38:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8E=A5=E5=8F=A3=E5=88=86?= =?UTF-8?q?=E4=BA=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbgpt_app/openapi/user_share/api_user_share.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/dbgpt-app/src/dbgpt_app/openapi/user_share/api_user_share.py b/packages/dbgpt-app/src/dbgpt_app/openapi/user_share/api_user_share.py index d2641ad..9895c1c 100644 --- a/packages/dbgpt-app/src/dbgpt_app/openapi/user_share/api_user_share.py +++ b/packages/dbgpt-app/src/dbgpt_app/openapi/user_share/api_user_share.py @@ -56,6 +56,7 @@ def get_chat_flow() -> FlowService: async def chat_app_api(api_key: str, app_code: str, user_input: str, + flow_service: FlowService = Depends(get_chat_flow), ): @@ -66,7 +67,8 @@ async def chat_completions( api_key: str, app_code: str, user_input: str, - flow_service: FlowService = Depends(get_chat_flow), + random: str, + flow_service: FlowService = Depends(get_chat_flow) ): logger.info("外部接口调用") @@ -87,8 +89,9 @@ async def chat_completions( if app_code not in user_share.app_ids: return Result.failed(msg="无此应用编码,请与管理员联系") # 根据app_code 查看详细信息 - - conv_uid = user_share.id + if(random is None): + random = uuid.uuid1() + conv_uid = random team_context = "" gpt_app_detail = gpts_dao.app_detail(app_code) gpt_app = gpts_dao.get_app_by_code(app_code) @@ -100,7 +103,7 @@ async def chat_completions( llm_strategy = ""; if gpt_app_detail.details[0].llm_strategy == 'priority': #查询llm model - llm_strategy = json.loads(gpt_app_detail.details[0].llm_strategy_value[0]) + llm_strategy = gpt_app_detail.details[0].llm_strategy_value[0] else: # 查询model