Returns a new edit for the given input and instructions.
createEdit(params)
params
An object with request parameters:
model
An identifier of the model to use.
input optional
The input text.
instructions
Instructions telling how to edit the input.
n optional
The number of edits to generate.
temperature optional
A temperature from 0 to 2 (defaults to 1). Higher values give more random results.
top_p optional
An alternative to temperature.
An object containing response from OpenAI API.
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
}
}