* refactor: llm message schema * feat: implement MCPTool and local LLM tools with enhanced context handling * refactor: reorganize imports and enhance docstrings for clarity * refactor: enhance ContentPart validation and add message pair handling in ConversationManager * chore: ruff format * refactor: remove debug print statement from payloads in ProviderOpenAIOfficial * Update astrbot/core/agent/tool.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update astrbot/core/agent/message.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update astrbot/core/agent/message.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update astrbot/core/agent/tool.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update astrbot/core/pipeline/process_stage/method/llm_request.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update astrbot/core/agent/message.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * refactor: enhance documentation and import mcp in tool.py; update call method return type * fix: 修复以数据类的方式注册 tool 时的插件重载机制问题 * refactor: change role attributes to use Literal types for message segments * fix: add support for 'decorator_handler' method in call_local_llm_tool * fix: handle None prompt in text_chat method and ensure context is properly formatted --------- Co-authored-by: LIghtJUNction <lightjunction.me@gmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
19 lines
572 B
Python
19 lines
572 B
Python
from dataclasses import dataclass
|
|
|
|
from astrbot.core.config import AstrBotConfig
|
|
from astrbot.core.star import PluginManager
|
|
|
|
from .context_utils import call_event_hook, call_handler, call_local_llm_tool
|
|
|
|
|
|
@dataclass
|
|
class PipelineContext:
|
|
"""上下文对象,包含管道执行所需的上下文信息"""
|
|
|
|
astrbot_config: AstrBotConfig # AstrBot 配置对象
|
|
plugin_manager: PluginManager # 插件管理器对象
|
|
astrbot_config_id: str
|
|
call_handler = call_handler
|
|
call_event_hook = call_event_hook
|
|
call_local_llm_tool = call_local_llm_tool
|