feat(openai): add json_schema format type and strict mode (#3193)

* feat(openai): add json_schema and strict mode

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>

* handle err vs _

security scanners prefer if we put these branches in, and I tend to agree.

Signed-off-by: Dave <dave@gray101.com>

---------

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
Signed-off-by: Dave <dave@gray101.com>
Co-authored-by: Dave <dave@gray101.com>
This commit is contained in:
Ettore Di Giacinto 2024-08-07 21:27:02 +02:00 committed by GitHub
parent 66cf38b0b3
commit e198347886
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 46 additions and 3 deletions

View file

@ -14,6 +14,7 @@ const (
type Function struct {
Name string `json:"name"`
Description string `json:"description"`
Strict bool `json:"strict"`
Parameters map[string]interface{} `json:"parameters"`
}
type Functions []Function