Honor JSONSchema.Strict in OpenAI response format
buildResponseFormat was hardcoding strict: true instead of reading rf.JSONSchema.Strict, making it impossible to request non-strict JSON-schema output. Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -261,7 +261,7 @@ func buildResponseFormat(rf *llm.ResponseFormat) openai.ChatCompletionNewParamsR
|
||||
if rf.JSONSchema != nil {
|
||||
schema := shared.ResponseFormatJSONSchemaJSONSchemaParam{
|
||||
Name: rf.JSONSchema.Name,
|
||||
Strict: param.NewOpt(true),
|
||||
Strict: param.NewOpt(rf.JSONSchema.Strict),
|
||||
}
|
||||
if rf.JSONSchema.Description != "" {
|
||||
schema.Description = param.NewOpt(rf.JSONSchema.Description)
|
||||
|
||||
Reference in New Issue
Block a user