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')