-
-
Notifications
You must be signed in to change notification settings - Fork 529
Completions
Tolga Kayhan edited this page Feb 16, 2023
·
1 revision
var completionResult = await openAiService.Completions.CreateCompletion(new CompletionCreateRequest()
{
Prompt = "Once upon a time",
Model = Models.TextDavinciV3
});
var completionResult = await sdk.Completions.CreateCompletion(new CompletionCreateRequest()
{
Prompt = "Once upon a time"
}, Models.TextDavinciV3);
if (completionResult.Successful)
{
Console.WriteLine(completionResult.Choices.FirstOrDefault());
}
else //handle errors
{
if (completionResult.Error == null)
{
throw new Exception("Unknown Error");
}
Console.WriteLine($"{completionResult.Error.Code}: {completionResult.Error.Message}");
}