mirror of
https://github.com/mudler/LocalAI.git
synced 2025-06-22 08:30:14 +00:00
feat: resolve JSONSchema refs (planners) (#774)
This commit is contained in:
committed by
GitHub
parent
a38dc497b2
commit
236497e331
@ -18,9 +18,17 @@ func (f Functions) ToJSONStructure() JSONFunctionStructure {
|
||||
//tt := t.(string)
|
||||
|
||||
properties := function.Parameters["properties"]
|
||||
defs := function.Parameters["$defs"]
|
||||
dat, _ := json.Marshal(properties)
|
||||
dat2, _ := json.Marshal(defs)
|
||||
prop := map[string]interface{}{}
|
||||
defsD := map[string]interface{}{}
|
||||
|
||||
json.Unmarshal(dat, &prop)
|
||||
json.Unmarshal(dat2, &defsD)
|
||||
if js.Defs == nil {
|
||||
js.Defs = defsD
|
||||
}
|
||||
js.OneOf = append(js.OneOf, Item{
|
||||
Type: "object",
|
||||
Properties: Properties{
|
||||
|
Reference in New Issue
Block a user