myagent-ai 1.19.7 → 1.19.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/agents/main_agent.py +6 -6
- package/package.json +1 -1
package/agents/main_agent.py
CHANGED
|
@@ -1348,8 +1348,8 @@ class MainAgent(BaseAgent):
|
|
|
1348
1348
|
"v2_tool_result",
|
|
1349
1349
|
{"tool": {"toolname": tool_name}, "result": {
|
|
1350
1350
|
"success": tool_result.get("success", False),
|
|
1351
|
-
"output": truncate_str(tool_output_text,
|
|
1352
|
-
"error": truncate_str(tool_result.get("error", ""),
|
|
1351
|
+
"output": truncate_str(tool_output_text, 30000),
|
|
1352
|
+
"error": truncate_str(tool_result.get("error", ""), 30000),
|
|
1353
1353
|
"timed_out": tool_result.get("timed_out", False),
|
|
1354
1354
|
}},
|
|
1355
1355
|
stream_callback,
|
|
@@ -1359,7 +1359,7 @@ class MainAgent(BaseAgent):
|
|
|
1359
1359
|
"title": f"工具结果: {tool_name}",
|
|
1360
1360
|
"tool_name": tool_name,
|
|
1361
1361
|
"success": tool_result.get("success", False),
|
|
1362
|
-
"summary": truncate_str(tool_output_text,
|
|
1362
|
+
"summary": truncate_str(tool_output_text, 30000),
|
|
1363
1363
|
"result": tool_result,
|
|
1364
1364
|
})
|
|
1365
1365
|
|
|
@@ -1373,9 +1373,9 @@ class MainAgent(BaseAgent):
|
|
|
1373
1373
|
_HEAVY_TOOLS = ("web_search", "web_read", "url_read", "file_list",
|
|
1374
1374
|
"file_search", "browser_open", "process_list")
|
|
1375
1375
|
if tool_name in _HEAVY_TOOLS:
|
|
1376
|
-
_max_output =
|
|
1376
|
+
_max_output = 50000
|
|
1377
1377
|
else:
|
|
1378
|
-
_max_output =
|
|
1378
|
+
_max_output = 30000
|
|
1379
1379
|
# 超时工具明确标注状态,让 LLM 清楚知道哪个工具超时了
|
|
1380
1380
|
_status = "超时" if is_timeout else ('成功' if tool_result.get('success') else '失败')
|
|
1381
1381
|
tool_outputs_parts.append(
|
|
@@ -1410,7 +1410,7 @@ class MainAgent(BaseAgent):
|
|
|
1410
1410
|
self.memory.add_session(
|
|
1411
1411
|
session_id=context.session_id,
|
|
1412
1412
|
role="tool",
|
|
1413
|
-
content=f"[{tool_name}] {_status}\n{truncate_str(output_str,
|
|
1413
|
+
content=f"[{tool_name}] {_status}\n{truncate_str(output_str, 10000)}",
|
|
1414
1414
|
key="tool_result",
|
|
1415
1415
|
importance=0.4,
|
|
1416
1416
|
)
|