openai / openai-dotnet

The official .NET library for the OpenAI API
https://www.nuget.org/packages/OpenAI
MIT License
1.13k stars 113 forks source link

Installing Openai-dotnet to a .NET Standard project gives error #22

Closed cjkarande closed 3 months ago

cjkarande commented 3 months ago

Installing Openai-dotnet package to a .NET Standard 2.0 project gives following error

NU1108: Cycle detected. OpenAI -> OpenAI (>= 2.0.0-beta.2). Package restore failed. Rolling back package changes for 'OpenAI'.

It is detecting some cyclic dependency

trrwilson commented 3 months ago

Hello, @cjkarande! Can you share a bit more on how you set up the netstandard2.0 project to reproduce this? Creating a new one myself just now (dotnet new console, dotnet add package OpenAI --prerelease, modify .csproj for <TargetFramework>netstandard2.0</TargetFramework>), I see restore and build working as intended. Is there more detail about the reported cycle in the output?

Petermarcu commented 3 months ago

@cjkarande do you have another version of this package OpenAI or another package that references the older version of this package included in the project? We're going to need more information about what else is in your package graph in order to be helpful.

cjkarande commented 3 months ago

@trrwilson sorry for the incomplete info. I am trying to install it in a .Net Standard 2.0 project which is part of Xamarin.Forms Mobile App solution. I am not using a Console App

@Petermarcu I am installing this package for the 1st time in a newly created Xamarin.Forms project.

Petermarcu commented 3 months ago

That is strange. The cycle has nothing in the middle, it just says the package is referencing itself. How are you adding the reference? Can you share what's in your csproj?

Petermarcu commented 3 months ago

Does your project happen to also be named OpenAI?

cjkarande commented 3 months ago

Superb @Petermarcu, that was the problem....Thanks a ton for your lighting fast response

Does your project happen to also be named OpenAI?