qwen_agent/agent
autobee-sparticle 108c675c3d
feat(memory): add memory management API endpoints (#10)
* chore: add .worktrees/ to .gitignore

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* feat(memory): add memory management API endpoints

Add new /api/v1/memory endpoints for viewing and managing user memories:
- GET /api/v1/memory - list all memories for a bot
- DELETE /api/v1/memory/{memory_id} - delete single memory
- DELETE /api/v1/memory - delete all memories for a bot

Also add delete_memory and delete_all_memories methods to Mem0Manager.

Issue: #1844

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: zhuchao <zhuchaowe@163.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-27 18:01:12 +09:00
..
__init__.py 新增agent文件夹,修改import引用,增加custom_mcp_manager 2025-11-26 17:23:02 +08:00
agent_config.py rename general agent 2026-02-06 17:05:17 +08:00
agent_memory_cache.py 修改balance资源配置 2025-12-23 23:11:24 +08:00
chat_history_manager.py db_pool 2026-01-19 23:39:04 +08:00
checkpoint_manager.py db_pool 2026-01-19 23:39:04 +08:00
checkpoint_utils.py refactor: migrate from Memori to Mem0 for long-term memory 2026-01-20 21:15:30 +08:00
config_cache.py 修改general_agent提示词 2025-12-03 17:53:18 +08:00
db_pool_manager.py refactor(mem0): optimize connection pool and async memory handling 2026-01-22 19:39:12 +08:00
deep_assistant.py modify skill middleware 2026-02-10 11:53:14 +08:00
guideline_middleware.py rename general agent 2026-02-06 17:05:17 +08:00
logging_handler.py on_tool_start 长度调整 2026-02-15 18:12:22 +08:00
mem0_config.py patch 2026-01-21 13:23:11 +08:00
mem0_manager.py feat(memory): add memory management API endpoints (#10) 2026-02-27 18:01:12 +09:00
mem0_middleware.py refactor(mem0): optimize connection pool and async memory handling 2026-01-22 19:39:12 +08:00
plugin_hook_loader.py feat: 实现 Claude Plugins 模式的 Hook 机制 2026-02-06 20:15:54 +08:00
prompt_loader.py update dataset_id_str 2026-02-10 22:18:30 +08:00
summarization_middleware.py update summary 2026-02-04 15:31:41 +08:00
tool_output_length_middleware.py add MCP_HTTP_TIMEOUT and try catch 2025-12-23 20:13:46 +08:00
tool_use_cleanup_middleware.py 修复完成。主要改动: 1. 新增 _clean_content_blocks 方法:专门处理 content 字段的清理 - 当 content 是列表格式时,过滤掉 type: 'tool_use' 的块(如果 id 不在 valid_tool_call_ids 中) - 返回清理后的 content 和是否有文本内容的标志 2. 更新 _cleanup_tool_use_messages 方法: - 调用 _clean_content_blocks 来清理 content - 使用清理后的 cleaned_content 创建新的 AIMessage 问题根源:之前的代码只清空了 tool_calls=[],但没有从 content 列表中移除 type: 'tool_use' 的块。Anthropic API 会检查这两个地方,导致报错。 2025-12-23 19:11:27 +08:00