OkGoDoIt / OpenAI-API-dotnet

An unofficial C#/.NET SDK for accessing the OpenAI GPT-3 API
https://www.nuget.org/packages/OpenAI/
Other
1.86k stars 432 forks source link

IHttpClientFactory Missing a "using" from source code #176

Open Rahios opened 1 year ago

Rahios commented 1 year ago

Hello, this is my first time doing an issue report, so sorry if any info is missing.

I'm following the tutorial from: https://www.youtube.com/watch?v=gI9QSHpiMW0 I'm working with Unity and I'm integrating OpenIA to my project. The procedure is as follows: 1) Download source file 2) Unzip it 3) Put it in the project folder

Then I get the following problem: Compiler Error CS0246 : The type or namespace name 'type/namespace' could not be found (are you missing a using directive or an assembly reference?)

image

I don't know how to fix it, but I will simply just not use it I think, and comment it out. But maybe just using a library could fix it ?

Those are the suggestions for the fix. image

NITechLabs commented 8 months ago

I had the same issue. I solved it in the following way:

  1. On Github go to https://github.com/GlitchEnzo/NuGetForUnity
  2. Go to the Releases and download the Unity Package.
  3. Install it as a package in Unity. This adds a nice NuGet Manager for Unity!
  4. In the menu go to: NuGet-Manage PAckages
  5. In the search box type: Microsoft.Extensions.DependencyInjection and install it
  6. In the search box type: Microsoft.Extensions.Http and install it
  7. In the search box type: Newtonsoft.Json and install it Now the OpenAI will not generate any errors anymore when you drop it into your project!