Skip to content

Commit a1b7d5e

Browse files
authored
fix: add strict option to Azure ChatCompletionsJsonSchemaResponseFormat (#3928) (#3931)
Fixes #3928 Auto-cherry-pick to 1.0.x Signed-off-by: Florian Beek <[email protected]>
1 parent 83e2785 commit a1b7d5e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

models/spring-ai-azure-openai/src/main/java/org/springframework/ai/azure/openai/AzureOpenAiChatModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -959,6 +959,7 @@ private ChatCompletionsResponseFormat toAzureResponseFormat(AzureOpenAiResponseF
959959
var responseFormatJsonSchema = new ChatCompletionsJsonSchemaResponseFormatJsonSchema(jsonSchema.getName());
960960
String jsonString = ModelOptionsUtils.toJsonString(jsonSchema.getSchema());
961961
responseFormatJsonSchema.setSchema(BinaryData.fromString(jsonString));
962+
responseFormatJsonSchema.setStrict(jsonSchema.getStrict());
962963
return new ChatCompletionsJsonSchemaResponseFormat(responseFormatJsonSchema);
963964
}
964965
return new ChatCompletionsTextResponseFormat();

0 commit comments

Comments
 (0)