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:
Bryan Frimin
2026-03-13 19:02:12 +01:00
parent f3239a1a7b
commit 659ff1e845

View File

@@ -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)