taolib.symphony.agent.runner#
智能体运行器。
编排单个 Issue 的完整运行流程: 工作区创建 → before_run 钩子 → 启动 app-server → 轮次循环 → 停止 → after_run 钩子。
Classes#
Issue 信息的协议接口。 |
|
运行器配置。 |
|
智能体运行器。 |
Module Contents#
- class taolib.symphony.agent.runner.IssueInfo#
Bases:
ProtocolIssue 信息的协议接口。
- class taolib.symphony.agent.runner.RunnerConfig#
运行器配置。
- class taolib.symphony.agent.runner.AgentRunner(transport: taolib.symphony.agent.transport.AgentTransport, config: RunnerConfig | None = None)#
智能体运行器。
编排单个 Issue 的完整运行生命周期: 创建工作区 → 执行 before_run 钩子 → 启动 app-server → 轮次循环 → 停止 app-server → 执行 after_run 钩子。
- _transport#
- _config#
- _client#
- property client: taolib.symphony.agent.appserver.AppServerClient#
底层 AppServer 客户端。
- async run_attempt(issue: IssueInfo, attempt: int, workspace_path: str, *, build_prompt: collections.abc.Callable[[IssueInfo, int, int], str], check_issue_status: collections.abc.Callable[[IssueInfo], asyncio.Coroutine[Any, Any, str | None]] | None = None, on_event: collections.abc.Callable[[taolib.symphony.agent.events.AppServerEvent], None] | None = None) taolib.symphony.agent.events.TurnResult#
执行一次完整的运行尝试。
流程: 1. 执行 before_run 钩子 2. 启动 app-server 进程 3. 初始化会话 4. 轮次循环(构建提示词 → 运行轮次 → 检查状态) 5. 停止 app-server 6. 执行 after_run 钩子
- 参数:
issue -- Issue 信息。
attempt -- 尝试序号(从 0 开始)。
workspace_path -- 工作区路径。
build_prompt -- 提示词构建回调。
check_issue_status -- Issue 状态检查回调(可选)。
on_event -- 事件回调(可选)。
- 返回:
最终轮次结果。