Commit Graph

27 Commits

Author SHA1 Message Date
Rumio
c9f0a8b9d9
♻️ refactor(llm): 重构 LLM 服务架构,引入中间件与组件化适配器 (#2073)
Some checks failed
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
* ♻️ refactor(llm): 重构 LLM 服务架构,引入中间件与组件化适配器

- 【重构】LLM 服务核心架构:
    - 引入中间件管道,统一处理请求生命周期(重试、密钥选择、日志、网络请求)。
    - 适配器重构为组件化设计,分离配置映射、消息转换、响应解析和工具序列化逻辑。
    - 移除 `with_smart_retry` 装饰器,其功能由中间件接管。
    - 移除 `LLMToolExecutor`,工具执行逻辑集成到 `ToolInvoker`。
- 【功能】增强配置系统:
    - `LLMGenerationConfig` 采用组件化结构(Core, Reasoning, Visual, Output, Safety, ToolConfig)。
    - 新增 `GenConfigBuilder` 提供语义化配置构建方式。
    - 新增 `LLMEmbeddingConfig` 用于嵌入专用配置。
    - `CommonOverrides` 迁移并更新至新配置结构。
- 【功能】强化工具系统:
    - 引入 `ToolInvoker` 实现更灵活的工具执行,支持回调与结构化错误。
    - `function_tool` 装饰器支持动态 Pydantic 模型创建和依赖注入 (`ToolParam`, `RunContext`)。
    - 平台原生工具支持 (`GeminiCodeExecution`, `GeminiGoogleSearch`, `GeminiUrlContext`)。
- 【功能】高级生成与嵌入:
    - `generate_structured` 方法支持 In-Context Validation and Repair (IVR) 循环和 AutoCoT (思维链) 包装。
    - 新增 `embed_query` 和 `embed_documents` 便捷嵌入 API。
    - `OpenAIImageAdapter` 支持 OpenAI 兼容的图像生成。
    - `SmartAdapter` 实现模型名称智能路由。
- 【重构】消息与类型系统:
    - `LLMContentPart` 扩展支持更多模态和代码执行相关内容。
    - `LLMMessage` 和 `LLMResponse` 结构更新,支持 `content_parts` 和思维链签名。
    - 统一 `LLMErrorCode` 和用户友好错误消息,提供更详细的网络/代理错误提示。
    - `pyproject.toml` 移除 `bilireq`,新增 `json_repair`。
- 【优化】日志与调试:
    - 引入 `DebugLogOptions`,提供细粒度日志脱敏控制。
    - 增强日志净化器,处理更多敏感数据和长字符串。
- 【清理】删除废弃模块:
    - `zhenxun/services/llm/memory.py`
    - `zhenxun/services/llm/executor.py`
    - `zhenxun/services/llm/config/presets.py`
    - `zhenxun/services/llm/types/content.py`
    - `zhenxun/services/llm/types/enums.py`
    - `zhenxun/services/llm/tools/__init__.py`
    - `zhenxun/services/llm/tools/manager.py`

* 📦️ build(deps): 移除 bilireq 并添加 json_repair 依赖

* 🐛 (llm): 移除图片生成模型能力预检查

* ♻️ refactor(llm.session): 重构记忆系统以分离存储和策略

* 🐛 fix(reload_setting): 重载配置时清除LLM缓存

*  feat(llm): 支持结构化生成函数接收 UniMessage

*  feat(search): 为搜索功能默认启用 Gemini Google Search 工具

* 🚨 auto fix by pre-commit hooks

---------

Co-authored-by: webjoin111 <455457521@qq.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-12-14 20:27:02 +08:00
molanp
74ce848127
修复对 Uninfo 错误的版本限制 (#2041)
Some checks failed
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
2025-09-01 17:20:24 +08:00
molanp
9e5c4aa3e7
build(deps): 更新项目依赖项 (#2038)
Some checks failed
检查bot是否运行正常 / bot check (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
CodeQL Code Security Analysis / Analyze (${{ matrix.language }}) (none, python) (push) Has been cancelled
Sequential Lint and Type Check / ruff-call (push) Has been cancelled
Release Drafter / Update Release Draft (push) Has been cancelled
Force Sync to Aliyun / sync (push) Has been cancelled
Update Version / update-version (push) Has been cancelled
Sequential Lint and Type Check / pyright-call (push) Has been cancelled
- 移除了大量不再需要的依赖项
- 更新了部分依赖项的版本,指定了版本范围
- 添加了少数新的依赖项
2025-08-30 18:13:56 +08:00
xuanerwa
30fe5a5393
feat(aliyun): 添加阿里云相关配置和文件操作功能 (#1985)
*  feat(aliyun): 添加阿里云相关配置和文件操作功能

* 🐛 fix bug

* 🎨 更新requirements

* ⬆️ Update poetry.lock

*  feat(aliyun): 添加阿里云获取commit方法

* 更新env pyproject

---------

Co-authored-by: HibiKier <775757368@qq.com>
Co-authored-by: HibiKier <45528451+HibiKier@users.noreply.github.com>
2025-07-17 19:48:33 +08:00
BalconyJH
057975a3b9 ⬆️ Update poetry.lock 2025-04-04 20:41:17 +08:00
HibiKier
aef2597b46
添加自动同意群组请求 (#1848)
*  添加自动同意群组请求

*  Add nonebot-plugin-waiter

---------

Co-authored-by: BalconyJH <balconyjh@gmail.com>
2025-02-12 23:32:46 +08:00
BalconyJH
ee55078b56
⬆️ Upgrade nonebot-plugin-htmlrender to version 0.6.0 (#1844) 2025-02-07 13:16:24 +08:00
HibiKier
73d2ed444e Add fastapi dependency and remove nonebot-plugin-userinfo 2025-01-10 12:19:11 +08:00
BalconyJH
e2111278d2 ⬆️ Upgrade nonebot-plugin-apscheduler to version 0.5.0, pytest-asyncio to version 0.25.1 and adjust dependencies 2025-01-10 12:19:11 +08:00
BalconyJH
2afda7b284 Unlock pydantic version 2025-01-10 12:19:11 +08:00
HibiKier
4291cda244
️ 优化自检插件逻辑,增加规则判断,添加nonebug配置 (#1792)
* ⬆️ Expand the range of nonebug version restrictions and update nonebot-plugin-alconna.

*  Update pytest configuration.

*  Add pytest hook to tag async tests with session-scoped event loop.

* ️ 优化自检插件逻辑,增加规则判断

---------

Co-authored-by: BalconyJH <balconyjh@gmail.com>
2024-12-23 10:09:06 +08:00
BalconyJH
b010eac041
chore/cleanup-dependencies (#1763)
*  移除opencv-python, aiohttp依赖,更新poetry.source配置格式

* 💚 更新pre-commit配置文件

* 🚨 移除无用导入
2024-12-13 15:00:56 +08:00
HibiKier
482eb1a214
🎨 修改requirements (#1665) 2024-10-01 00:29:29 +08:00
HibiKier
a2549a0ae9 🎨 更新requirements 2024-09-03 11:03:30 +08:00
HibiKier
8fe061738a 🐛 bug修复 2024-09-01 23:30:26 +08:00
HibiKier
99774adc87 插件商店 2024-08-20 21:29:42 +08:00
HibiKier
7dd68cf1ef fit nonebot.beta2 2022-02-19 18:20:19 +08:00
HibiKier
58acb14859
Update requirements.txt 2021-12-01 14:53:45 +08:00
HibiKier
b63c05a509
Update requirements.txt 2021-12-01 14:17:11 +08:00
HibiKier
b63aa952c4
Update requirements.txt 2021-10-03 15:18:20 +08:00
HibiKier
c806bab6c2
Update requirements.txt 2021-07-12 22:45:27 +08:00
HibiKier
6071c83c9f
Update requirements.txt 2021-07-06 16:27:32 +08:00
HibiKier
2fb85461bd
Update requirements.txt 2021-06-19 16:35:23 +08:00
HibiKier
9551ee6dcb
Update requirements.txt 2021-06-18 16:55:04 +08:00
hibiki
ea620fdae9 gold_readbag and russian 2021-06-15 10:57:08 +08:00
HibiKier
32c43711df
Update requirements.txt 2021-05-20 19:53:43 +08:00
HibiKier
c4125df3da
Add files via upload 2021-05-20 19:11:20 +08:00