openai.Completion.create() only ever returns ""

Try the following:

  • remove the stop setting altogether. The AI may be trying to start the completion on a newline and so you might be stopping it before it starts

  • remove the presence_penalty and frequency_penalty for now (I dont think this is related)

  • print the value for chunk so you can a) check it has a value; and b) feed it into the Playground if the changes haven’t helped

  • finally, you could try adding \n\n to the end of each chunk before you call the api

2 Likes