Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Azure.AI.OpenAI.ChatCompletions error

Open
#29 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
azure, csharp
Domain
api, backend

Research direction

Start at OpenAIInferenceBackend.GetChatResponseAsync, the entry point named in the stack trace, and inspect how the Azure.AI.OpenAI assembly and OpenAI key are initialized. Reproduce the Blazor Server request and verify that the existing key setup is used without the ChatCompletions TypeLoadException.

Written by the indexing model from the issue text.

Description

There is separate initialization for the Open AI key, etc. It should be able to utilize the existing ones in bigger project.

Integrating Blazor server I'm receiving the following error

fail: Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware[1]
An unhandled exception has occurred while executing the request.
System.TypeLoadException: Could not load type 'Azure.AI.OpenAI.ChatCompletions' from assembly 'Azure.AI.OpenAI, Version=2.0.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'.
at SmartComponents.Inference.OpenAI.OpenAIInferenceBackend.GetChatResponseAsync(ChatParameters options)
at SmartComponents.Inference.SmartTextAreaInference.GetInsertionSuggestionAsync(IInferenceBackend inference, SmartTextAreaConfig config, String textBefore, String textAfter)
at Microsoft.AspNetCore.Builder.SmartComponentsServiceCollectionExtensions.AttachSmartComponentsEndpointsStartupFilter.<>c__DisplayClass0_1.<b__3>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.AspNetCore.Http.RequestDelegateFactory.ExecuteTaskResult[T](Task`1 task, HttpContext httpContext)
at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddlewareImpl.Invoke(HttpContext context)

Dominant language
C#
Stars
510
Forks
61
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/smartcomponents

All issues in dotnet/smartcomponents

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.