Skip to content

Commit 621c934

Browse files
FlorainBspring-builds
authored andcommitted
fix: add strict option to Azure ChatCompletionsJsonSchemaResponseFormat (#3928) (#3931)
Fixes #3928 Signed-off-by: Florian Beek <[email protected]> (cherry picked from commit a1b7d5e)
1 parent d60e2bb commit 621c934

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
@@ -951,6 +951,7 @@ private ChatCompletionsResponseFormat toAzureResponseFormat(AzureOpenAiResponseF
951951
var responseFormatJsonSchema = new ChatCompletionsJsonSchemaResponseFormatJsonSchema(jsonSchema.getName());
952952
String jsonString = ModelOptionsUtils.toJsonString(jsonSchema.getSchema());
953953
responseFormatJsonSchema.setSchema(BinaryData.fromString(jsonString));
954+
responseFormatJsonSchema.setStrict(jsonSchema.getStrict());
954955
return new ChatCompletionsJsonSchemaResponseFormat(responseFormatJsonSchema);
955956
}
956957
return new ChatCompletionsTextResponseFormat();

0 commit comments

Comments
 (0)