Ver Fonte

示例:增加无业务依赖的显式验证配置

新增 orchestration_v1 通用示例,展示 Planner preset、explicit_validation、最大四任务并行和 Worker/Validator 默认 preset 的最小配置,不引入脚本构建或其他具体业务对象。
SamLee há 3 dias atrás
pai
commit
7ef70a184d

+ 31 - 0
agent/examples/orchestration_v1/README.md

@@ -0,0 +1,31 @@
+# Orchestration V1 通用示例
+
+这个示例不包含任何业务模型。目标可以替换成代码、研究、文档或其他项目任务。
+
+项目 `config.py` 的核心配置:
+
+```python
+from agent import CompletionPolicy, OrchestrationConfig, RunConfig
+
+RUN_CONFIG = RunConfig(
+    agent_type="planner",
+    completion_policy=CompletionPolicy.EXPLICIT_VALIDATION,
+    tool_groups=None,
+)
+
+ORCHESTRATION_CONFIG = OrchestrationConfig(
+    max_parallel_tasks=4,
+    max_repair_continuations=1,
+)
+```
+
+Host 注册额外工具时,应在自定义 preset 中分别给 Worker 和 Validator 配置白名单。Validator 只加入无副作用的查询工具,不加入文件写、数据库写、shell、消息、发布或 Agent 创建工具。
+
+运行前安装开发依赖:
+
+```bash
+uv sync --extra dev --extra server --extra feishu --python 3.11
+uv run pytest -q
+```
+
+完整设计和状态语义见 `agent/docs/orchestration-v1.md`。

+ 17 - 0
agent/examples/orchestration_v1/config.py

@@ -0,0 +1,17 @@
+"""Generic explicit-validation example configuration."""
+
+from agent import CompletionPolicy, OrchestrationConfig, RunConfig
+
+
+RUN_CONFIG = RunConfig(
+    agent_type="planner",
+    completion_policy=CompletionPolicy.EXPLICIT_VALIDATION,
+    tool_groups=None,
+)
+
+ORCHESTRATION_CONFIG = OrchestrationConfig(
+    max_parallel_tasks=4,
+    max_repair_continuations=1,
+)
+
+TRACE_STORE_PATH = ".trace"