Router 动态路由器 - 根据输入动态选择要执行的步骤 类似 agno 的 Router,支持返回多个步骤并顺序链接执行
| 14 | // Router 动态路由器 - 根据输入动态选择要执行的步骤 |
| 15 | // 类似 agno 的 Router,支持返回多个步骤并顺序链接执行 |
| 16 | type Router struct { |
| 17 | id string |
| 18 | name string |
| 19 | description string |
| 20 | selector func(*StepInput) []Step // 选择器函数,返回要执行的步骤列表 |
| 21 | choices []Step // 可选的步骤池 |
| 22 | config *StepConfig |
| 23 | } |
| 24 | |
| 25 | // NewRouter 创建新的 Router |
| 26 | func NewRouter(name string, selector func(*StepInput) []Step, choices []Step) *Router { |
nothing calls this directly
no outgoing calls
no test coverage detected