refactor(asynch): 重构异步模型配置和队列管理
This commit is contained in:
@@ -16,14 +16,9 @@ import (
|
||||
func ValidatePromptResult(raw map[string]any, model *entity.AsynchModel) error {
|
||||
// 1) 获取校验配置,并取值
|
||||
requestMapping := model.RequestMapping
|
||||
contentKey := ""
|
||||
for k := range model.ResponseBody {
|
||||
contentKey = k
|
||||
break
|
||||
}
|
||||
contentStr, ok := raw[contentKey].(string)
|
||||
contentStr, ok := raw[model.ResponseBody].(string)
|
||||
if !ok || contentStr == "" {
|
||||
return fmt.Errorf("%s 字段为空或不是字符串", contentKey)
|
||||
return fmt.Errorf("%s 字段为空或不是字符串", model.ResponseBody)
|
||||
}
|
||||
|
||||
// 2) 解析 content 为 JSON 数组
|
||||
|
||||
Reference in New Issue
Block a user