mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-11 22:49:57 +00:00
feat(task): replace built-in task adaptors with a sandboxed JS plugin system (#7076)
This commit is contained in:
@@ -102,6 +102,12 @@ func runProgram(prog *vm.Program, requestRules []RequestRuleTrace, params TokenP
|
||||
}
|
||||
return result.Value()
|
||||
},
|
||||
"u": func(name string) interface{} {
|
||||
if request.Usage == nil {
|
||||
return nil
|
||||
}
|
||||
return request.Usage[strings.TrimSpace(name)]
|
||||
},
|
||||
"has": func(source interface{}, substr string) bool {
|
||||
if source == nil || substr == "" {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user