OpenAIClient client = new OpenAIClient(new Uri(openAiEndpoint), new
AzureKeyCredential(openAiApiKey));
var chatCompletionsOptions = new ChatCompletionsOptions
{
Messages =
{
new ChatMessage(ChatRole.System, @"You are the virtual assistance of .."),
new ChatMessage(ChatRole.User, _conversationHistory)
},
Temperature = 0.5f,
MaxTokens = 150,
NucleusSamplingFactor = 0.95f,
FrequencyPenalty = 0,
PresencePenalty = 0,
};
var chatCompletionsResponse = await client.GetChatCompletionsAsync("openaigpt35turbo", chatCompletionsOptions);
string chatbotResponse = chatCompletionsResponse.Value.Choices[0].Message.Content;
I have developed a chatbot using this code(C#). After updating “Azure.Ai.OpenAi” NuGet package from 1.0.0 beta 6 to 2.0.0 beta 2 (latest) this provided code gave errors. How to change this code according to “Azure.Ai.OpenAi” 2.0.0 beta 2 version?