Receive response in HTML format GPT4-preview

I’m dying…
We have written a prompt with which you can solve math homework.
Everything works so far so good.
We display the answer in a chat.
To display the answer better, we expect the response HTML format so that we can easily display bolding, lists and tables better.

We have added the following in the prompt, but GPT4 simply ignores it:

Please do not add a final note about how to use the HTML code.
Your answer only in HTML syntax with HTML tags.
Use HTML tags like < ul>, < ol>, < li>, < strong>, < p>
Only consider the inner part of the < body> tag.
ALWAYS use the following tag for new lines: < br />
Do not add CSS attributes.
Your answer must be formatted in HTML format

But if I submit the prompt, then let the user enter the task and then submit this section, then I get the response in HTML format.
However, by taking the extra step I lose time and generate additional costs.
Does anyone know how I can “force” GPT4 to get the response in HTML format?

That is a task that is extremely hard for the latest models, but yet extremely easy for gpt-4-0314.

You can even train that prior model that all output is rendered in an HTML page as dynamic <div> and it will behave exactly as you want.

The only path to success now is to reinforce the use of markdown elements for structure, and to use a commonmark to HTML library for the forum-like formatting it can offer.

Thanks for your answer!
Do you have an idea which HTML library should I use?

How can I train the model to get my output rendered as an HTML page?

Training in this case is not by fine-tune, but by context. System prompting of the AIs purpose, requirements, etc as I describe. Then if unsatisfactory, you can follow that up with few-shot examples of the AI responding with output as desired to a user input.

Like I say, HTML-writing natively and passively is a task that API models 03xx from March are more open to, because they haven’t been massively trained for outputting markdown into ChatGPT’s renderer.

Another option to explore is gpt-4-preview with json response format, or by function calling, where you use thorough schema and function specification to get normal responses to a user into a json, maybe with a “HTML_for_user_display” key.

If you want to go with rendering markdown as ChatGPT does, either for display or documents, it will depend on the language.

Can’t you just say “Please provide the response in HTML format.” as your first sentence? Not sure if the “please” is required. lolz.

Try this worked for me:

Blockquote"chatGptPrompt": "{ in HTML plain text format without ```html. "Length": "Under 200 words", "Format": "Simple HTML tags only (< b >, < blockquote >, < br >, < li >) “}”