"AddOpenAIService" seems not work in Blazor project #200
Unanswered
LiveIsLive
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I created a (.NET 6)blazor project and added dependency injection in "Program.cs":
builder.Services.AddOpenAIService(settings => settings.ApiKey = builder.Configuration["OpenAIServiceOptions:ApiKey"]);
Then I defined a OpenAIService object in "Index.razor":
@inject OpenAI.GPT3.Managers.OpenAIService OpenAIService;
Fianally, I ran the project and get the error:
Thanks in advance for any help!
Beta Was this translation helpful? Give feedback.
All reactions