本次提交新增了通道模块的完整基础实现: 1. 搭建了channel包的顶层导出结构,整合所有核心子模块接口 2. 实现了错误处理工具类与重试退避逻辑 3. 新增UI表单/页面/字段的schema定义与自动生成工具 4. 完成上下文管理模块,支持会话上下文、可见性过滤与运行时状态注册 5. 实现通道能力配置类,支持流式传输、功能开关等多维度能力定义
70 lines
1.7 KiB
Python
70 lines
1.7 KiB
Python
from yuxi.channel.capabilities import ChannelCapabilities
|
|
from yuxi.channel.common import AttachmentCache, CachedAttachment
|
|
from yuxi.channel.context import (
|
|
ChannelContext,
|
|
ChannelRuntimeContexts,
|
|
ContextVisibilityMode,
|
|
ConversationBinding,
|
|
SupplementalContext,
|
|
task_scoped_contexts,
|
|
)
|
|
from yuxi.channel.events import ChannelEventBus, EventTopic
|
|
from yuxi.channel.runtime.manager import (
|
|
ChannelGateway,
|
|
ChannelSnapshot,
|
|
ChannelState,
|
|
gateway,
|
|
)
|
|
from yuxi.channel.plugins.registry import ChannelPluginRegistry
|
|
from yuxi.channel.runtime.trace import StartupTrace
|
|
from yuxi.channel.streaming.draft_stream import (
|
|
DraftStreamLoop,
|
|
FinalizableDraftStreamControls,
|
|
get_tool_status_label,
|
|
)
|
|
from yuxi.channel.runtime.trace_ctx import (
|
|
TraceIdFilter,
|
|
generate_trace_id,
|
|
get_trace_id,
|
|
install_trace_filter,
|
|
set_trace_id,
|
|
trace_context,
|
|
)
|
|
|
|
__all__ = [
|
|
# common
|
|
"AttachmentCache",
|
|
"CachedAttachment",
|
|
# core
|
|
"ChannelCapabilities",
|
|
"ChannelContext",
|
|
"ChannelEventBus",
|
|
"ChannelGateway",
|
|
"ChannelPluginRegistry",
|
|
"ChannelRuntimeContexts",
|
|
"ChannelSnapshot",
|
|
"ChannelState",
|
|
"ContextVisibilityMode",
|
|
"ConversationBinding",
|
|
"EventTopic",
|
|
# hooks
|
|
"HookCallback",
|
|
"HookEvent",
|
|
"HookRegistration",
|
|
"LifecycleHookRegistry",
|
|
"StartupTrace",
|
|
"DraftStreamLoop",
|
|
"FinalizableDraftStreamControls",
|
|
"get_tool_status_label",
|
|
"SupplementalContext",
|
|
"gateway",
|
|
"task_scoped_contexts",
|
|
# trace
|
|
"TraceIdFilter",
|
|
"generate_trace_id",
|
|
"get_trace_id",
|
|
"install_trace_filter",
|
|
"set_trace_id",
|
|
"trace_context",
|
|
]
|