At the moment, we get the output text by API unformatted.
ChatGPT replied to use the format=“html” parameter, but that parameter didn’t work.
The question is, maybe there is an option how to get the formatted text, or maybe there is some other way?
import openai openai.api_key = "YOUR_API_KEY" prompt = "Generate a short story about a haunted house." model = "text-davinci-002" temperature = 0.5 max_tokens = 50 format = "html" response = openai.Completion.create( engine=model, prompt=prompt, temperature=temperature, max_tokens=max_tokens, format=format ) output_text = response.choices.text print(output_text)