refactor(asynch): 重构异步模型配置和队列管理

This commit is contained in:
2026-06-02 20:26:46 +08:00
parent 1bcf8f6e10
commit 0bbaddace0
4 changed files with 44 additions and 612 deletions

View File

@@ -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 数组