Commit Graph

13 Commits

Author SHA1 Message Date
Windpicker-owo
b08c70dfa6 feat: 添加插件配置支持,优化适配器和组件初始化 2025-11-22 13:24:09 +08:00
minecraft1024a
f91acbb202 fix(plugin_system): 修复两步工具定义中的类型注解错误
将 `definitions` 的类型注解从 `ClassVar` 移除,因为它是一个在方法内部构建并返回的局部变量,而不是一个类变量。这修正了潜在的类型检查错误,并使代码意图更加清晰。
2025-11-01 19:36:20 +08:00
明天好像没什么
0e129d385e refactor: 统一类型注解风格并优化代码结构
- 将裸 except 改为显式 Exception 捕获
- 用列表推导式替换冗余 for 循环
- 为类属性添加 ClassVar 注解
- 统一 Union/Optional 写法为 |
- 移除未使用的导入
- 修复 SQLAlchemy 空值比较语法
- 优化字符串拼接与字典更新逻辑
- 补充缺失的 noqa 注释与异常链

BREAKING CHANGE: 所有插件基类的类级字段现要求显式 ClassVar 注解,自定义插件需同步更新
2025-10-31 22:42:39 +08:00
Windpicker-owo
ea7c1f22f9 feat(relationship): 重构关系信息提取系统并集成聊天流印象
- 在 RelationshipFetcher 中添加 build_chat_stream_impression 方法,支持聊天流印象信息构建
- 扩展数据库模型,为 ChatStreams 表添加聊天流印象相关字段(stream_impression_text、stream_chat_style、stream_topic_keywords、stream_interest_score)
- 为 UserRelationships 表添加用户别名和偏好关键词字段(user_aliases、preference_keywords)
- 在 DefaultReplyer、Prompt 和 S4U PromptBuilder 中集成用户关系信息和聊天流印象的组合输出
- 重构工具系统,为 BaseTool 添加 chat_stream 参数支持上下文感知
- 移除旧的 ChatterRelationshipTracker 及相关关系追踪逻辑,统一使用评分API
- 在 AffinityChatterPlugin 中添加 UserProfileTool 和 ChatStreamImpressionTool 支持
- 优化计划执行器,移除关系追踪相关代码并改进错误处理

BREAKING CHANGE: 移除了 ChatterRelationshipTracker 类及相关的关系追踪功能,现在统一使用 scoring_api 进行关系管理。BaseTool 构造函数现在需要 chat_stream 参数。
2025-10-30 16:58:26 +08:00
John Richard
7923eafef3 re-style: 格式化代码 2025-10-02 20:26:01 +08:00
John Richard
ecb02cae31 style: 格式化代码 2025-10-02 19:38:39 +08:00
雅诺狐
7d3f418768 二步工具与action 2025-09-30 22:40:10 +08:00
minecraft1024a
af17290595 feat(tool_system): implement declarative caching for tools
This commit refactors the tool caching system to be more robust, configurable, and easier to use. The caching logic is centralized within the `wrap_tool_executor`, removing the need for boilerplate code within individual tool implementations.

Key changes:
- Adds `enable_cache`, `cache_ttl`, and `semantic_cache_query_key` attributes to `BaseTool` for declarative cache configuration.
- Moves caching logic from a simple history-based lookup and individual tools into a unified handling process in `wrap_tool_executor`.
- The new system leverages the central `tool_cache` manager for both exact and semantic caching based on tool configuration.
- Refactors `WebSurfingTool` and `URLParserTool` to utilize the new declarative caching mechanism, simplifying their code.
2025-08-27 18:45:59 +08:00
minecraft1024a
5076410a00 Reapply "【迁移】工具系统再完善:工具缓存、ttl支持、自动记录、长期保存、自动清理缓存、将记录与执行分离、api记录查询、时间聊天工具筛选查询..."
This reverts commit 3d93bc4079.
2025-08-27 17:58:18 +08:00
Windpicker-owo
3d93bc4079 Revert "【迁移】工具系统再完善:工具缓存、ttl支持、自动记录、长期保存、自动清理缓存、将记录与执行分离、api记录查询、时间聊天工具筛选查询..."
This reverts commit 80ab0c687c.
2025-08-27 12:46:00 +08:00
Windpicker-owo
80ab0c687c 【迁移】工具系统再完善:工具缓存、ttl支持、自动记录、长期保存、自动清理缓存、将记录与执行分离、api记录查询、时间聊天工具筛选查询... 2025-08-27 11:04:20 +08:00
Windpicker-owo
cbf9a21c1f event重构暂时完成,待测试 2025-08-25 17:46:23 +08:00
雅诺狐
2d4745cd58 初始化 2025-08-11 19:34:18 +08:00