-
-
Notifications
You must be signed in to change notification settings - Fork 529
Edit
Tolga Kayhan edited this page Feb 16, 2023
·
1 revision
Important: Edit endpoint works with only edit Models. If you use TextDavinci instead of TextEditDavinci you will get an error from the OpenAI service.
var completionResult = await sdk.Edit.CreateEdit(new EditCreateRequest()
{
Input = "What day of the wek is it?",
Instruction = "Fix the spelling mistakes",
Model = Models.TextEditDavinciV1
});
if (completionResult.Successful)
{
Console.WriteLine(completionResult.Choices.FirstOrDefault());
}
else
{
if (completionResult.Error == null)
{
throw new Exception("Unknown Error");
}
Console.WriteLine($"{completionResult.Error.Code}: {completionResult.Error.Message}");
}