I'm using chat gpt api on my react app. The problem I'm facing is how to format the response from chat gpt. If I ask it to give me a response in a table format it gives a weird response, I'm using pre-tagged to display the text and the response is showing the attached image this way but I want the correct table like chat gpt does if I ask, in the same way it displays as paragraph form instead of any list of items on different lines, so how to format chat GPT response correctly.
I want the correct tables and lists as shown by the chat gpt but this is how I receive the data This is how the data appears when using pre-tagging, but I want the correct table
ChatGPT and the OpenAI API can return data in a format that works for you. Just add formatting instructions to the prompt.
Example:
Return the answer as a JSON object.
Do you know the 10 most popular books by Stephen King? Returns an array of books in a JSON object.
ChatGPT Answer:
You can then fine-tune the results using
ordered by {something}
,group by {something}
, etc.