Replies: 1 comment 2 replies
-
It seems like you're working on a chat app. A more appropriate choice would be to use ChatCompletion instead of Completions. Please refer to this code snippet: var completionResult = await openAiService.ChatCompletion.CreateCompletion(new ChatCompletionCreateRequest
{
Messages = new List<ChatMessage>
{
ChatMessage.FromSystem("You are a helpful assistant."),
ChatMessage.FromUser("Who won the world series in 2020?"),
ChatMessage.FromAssistant("The Los Angeles Dodgers won the World Series in 2020."),
ChatMessage.FromUser("Where was it played?")
},
Model = Models.ChatGpt3_5Turbo,
MaxTokens = 50//optional
});
if (completionResult.Successful)
{
Console.WriteLine(completionResult.Choices.First().Message.Content);
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
hello,
I was wondering if I was the only one experiencing this, has nothing to do with this library per say but, I'm taking a chance in case someone experienced this :
Here's my code (nothing fancy)
if (input.ToLower() != "exit")
{
var completionResult = await sdk.Completions.CreateCompletion(new CompletionCreateRequest
{
Prompt = input,
Model = Models.Davinci,
});
Here is the behavior I'm experimenting while using my app:
You: test
Assistant: FreqTable": { "type": "list_of_integers",
You: hello?
Assistant: sp= visiting.20room7.20:.556?cb=t
I even seem to be getting questions from other users as answers, occasionally any have any idea what going on?
Beta Was this translation helpful? Give feedback.
All reactions