extensions icon indicating copy to clipboard operation
extensions copied to clipboard

OpenAIAssistantChatClientIntegrationTests don't seem to work against Azure OpenAI

Open ericstj opened this issue 2 weeks ago • 1 comments

I haven't been able to get these tests to run against Azure OpenAI. Either we're missing setup steps, or they just don't work.

They fail with either:

    C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIAssistantChatClientIntegrationTests.cs(32): error TESTERROR:
      Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests.GetStreamingResponseAsync (1ms): Error Message: System.ClientModel.ClientResultException : HTTP 404 (: 404)

      Resource not found
      Stack Trace:
         at OpenAI.ClientPipelineExtensions.ProcessMessage(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
         at OpenAI.Assistants.AssistantClientGetAssistantsCollectionResultOfT.GetRawPages()+MoveNext()
         at System.ClientModel.CollectionResult`1.GetEnumerator()+MoveNext()
         at System.Linq.Enumerable.TryGetFirstNonIterator[TSource](IEnumerable`1 source, Boolean& found)
         at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
         at Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests.CreateChatClient() in C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIAssistantChatClientIntegrationTests.cs:line 32
         at Microsoft.Extensions.AI.ChatClientIntegrationTests..ctor() in C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\ChatClientIntegrationTests.cs:line 39
         at Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests..ctor()
         at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
    C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIAssistantChatClientIntegrationTests.cs(32): error TESTERROR:

Or the following, if I remove getting the assistant collection.

      Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests.GetStreamingResponseAsync (1ms): Error Message: System.ClientModel.ClientResultException : HTTP 404 (: 404)

      Resource not found
      Stack Trace:
         at OpenAI.ClientPipelineExtensions.ProcessMessage(ClientPipeline pipeline, PipelineMessage message, RequestOptions options)
         at OpenAI.Assistants.AssistantClient.CreateAssistant(BinaryContent content, RequestOptions options)
         at OpenAI.Assistants.AssistantClient.CreateAssistant(String model, AssistantCreationOptions options, CancellationToken cancellationToken)
         at Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests.CreateChatClient() in C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.OpenAI.Tests\OpenAIAssistantChatClientIntegrationTests.cs:line 32
         at Microsoft.Extensions.AI.ChatClientIntegrationTests..ctor() in C:\src\dotnet\extensions\test\Libraries\Microsoft.Extensions.AI.Integration.Tests\ChatClientIntegrationTests.cs:line 39
         at Microsoft.Extensions.AI.OpenAIAssistantChatClientIntegrationTests..ctor()
         at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)

I think I had to add an assistant playground and deploy an assistant.

I did that and still no change.

I am able to run most of other integration tests on my Azure OpenAI deployment.

ericstj avatar Dec 12 '25 21:12 ericstj

Yeah, they won't work with Azure. While most of Azure OpenAI can be used with the base OpenAIClient, currently Assistants (and I believe Realtime) require entering with the derived AzureOpenAIClient.

stephentoub avatar Dec 12 '25 21:12 stephentoub