Unable to inject Service #46
-
Most likely a newb question but when I go to add this service to my .net 6 blazor app in the program.cs builder.Services.AddOpenAIService(); I get: Unable to resolve service for type 'OpenAI.GPT3.Managers.OpenAIService' while attempting to activate 'LegendariumUI.Services.AIService'.) I tried copying what you had in your program.cs file however, this line doesnt work for me IConfiguration configuration = builder.Build(); I appreciate any assistance here. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 7 replies
-
Ok, I was able to resolve my problem by dependency injecting the interface into my AIService class instead of the class itself. Doh! Though, when I go to get a picture, the program seems to be saving my User field and Im getting errors saying Code = invalid_organization even though I have put a different value in there. |
Beta Was this translation helpful? Give feedback.
-
I'm lost pls, what's going on?
203900
…On Thu, 29 Dec 2022, 1:07 am Tolga Kayhan, ***@***.***> wrote:
What is your version number?
—
Reply to this email directly, view it on GitHub
<#46 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AY7RNX7DGAZ7BB6VGV2F7NDWPTI3FANCNFSM6AAAAAATLUAGBQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Ok, I was able to resolve my problem by dependency injecting the interface into my AIService class instead of the class itself. Doh!
Though, when I go to get a picture, the program seems to be saving my User field and Im getting errors saying Code = invalid_organization even though I have put a different value in there.