openai.createEdit

Returns a new edit for the given input and instructions.

Syntax

createEdit(params)

Parameters

Return value

An object containing response from OpenAI API.

Examples

await openai.createEdit({
  model: "text-davinci-edit-001",
  input: "Mickey Mouse has a girlfriend Minnie.",
  instruction: "Change characters to Sopranos"
})
{
  object: edit,
  created: 1677142822,
  choices: [{
             text: Tony Soprano is a funeral owner.
                   His wife is Carmela.
                   ,
             index: 0
           }],
  usage: {
           prompt_tokens: 27,
           completion_tokens: 36,
           total_tokens: 63
         }
}

External resources