Skip to content

Commit

Permalink
Fixed to use the instructions API instead
Browse files Browse the repository at this point in the history
  • Loading branch information
craigloewen-msft committed May 15, 2024
1 parent c7c1cd3 commit 53502c1
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,13 @@ public string GetAICompletion(string systemInstructions, string userMessage)
{
OpenAIClient azureAIClient = new OpenAIClient(_openAIKey);

var response = azureAIClient.GetChatCompletions(
new ChatCompletionsOptions()
var response = azureAIClient.GetCompletions(
new CompletionsOptions()
{
DeploymentName = "gpt-3.5-turbo",
Messages =
DeploymentName = "gpt-3.5-turbo-instruct",
Prompts =
{
new ChatRequestSystemMessage(systemInstructions),
new ChatRequestUserMessage(userMessage),
systemInstructions + "\n\n" + userMessage,
},
Temperature = 0.01F,
MaxTokens = 2000,
Expand All @@ -91,7 +90,7 @@ public string GetAICompletion(string systemInstructions, string userMessage)
Console.WriteLine("Cut off due to length constraints");
}

return response.Value.Choices[0].Message.Content;
return response.Value.Choices[0].Text;
}

public AICompletionsResponse AIFormatString(string inputInstructions, string inputString)
Expand Down

0 comments on commit 53502c1

Please sign in to comment.