mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 02:24:59 +00:00
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:
parent
66cf38b0b3
commit
e198347886
3 changed files with 46 additions and 3 deletions
|
@ -139,6 +139,17 @@ type ChatCompletionResponseFormat struct {
|
|||
Type ChatCompletionResponseFormatType `json:"type,omitempty"`
|
||||
}
|
||||
|
||||
type JsonSchemaRequest struct {
|
||||
Type string `json:"type"`
|
||||
JsonSchema JsonSchema `json:"json_schema"`
|
||||
}
|
||||
|
||||
type JsonSchema struct {
|
||||
Name string `json:"name"`
|
||||
Strict bool `json:"strict"`
|
||||
Schema functions.Item `json:"schema"`
|
||||
}
|
||||
|
||||
type OpenAIRequest struct {
|
||||
PredictionOptions
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue