How to add a page break to a JSON response

Hi Team,
I am calling an API to get my PDF converted into JSON format text. And this converted JSON text’s need to be applied for calling ChatGPT. The problem is ChatGPT expects these inputs with a pagebreak (\n) after each statement. So far I haven’t managed to get a solution to this, as how to add a page break. And I would really appreciate if someone can help.

Example -
My input content for ChatGPT is “I want the summary about the following profile to understand their skillsets. Break and group it based on each skillset”. So this must be passed as below, where I need \n to be added after each statement.
{
“model”: “gpt-3.5-turbo”,
“messages”: [
{
“role”: “system”,
“content”: “Act as an HR personnel to shortlist the candidate based on skillset”
},
{
“role”: “user”,
“content”: “I want the summary about the following profile to understand their skillset. \n Break and group it based on each skillset”
}
]
}

Why does GPT need line spacing?

In your code where you have \n, it needs to be \n…

ok for some reason it’s not showing here, but, you need a double backslash instead of just 1.

It’s because when the following was tried, then it threw an error and the OpenAI tex t API expects a proper JSON formatted message in a strigified mode.

So the following manual changed to the code worked. But again the issue was it was manual.

So I wanted to understand if there is a better to deal with kind of an issue.

1 Like

Yep its the line breaks causing the issue, you can use the Operators and comparisons - Bubble Docs and it should format that correctly for you :slight_smile:

Thanks everyone for your suggestions. I found a way to solve this. Instead of “body text”, if I take “error body text”, then I get everything in JSON format, so that I don’t have to set the page break manually.