Hey folks,
I am trying to generate some html content as output from GPT-4. Below is my prompt:
Write a blog post about {{blog_title}} in a {{tone}}. Give your output in the following JSON format, do not produce anything else:
{
"html_content": String
}
However, when I try to load the response using json.loads function in python it fails as \n character in the HTML is not escaped. So I changed my prompt to the following:
Write a blog post about {{blog_title}} in a {{tone}}. ALWAYS use \\n instead of \n for newline in HTML so that I can parse it i.e. NEVER use just \n for newline.
Give your output in the following JSON format, do not produce anything else:
{
"html_content": String
}
But I see it sometimes failing to stick to the prompt, is there any other way to solve this issue?