Open
Description
Discussed in #12234
Originally posted by VladyslavLishchyna May 22, 2025
Hi community! I try to get response from Gemini as JSON object and use like this
GeminiPromptExecutionSettings executionSettings = new()
{
FunctionChoiceBehavior = FunctionChoiceBehavior.None(),
ResponseMimeType = "application/json",
ResponseSchema = ChatResponseFormat.ForJsonSchema(jsonSchema)
};
And have 400 status code
Exception while start application - Microsoft.SemanticKernel.HttpOperationException: Response status code does not indicate success: 400 (Bad Request).
---> System.Net.Http.HttpRequestException: Response status code does not indicate success: 400 (Bad Request).
at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
Schema looks like:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Response",
"type": "object",
"additionalProperties": false,
"properties": {
"FirstProperty": {
"type": "integer",
"format": "int32"
},
"Summary": {
"type": "string"
}
}
}
If I run without ResponseSchema parameter I receive response successfully
Metadata
Metadata
Assignees
Type
Projects
Status
Bug