Yeah this is an issue. I have managed to get some work around this. I was using gpt-4-vision-preview model and the api when answering mathematical question answers with blackslashes. I will assume you have control on the api response in your website. You can using a library like react-latex-next and provide your input to the component as fomratted(gpt response) you need to format the gpt response with regex:
let result = inputString.replace(/\(/g, ‘$’);
result = result.replace(/\)/g, ‘$’); this will return a clean output that you can then use in the component
1 Like