()
| 17 | ) |
| 18 | |
| 19 | func main() { |
| 20 | ctx := context.Background() |
| 21 | |
| 22 | fmt.Println("=== 工作流 Agent 演示 ===") |
| 23 | |
| 24 | // ====== 示例 1: SequentialAgent - 顺序工作流 ====== |
| 25 | fmt.Println("📝 示例 1: SequentialAgent - 多步骤流水线") |
| 26 | sequentialExample(ctx) |
| 27 | |
| 28 | // ====== 示例 2: ParallelAgent - 并行执行 ====== |
| 29 | fmt.Println("\n⚡ 示例 2: ParallelAgent - 并行比较方案") |
| 30 | parallelExample(ctx) |
| 31 | |
| 32 | // ====== 示例 3: LoopAgent - 循环优化 ====== |
| 33 | fmt.Println("\n🔄 示例 3: LoopAgent - 迭代优化") |
| 34 | loopExample(ctx) |
| 35 | |
| 36 | // ====== 示例 4: 嵌套工作流 ====== |
| 37 | fmt.Println("\n🌳 示例 4: 嵌套工作流 - Sequential + Parallel") |
| 38 | nestedExample(ctx) |
| 39 | |
| 40 | fmt.Println("\n✅ 所有示例完成!") |
| 41 | } |
| 42 | |
| 43 | // sequentialExample 顺序工作流示例 |
| 44 | func sequentialExample(ctx context.Context) { |
nothing calls this directly
no test coverage detected