Skip to content

response_format error after updating to => 9.5.0 #6656

@EdCharbeneau

Description

@EdCharbeneau

Description

I wasn't getting any errors prior to 9.5.0 and greater.

After updating my project to the latest version, I started getting errors.

Here is the call that is failing.

https://github.com/EdCharbeneau/NaturalLanguageGrid2/blob/6c75f6445c2e46c4cc1210e909c45427ec5256e3/TelerikAIExtensions/NaturalLanguage/NaturalLanguageGridService.cs#L84

If this isn't a bug, some advice would be appreciated. Thanks!

UPDATE

It appears that the schema for response_format by GetResponseAsync may be incomplete.
#6656 (comment)

Parameter: response_format

Invalid schema for response_format 'NaturalLanguageGridState_1': In context=('properties', 'gridState', 'properties', 'groupDescriptors', 'type', '0', 'items', 'properties', 'aggregateFunctions', 'type', '0'), array schema missing items.
   at Azure.AI.OpenAI.ClientPipelineExtensions.ProcessMessageAsync(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
   at Azure.AI.OpenAI.Chat.AzureChatClient.CompleteChatAsync(BinaryContent content, RequestOptions options)
   at OpenAI.Chat.ChatClient.CompleteChatAsync(IEnumerable`1 messages, ChatCompletionOptions options, CancellationToken cancellationToken)
   at Microsoft.Extensions.AI.OpenAIChatClient.GetResponseAsync(IEnumerable`1 messages, ChatOptions options, CancellationToken cancellationToken)
   at Microsoft.Extensions.AI.ChatClientStructuredOutputExtensions.GetResponseAsync[T](IChatClient chatClient, IEnumerable`1 messages, JsonSerializerOptions serializerOptions, ChatOptions options, Nullable`1 useJsonSchemaResponseFormat, CancellationToken cancellationToken)
   at TelerikAIExtensions.NaturalLanguage.NaturalLanguageGridService.<>c__DisplayClass8_0`1.<<ProcessGridRequest>g__TryProcessingGridState|3>d.MoveNext() in C:\Users\echarben\source\repos\EdCharbeneau\NaturalLanguageGrid2\TelerikAIExtensions\NaturalLanguage\NaturalLanguageGridService.cs:line 84
--- End of stack trace from previous location ---
   at TelerikAIExtensions.NaturalLanguage.NaturalLanguageGridService.ProcessGridRequest[T](String query, GridState`1 state) in C:\Users\echarben\source\repos\EdCharbeneau\NaturalLanguageGrid2\TelerikAIExtensions\NaturalLanguage\NaturalLanguageGridService.cs:line 43
   at TelerikAIExtensions.Tests.Tests.CanSort.CanSortColumns() in C:\Users\echarben\source\repos\EdCharbeneau\NaturalLanguageGrid2\NaturalLanguageGrid.Tests\Tests\CanSort.razor:line 24
--- End of stack trace from previous location ---

Reproduction Steps

Update from 9.1.0 to 9.5.0

Expected behavior

Structured output is returned and serialized

Actual behavior

Error occurs

Regression?

No response

Known Workarounds

No response

Configuration

https://github.com/EdCharbeneau/NaturalLanguageGrid2/blob/vNext/TelerikAIExtensions/NaturalLanguage/NaturalLanguageGridService.cs#L84

Other information

No response

Metadata

Metadata

Labels

area-aiMicrosoft.Extensions.AI librariesbugThis issue describes a behavior which is not expected - a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions