microsoft / BotFramework-Composer

Dialog creation and management for Microsoft Bot Framework Applications
https://docs.microsoft.com/en-us/composer/
MIT License
860 stars 366 forks source link

Command failed: dotnet add package "AzureAI.Community.OpenAI.Bot.Builder.Prompt" --version="1.0.6" --source="https://api.nuget.org/v3/index.json" #9669

Closed AlexGrossi closed 7 months ago

AlexGrossi commented 7 months ago

I can't install OpenAI packages. It throws the error "Restaubot.csproj package "AzureAI.Community.OpenAI.Bot.Builder.SuggestionPrompt" --version="1.0.0-beta.3" --source="https://api.nuget.org/v3/index.json" I am using the latest nightly (v 2.1.3), and I have dotnet framework 3.1 installed. I am using Chrome on Windows.

To Reproduce

Steps to reproduce the behavior:

Go to package manager Try install "AzureAI.Community.OpenAI.Bot.Builder.Prompt"

Expected behavior

The package to install image

dmvtech commented 7 months ago

@AlexGrossi

Found the cause by attempting to add the nuget package in Visual Studio:

Package AzureAI.Community.OpenAI.Bot.Builder.Prompt 1.0.7 is not compatible with netcoreapp3.1 (.NETCoreApp,Version=v3.1).
Package AzureAI.Community.OpenAI.Bot.Builder.Prompt 1.0.7 supports: net7.0 (.NETCoreApp,Version=v7.0)

The runtime that Composer bots uses by default is still 3.1. So, you basically need to update the bot .NET version. All you need to do is modify the line in your .csproj file from: <TargetFramework>netcoreapp3.1</TargetFramework>

To: <TargetFramework>net7</TargetFramework>

You should then be able to add the package. Alternatively, you can just add the following line in your .csproj to add it: <PackageReference Include="AzureAI.Community.OpenAI.Bot.Builder.Prompt" Version="1.0.7" />

And then it should show up when you load the bot in Composer: image