Dt8333
f624971613
chore: fix bunches of type checking errors ( #3213 )
...
* chore(core.utils): 🚨 修正错误Lint
* chore(core.provider): 🚨 修复基类错误Lint
* chore(core.utils): 补全session_get()的重载
* chore(core.provider): 🚨 修正实现错误Lint
* chore(core.platform): 🚨 修正platform基类和webchat的错误Lint
* chore(core.platform): 修正错误实现Lint
* fix(core.provider): 修复循环调用和错误assert
* chore(core.platform): 修复部分实现Lint
* chore(core.provider): 补充Dify.text_chat_stream的参数类型
* chore(core.pipeline): 🚨 修复错误Lint
* fix(core.slack): 补充遗漏导入
* chore(core.utils): 修复错误的session_get声明
* chore(core.platform): 移除Lark adapter import中的wildcard
* chore(core.db): 修复声明和部分逻辑
* chore(core.db): 添加typings,使faiss参数能被正确识别。
* chore(core): 修复声明
* chore(core): 修改声明
* chore: 补充faiss声明
* chore(dashboard): 修改实现,减少报错
* chore(package): 修改部分声明与实现,减少报错
* chore(core): 添加Handler的overload,以去除部分assert同时通过类型检查
* chore(core.pipeline): 修改Pipeline Scheduler的execute,将判断属性改为判断类型,通过静态类型检查
* chore(core.config): 添加类型标注,通过类型检查
* chore(core.message): 为File._download_file添加检查,通过类型检查
* fix: 将断言改为条件判断以实现优雅关闭的容错性
* refactor: 移除 discord 客户端中的 assert,改用 if None 判断并抛出异常
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: DiscordPlatformAdapter 对 self.client.user 为 None 做日志并返回,移除断言
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 增强 Lark 相关空值/异常检查并完善日志输出
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 将断言替换为条件检查并加入日志与错误处理
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* chore: 移除LLM生成的无用注释
* refactor: 使用 File.get_file 替换下载逻辑并移除 assert,提供默认 filename
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: Slack Socket 未初始化抛出运行时异常,图片 URL 判空改为非空判断
* refactor: 将 WeChatPadProAdapter 的断言改为空值判断并添加日志
* refactor: 使用 isinstance 替代断言实现类型判断,便于静态检查
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 去除cast,直接使用字段与字典访问,修正端口解析
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 使用 match-case 重构 ProviderManager 加载并通过类型检查抛出 TypeError
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: group_name_display 时若 group 对象为空则记录错误并返回
* fix: 将 _get_current_persona_id 的 assert 替换成 if guard 并返回 None
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 优化插件目录存在性检查及图片URL非空验证,更新JSON排序配置
* fix: 将 datetime_str 的 assert 替换为显式检查并抛出异常
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 移除 cast,改为运行时检查并在找不到调度器时跳过
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 移除 cast,改用 isinstance 检查 FaissVecDB 并警告
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 删除 typing.cast 导入,并在获取文件绝对路径前校验 file_
* refactor: 移除 typing.cast,简化内容安全检查调用
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 将 PlatformMetadata.id 设为必填并在注册时传入 id,移除 cast
* refactor: 移除 cast,改用 HasInitialize 与 isinstance 进行初始化
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 为 ProviderManager.initialize 增加ID类型判断,避免 None 导致 get 失败
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 为 OTTSProvider 与 AzureNativeProvider 引入 _client 与 client 属性改进上下文管理
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 为 Whisper 自托管源添加模型未初始化校验并直接调用 transcribe
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 移除未使用的 cast 导入并简化 platform_name 赋值
* refactor: 引入 cast 并对 id 使用 cast(str, ...) 提升类型安全
* fix: 将 _id_to_sid 返回改为 str,空值返回空串;对 id 与 message_id 使用 cast
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 重构 Discord 处理逻辑:强制 类型转换、优先斜杠指令并优化提及判断
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* fix: 统一对 id 获取执行 cast,并在微信消息解析失败时抛错
* Revert "fix: 去除cast,直接使用字段与字典访问,修正端口解析"
This reverts commit 1cbfdf9d1b .
* fix: 百炼 Rerank 会话关闭时返回空结果;初始化 request.prompt 避免空值拼接
* fix: 统一处理搜索结果链接为字符串,新增 _get_url 助手并适配 Bing/Sogo
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
* refactor: 调整 call_handler 泛型、Discord 通道注解及 FishAudioTTS API 请求类型
* refactor: 使用 col(...) 替代列引用并对结果进行 CursorResult 强转
* chore: ruff format
---------
Co-authored-by: aider (openai/gemini-3-pro-high) <aider@aider.chat >
Co-authored-by: Soulter <905617992@qq.com >
2025-12-09 14:13:47 +08:00
Soulter
aa6d07afcc
refactor: move all internal commands from astrbot plugin to default_command plugin ( #3960 )
...
* refactor: move all internal commands from astrbot plugin to default_command plugin
* ruff check
* feat: add config
* ruff check
2025-12-08 22:17:32 +08:00
Soulter
31d53edb9d
refactor: standardize provider test method implementation
...
- Updated the `test` method in all provider classes to remove return values and raise exceptions for failure cases, enhancing clarity and consistency.
- Adjusted related logic in the dashboard and command routes to align with the new `test` method behavior, simplifying error handling.
2025-12-01 18:37:08 +08:00
Soulter
2a7d03f9e1
fix: fit language and log AI responses more clearly ( #3864 )
...
* fix: fit language and log AI responses more clearly
* chore: ruff format
2025-12-01 13:24:52 +08:00
Soulter
72fac4b9f1
feat: implement unified provider availability testing across components ( #3865 )
...
- Added a `test` method to each provider class to standardize availability checks.
- Updated the dashboard and command routes to utilize the new `test` method for provider reachability verification, simplifying the logic and improving maintainability.
- Removed redundant reachability check logic from the command handler.
2025-12-01 13:17:20 +08:00
邹永赫
dcda871fc0
feat: provider availability reachability improvements ( #3708 )
2025-12-01 01:06:10 +09:00
Oscar Shaw
93c69a639a
feat: 新增群聊模式下的专用图片转述模型配置 ( #3822 )
...
* feat: add image caption provider configuration for group chat
- Introduced `image_caption_provider_id` to allow separate configuration for group chat image understanding.
- Updated metadata and hints in English and Chinese for clarity on new settings.
- Adjusted logic in long term memory to utilize the new provider ID for image captioning.
* fix: format
* Fix logic for image caption and active reply settings
* Fix indentation and formatting in long_term_memory.py
* chore: ruff format
---------
Co-authored-by: Soulter <37870767+Soulter@users.noreply.github.com >
Co-authored-by: Soulter <905617992@qq.com >
2025-11-29 23:53:32 +08:00
Soulter
88c1d77f0b
perf: add at message to group chat history ( #3796 )
...
* feat: enhance long-term memory message formatting
- Added support for 'At' message components in long-term memory, allowing for better representation of mentions in messages.
* chore: ruff check
2025-11-27 15:59:07 +08:00
Dt8333
758ce40cc1
chore: fix test ( #3787 )
2025-11-27 14:02:42 +08:00
Soulter
3e7bb80492
chore: ruff format
2025-11-27 14:01:25 +08:00
Soulter
0f6a3c3f5a
refactor: session management custom rules ( #3792 )
...
* refactor: umo custom rules
* feat(i18n): update session management translations and improve provider configuration handling
- Updated English and Chinese translations for session management, including "Unified Message Origin" and "Follow Config".
- Enhanced provider configuration options to include "Follow Config" as a selectable item.
- Removed unused clear buttons and refactored provider configuration saving logic to handle updates and deletions more efficiently.
2025-11-27 13:30:43 +08:00
Soulter
5f3c7ed673
feat(conversation): update agent runner type configuration path to provider_settings
2025-11-23 23:05:36 +08:00
Soulter
34c03ce983
Merge remote-tracking branch 'origin/master' into feat/agent-runner
2025-11-23 22:06:52 +08:00
Soulter
910ec6c695
feat: implement third party agent sub stage and refactor provider management
...
- Added `ThirdPartyAgentSubStage` to handle interactions with third-party agent runners (Dify, Coze, Dashscope).
- Refactored `star_request.py` to ensure consistent return types in the `process` method.
- Updated `stage.py` to initialize and utilize the new `AgentRequestSubStage`.
- Modified `ProviderManager` to skip loading agent runner providers.
- Removed `Dify` source implementation as it is now handled by the new agent runner structure.
- Enhanced `DifyAPIClient` to support file uploads via both file path and file data.
- Cleaned up shared preferences handling to simplify session preference retrieval.
- Updated dashboard configuration to reflect changes in agent runner provider selection.
- Refactored conversation commands to accommodate the new agent runner structure and remove direct dependencies on Dify.
- Adjusted main application logic to ensure compatibility with the new conversation management approach.
2025-11-23 20:18:51 +08:00
Soulter
766d6f2bec
fix(conversation): update session configuration retrieval to use unified message origin
2025-11-23 20:18:51 +08:00
Soulter
9f39140987
fix(conversation): update session configuration retrieval to use unified message origin
2025-11-23 19:59:21 +08:00
Soulter
6849af2bad
refactor: LLM response handling with reasoning content ( #3632 )
...
* refactor: LLM response handling with reasoning content
- Added a `show_reasoning` parameter to `run_agent` to control the display of reasoning content.
- Updated `LLMResponse` to include a `reasoning_content` field for storing reasoning text.
- Modified `WebChatMessageEvent` to handle and send reasoning content in streaming responses.
- Implemented reasoning extraction in various provider sources (e.g., OpenAI, Gemini).
- Updated the chat interface to display reasoning content in a collapsible format.
- Removed the deprecated `thinking_filter` package and its associated logic.
- Updated localization files to include new reasoning-related strings.
* feat: add Groq chat completion provider and associated configurations
* Update astrbot/core/provider/sources/gemini_source.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-11-15 18:59:17 +08:00
Copilot
e190bbeeed
Optimize string concatenation in loops: replace += with list.join() ( #3246 )
...
* Initial plan
* Fix string concatenation performance issues in loops
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com >
* Address code review feedback: Fix plugin list logic and add comment
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com >
* Improve comment clarity for at_parts accumulation
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com >
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com >
Co-authored-by: LIghtJUNction <106986785+LIghtJUNction@users.noreply.github.com >
2025-11-02 13:00:59 +08:00
LIghtJUNction
0b7fc29ac4
style: add ruff lint module of isort and pyupgrade, and some ruff check fix ( #3214 )
...
Co-authored-by: Dt8333 <25431943+Dt8333@users.noreply.github.com >
Co-authored-by: Soulter <905617992@qq.com >
2025-11-01 13:26:19 +08:00
Futureppo
40a0a8df5a
perf: 优化 /model 切换模型成功的提示 ( #3161 )
2025-10-28 09:05:42 +08:00
Soulter
65c71b5f20
refactor: remove Google search engine integration from main module and dependencies ( #3154 )
2025-10-26 18:54:01 +08:00
exynos
1152b11202
feat(thinking_filter): 适配第三方 Gemini 思考片段过滤 ( #3139 )
...
* feat(thinking_filter): 适配第三方 Gemini 思考片段过滤
* feat(thinking_filter): Gemini 思考过滤、序列化回退与空白清理重构
* 使用 ruff 格式化并修复导入空行
2025-10-26 18:43:58 +08:00
Soulter
8afefada0a
fix: image_caption btn
2025-10-21 11:07:39 +08:00
Soulter
2c5f68e696
refactor: 重构创建平台时的流程及一些 UI 优化 ( #3102 )
...
* refactor: 支持在平台直接选择配置文件
* add webchat
* feat: 支持新建平台时现场预览、创建和编辑配置文件
* fix: update configuration file descriptions and visibility based on updating mode
* perf: use incremental decoder
* perf: update descriptions
* fix: UI update issues in config file dialog
* fix: update UI elements for better readability and organization
* feat: enhance sidebar navigation with group feature and dynamic resizing
Co-authored-by: IGCrystal <3811541171@qq.com >
* refactor: persona selector
* perf: 修改部分默认行为
* fix: adjust ExtensionCard layout and improve responsiveness
* refactor: 配置文件绑定消息平台重构为消息平台绑定配文件
* style: add custom styling for v-select selection text
* fix: correct subtitle text in provider.json
* refactor: update conversation management terminology and improve session ID handling
* refactor: add Conversation ID localization and update table header reference
* Update astrbot/core/db/migration/migra_45_to_46.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
* style: format logger warning for better readability
* refactor: comment out WebChat configuration for future reference
---------
Co-authored-by: IGCrystal <3811541171@qq.com >
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com >
2025-10-20 12:01:06 +08:00
Dt8333
361d78247b
fix(core): 修复人格预设对话的重复注入 ( #3088 )
...
备份Context避免供应商适配器移除Context内字段导致将预设会话存入历史。深拷贝人格预设会话防止运行时被意外修改。
#3063
2025-10-19 20:13:57 +08:00
Soulter
17df1692b9
fix: 修复 /alter_cmd reset scene <num> xxx 不可用的问题
2025-10-15 12:16:13 +08:00
Soulter
37bdb6c6f6
feat: 内置网页搜索功能支持接入百度 AI 搜索 ( #3031 )
...
* feat: 内置网页搜索功能支持接入百度 AI 搜索
* fix: 修正配置文件中的拼写错误,更新为正确的键名
* Fix Baidu AI Search initialization logic
2025-10-14 09:35:34 +08:00
Dt8333
6f73e5087d
feat(core): 在新对话中重用先前的对话人格设置 ( #3005 )
...
* feat(core): reuse persona conf in new conversation
#2985
* refactor(core): simplify persona retrieval logic
* style: code format
---------
Co-authored-by: Soulter <905617992@qq.com >
2025-10-12 10:42:35 +08:00
Dt8333
12fc6f9d38
fix(LTM): fix LTM not removed when removing conversation ( #3002 )
...
#2983
2025-10-12 00:16:42 +08:00
Dt8333
eaaff4298d
fix(Python-Interpreter): fix incorrect file read method ( #2970 )
...
fix getting file by property(Sync) in an async handler
#2960
2025-10-06 16:12:05 +08:00
Soulter
3211ec57ee
fix: handle Google search initialization and errors gracefully
2025-10-05 00:55:47 +08:00
Soulter
6796afdaee
fix: googlesearch
2025-10-05 00:54:24 +08:00
Soulter
1dfc831938
fix: 修复 reset 没有清除群聊上下文感知数据的问题 ( #2954 )
2025-10-05 00:05:42 +08:00
Soulter
cef0c22f52
feat: update prompt prefix handling to support placeholder replacement
2025-10-02 14:20:52 +08:00
Soulter
13d3fc5cfe
fix: fix type checking error and op, deop, wl, dwl command
2025-10-02 00:18:12 +08:00
Soulter
afe007ca0b
refactor: 优化 packages/astrbot 内置插件的代码结构以提高可维护性和可读性 ( #2924 )
...
* refactor: code structure for improved readability and maintainability
* style: ruff format
* Update packages/astrbot/commands/provider.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update packages/astrbot/commands/persona.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update packages/astrbot/commands/llm.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* Update packages/astrbot/commands/conversation.py
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
* fix: improve error handling message formatting in key switching
* fix: update LLM command to use safe get for provider settings
* feat: implement ProcessLLMRequest class for handling LLM requests and persona injection
---------
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
2025-10-01 21:29:15 +08:00
Soulter
50f74f5ba2
fix: 修复"开启 TTS 时同时输出语音和文字内容"功能不可用的问题 ( #2900 )
...
fixes : #2844
2025-09-28 10:48:57 +08:00
anka
ccb380ce06
feat: 支持接入 Coze ( #2858 )
...
* feat: 适配 coze 供应商
1. 支持文件上传
2. 支持多模态
3. 支持流式传输
4. 支持 API 端的上下文保存历史记录
5. 支持类似 dify 的 forget 接口
* style: format code
* fix: type checking error
* fix: 修复:
1. 使用coze api端的上下文时, 现在不会重复传递上下文
2. 使用 AstrBot 的上下文时, 正确处理其中的图片信息
3. 上传图片时, 提供一个非持久化的缓存避免重复上传(在解析上下文并将文件转化为file_id传递给coze api时, 如果没有缓存会导致很多的网络资源浪费)
4. 修复reset等指令不能正确重置上下文的问题
* fix: 移除某些地方多余的针对 dify 的断言, 以兼容 Coze
* style: 修改配置项显示/webchat平台对于非预期的类型的处理
* fix: 让conversation_id放到请求中正确的位置
* refactor: extract coze api client
* refactor: improve image processing logic in ProviderCoze
* chore: remove file ext guessing
---------
Co-authored-by: Soulter <905617992@qq.com >
2025-09-27 14:23:29 +08:00
Soulter
09d1f96603
fix: 修复 /alter_cmd 指令无法控制指令组、子指令组和子指令组下子指令的问题 ( #2873 )
...
* fix: revert changes in command_group.py at 782c036 to fix command group permission check
* fix: 不传递 GroupCommand handler
* perf: alter_cmd 指令支持对子指令、指令组进行配置
* chore: remove test commands and subcommands from test_group
* chore: add cache for complete command names list in CommandFilter and CommandGroupFilter
---------
Co-authored-by: Dt8333 <25431943+Dt8333@users.noreply.github.com >
Co-authored-by: Soulter <905617992@qq.com >
2025-09-26 14:16:50 +08:00
Soulter
7a5bc51c11
fix: 识别引用消息的图片时优先使用默认图片转述提供商 ( #2836 )
...
* fix: 识别引用消息的图片时优先使用默认图片转述提供商
closes : #2821
* fix: 添加日志记录以处理未找到图片标题提供者的情况
* style: format code
2025-09-21 20:55:32 +08:00
Soulter
80a86f5b1b
fix: 修复 astrbot.core.star 等包下的 type checking error ( #2787 )
...
* fix: 修复 astrbot.core.star 等包下的 type checking error
* refactor: improve type checking and annotations
* chore: ruff format
2025-09-21 18:10:04 +08:00
anka
9d9917e45b
feat: 增加群名称识别到 system prompt, 并提供相应的配置 ( #2770 )
...
* feat🤖 : 增加群名称识别到system prompt, 并提供相应的配置
* feat: 优化实现方式, 重构AstrBotMessage, 向后兼容
* style: format
2025-09-16 10:23:08 +08:00
Soulter
7740e1e131
ci: add ci stage of code format checking ( #2750 )
...
* style: ruff format
* ci(dashboard-ci): ensure GitHub Release action only runs on push events
* ci(code-format): ruff format and ruff check
2025-09-14 18:05:58 +08:00
Soulter
e84a00d3a5
fix: 修复多配置文件配置的不同人格无法生效的问题 ( #2739 )
...
fixes : #2724
2025-09-14 14:09:46 +08:00
Dt8333
ea6f209557
fix: 修复LLM仍会调用已禁用的工具的问题 ( #2729 )
...
* fix: 修复LLM调用已禁用的工具
* feat: 修改工具禁用判断位置,提高效率
未设置可用工具时仍旧循环判断
设置可用工具后在获取工具时即判断
2025-09-12 21:36:10 +08:00
RC-CHN
72aea2d3f3
feat: 允许添加多个 tavily API Key 进行轮询 ( #2725 )
...
* feat: 允许添加多个tavily API Key进行轮询
* perf: 并发安全的从列表中获取并轮换Tavily API密钥
* fix: 自动迁移旧版 websearch_tavily_key 为列表格式并保存
2025-09-12 15:03:47 +08:00
卢小辉
45a4a6b6da
feat: 给添加 edge_tts 新增 rate, volume, pitch 参数 ( #2625 )
...
* 修复python执行器文件上传qq提示参数错误问题,修改策略为本地url
* 给edge_tts 添加3个默认参数,方便通过ui配置
2025-09-05 15:23:21 +08:00
Soulter
35eda37e83
Merge remote-tracking branch 'origin/releases/v3.5.27'
2025-09-04 15:30:15 +08:00
Soulter
ba2ee1c0aa
fix: 初次下载 webui 构建文件时下载指定版本而非 latest
2025-09-04 13:27:55 +08:00
Soulter
4149549e42
fix: KeyError arprompt
2025-09-03 12:45:34 +08:00