feat:增加模型活跃度变量
This commit is contained in:
2
.env
2
.env
@@ -4,6 +4,8 @@ MODEL_API_KEY=sk-42b5a1479b3b4a1b8176c13c6e2249f0
|
|||||||
MODEL_BASE_URL=https://api.deepseek.com
|
MODEL_BASE_URL=https://api.deepseek.com
|
||||||
#模型名称
|
#模型名称
|
||||||
MODEL_NAME=deepseek-chat
|
MODEL_NAME=deepseek-chat
|
||||||
|
#模型活跃度
|
||||||
|
MODEL_TEMPERATURE=1.0
|
||||||
#放行host地址
|
#放行host地址
|
||||||
DJANGO_ALLOWED_HOSTS=192.168.237.130,127.0.0.1,172.20.10.10
|
DJANGO_ALLOWED_HOSTS=192.168.237.130,127.0.0.1,172.20.10.10
|
||||||
#是否开启debug模式
|
#是否开启debug模式
|
||||||
|
|||||||
@@ -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)
|
add_message_async(dialog_manager, user_id, 'user', user_input)
|
||||||
resp = call_openai_api(model=MODEL_NAME, system_prompt=prompt, user_query=user_input,
|
resp = call_openai_api(model=MODEL_NAME, system_prompt=prompt, user_query=user_input,
|
||||||
api_key=config('MODEL_API_KEY'),
|
api_key=config('MODEL_API_KEY'),
|
||||||
history=history)
|
history=history,temperature=config("MODEL_TEMPERATURE",cast=float,default=0.5))
|
||||||
print(resp)
|
print(resp)
|
||||||
content = resp["choices"][0]["message"]["content"]
|
content = resp["choices"][0]["message"]["content"]
|
||||||
reasoning_content = resp["choices"][0]["message"].get('reasoning_content')
|
reasoning_content = resp["choices"][0]["message"].get('reasoning_content')
|
||||||
|
|||||||
Reference in New Issue
Block a user