- 新增计费模块:执行开始建单、终态结算/取消/失败处理,支持按条/按秒/按token计费 - 新增执行生命周期跟踪:优雅关停时取消运行中执行并等待落库 - 新增异步任务等待/通知机制(Wait/Notify) - 重构执行记录落库与进度上报,统一失败分类与重试语义 - 重命名文件:async_task.go→async.go、flow_checkpoint_store.go→exec_checkpoint.go、flow_graph_util.go→exec_record.go - 更新 .gitignore 与数据库密码配置
22 lines
461 B
Go
22 lines
461 B
Go
package flow
|
|
|
|
import (
|
|
flowDto "ai-agent/workflow/model/dto/flow"
|
|
"context"
|
|
"fmt"
|
|
)
|
|
|
|
// HttpLambda 构建HTTP(S)接口
|
|
func HttpLambda(ctx context.Context, input any) (any, error) {
|
|
nodeInput, ok := input.(*flowDto.NodeExecutionInput)
|
|
if !ok {
|
|
return nil, fmt.Errorf("入参类型错误")
|
|
}
|
|
outputRes, err := HttpCallResultLambda(ctx, nodeInput)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
nodeInput.Config.OutputResult = outputRes
|
|
return nodeInput, nil
|
|
}
|