123456789101112131415161718192021 |
- import { AgentTaskStep } from "./agent.task";
- /**
- * 任务执行函数
- */
- export async function TaskExecutor(taskStepList:AgentTaskStep[]){
- for (let index = 0; index < taskStepList.length; index++) {
- let step = taskStepList[index];
- let result = await step.handle()
- if(result == false) {break;}
- if(step.error){
- break;
- }
- if(!step.error){ // 任务执行正常,无Error
- }
- }
- }
|