Closed nkidambi closed 1 year ago
Got the answer from Discord.
If referencing the Azure.AI.OpenAI package in the same project, beta 6 has a breaking change that’s incompatible with the current version of SK. Either downgrade to beta 5 or wait for the next SK release which updated to beta 6.
GenerateMessageAsync
on AzureChatCompletion object, I get the above error message. Below is my code_chatRequestSettings.MaxTokens = maxTokens; _chatHistory.AddMessage(AuthorRole.User, prompt); string reply = await _chatGPT.GenerateMessageAsync(_chatHistory, _chatRequestSettings).ConfigureAwait(false);
To Reproduce Steps to reproduce the behavior:
Expected behavior The response from Azure OpenAI is returned.
Platform
Additional context I tried with
ChatCompletionsAsync
method too. Got the same error. Below is the exception detail -System.AggregateException HResult=0x80131500 Message=One or more errors occurred. (Method not found: 'Void Azure.AI.OpenAI.ChatCompletionsOptions.set_ChoicesPerPrompt(System.Nullable`1)'.)
Source=System.Private.CoreLib
StackTrace:
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
at System.Threading.Tasks.Task.Wait()
at AIArt.UI.Business.OpenAIManager.GenerateGeneralResponse(String flowText, String prompt) in C:\Kidambi\GitHub\nkidambi\AIArT\AIArt.UI.Business\OpenAIManager.cs:line 20
at AIArt.Wpf.UserControls.ChatControl.d__7.MoveNext() in C:\Kidambi\GitHub\nkidambi\AIArT\AIArt.Wpf\UserControls\ChatControl.xaml.cs:line 43
This exception was originally thrown at this call stack: [External Code] Microsoft.SemanticKernel.AI.ChatCompletion.ChatCompletionExtensions.GenerateMessageAsync(Microsoft.SemanticKernel.AI.ChatCompletion.IChatCompletion, Microsoft.SemanticKernel.AI.ChatCompletion.ChatHistory, Microsoft.SemanticKernel.AI.ChatCompletion.ChatRequestSettings, System.Threading.CancellationToken) in ChatCompletionExtensions.cs AIArt.UI.Business.SemanticKernelManager.GetChatGPTResponse(string, string, int) in SemanticKernelManager.cs AIArt.UI.Business.OpenAIManager.GenerateGeneralResponse.AnonymousMethod__0() in OpenAIManager.cs
Inner Exception 1: MissingMethodException: Method not found: 'Void Azure.AI.OpenAI.ChatCompletionsOptions.set_ChoicesPerPrompt(System.Nullable`1)'.