From 904eee884635fb3f1dd5150d400e8ce711f256e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B7=E9=9B=A8?= Date: Mon, 9 Jun 2025 16:48:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=A2=9E=E5=8A=A0=E6=A8=A1=E5=9E=8B?= =?UTF-8?q?=E6=B4=BB=E8=B7=83=E5=BA=A6=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 2 ++ yj_room_agent/LLM/ai_service.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.env b/.env index cb71cb6..564dba0 100644 --- a/.env +++ b/.env @@ -4,6 +4,8 @@ MODEL_API_KEY=sk-42b5a1479b3b4a1b8176c13c6e2249f0 MODEL_BASE_URL=https://api.deepseek.com #模型名称 MODEL_NAME=deepseek-chat +#模型活跃度 +MODEL_TEMPERATURE=1.0 #放行host地址 DJANGO_ALLOWED_HOSTS=192.168.237.130,127.0.0.1,172.20.10.10 #是否开启debug模式 diff --git a/yj_room_agent/LLM/ai_service.py b/yj_room_agent/LLM/ai_service.py index 7818902..851e518 100644 --- a/yj_room_agent/LLM/ai_service.py +++ b/yj_room_agent/LLM/ai_service.py @@ -431,7 +431,7 @@ def process_chat(user_id: str, user_input: str, params: dict): add_message_async(dialog_manager, user_id, 'user', user_input) resp = call_openai_api(model=MODEL_NAME, system_prompt=prompt, user_query=user_input, api_key=config('MODEL_API_KEY'), - history=history) + history=history,temperature=config("MODEL_TEMPERATURE",cast=float,default=0.5)) print(resp) content = resp["choices"][0]["message"]["content"] reasoning_content = resp["choices"][0]["message"].get('reasoning_content')