增加deepseek缓存处理

main
rogersun 3 days ago
parent 8da98359d5
commit cb0fa7d7e3
  1. 4
      ai/utils/show_prompt.py

@ -251,6 +251,8 @@ class ShowAI:
# self.general_prompt()
# 与AI开始对话
print(f"{self.ai_model_name}开始对话")
ts = str(int(datetime.datetime.timestamp(datetime.datetime.now())))
user_id = f"{self.cinema.zz_code}-{ts}" if get_runtime_val('deepseek_cache') == 0 else self.cinema.zz_code
response = self.client.chat.completions.create(
model=self.ai_model_name,
messages=[
@ -261,7 +263,7 @@ class ShowAI:
stream=False,
reasoning_effort="high",
extra_body={"thinking": {"type": "enabled"},
"user_id": self.cinema.zz_code},
"user_id": user_id},
response_format={
'type': 'json_object'
}

Loading…
Cancel
Save