asemxin commited on
Commit ·
d11c1b1
1
Parent(s): c45a150
feat: 历史轮数30轮,搜索最多30次
Browse files- image_daemon.py +2 -2
image_daemon.py
CHANGED
|
@@ -23,7 +23,7 @@ _soul_prompt = "" # SOUL.md 内容
|
|
| 23 |
|
| 24 |
# 对话历史 (per chat_id)
|
| 25 |
_chat_history = {} # {chat_id: [{role, content}, ...]}
|
| 26 |
-
MAX_HISTORY =
|
| 27 |
|
| 28 |
# 待处理图片 (per chat_id) —— 用户发图后先问需求再分析
|
| 29 |
_pending_images = {} # {chat_id: base64_string}
|
|
@@ -393,7 +393,7 @@ def chat_with_llm(user_text, history=None):
|
|
| 393 |
messages = [{"role": "system", "content": dated_soul}] + (history or []) + [{"role": "user", "content": user_text}]
|
| 394 |
|
| 395 |
|
| 396 |
-
for _ in range(
|
| 397 |
log(f"🤖 外部 LLM ({MODEL_NAME}): {user_text[:50]}...")
|
| 398 |
payload = {
|
| 399 |
"model": MODEL_NAME,
|
|
|
|
| 23 |
|
| 24 |
# 对话历史 (per chat_id)
|
| 25 |
_chat_history = {} # {chat_id: [{role, content}, ...]}
|
| 26 |
+
MAX_HISTORY = 30 # 保留最近 N 轮
|
| 27 |
|
| 28 |
# 待处理图片 (per chat_id) —— 用户发图后先问需求再分析
|
| 29 |
_pending_images = {} # {chat_id: base64_string}
|
|
|
|
| 393 |
messages = [{"role": "system", "content": dated_soul}] + (history or []) + [{"role": "user", "content": user_text}]
|
| 394 |
|
| 395 |
|
| 396 |
+
for _ in range(31): # 最多 30 次工具调用 + 1 次最终回复
|
| 397 |
log(f"🤖 外部 LLM ({MODEL_NAME}): {user_text[:50]}...")
|
| 398 |
payload = {
|
| 399 |
"model": MODEL_NAME,
|