By default the result of JavaScript JSON.stringify(<json>)
doesn’t pretty
print, i.e. gives non-pretty result. To get a pretty printed result, one can
for example use JSON.stringify(<json>, null, 2)
:
space
Optional
A string or number that’s used to insert white space (including
indentation, line break characters, etc.) into the output JSON
string for readability purposes.
JSON.stringify() - JavaScript | MDN
In SWI-Prolog it seems to me its the other way around. The default is
pretty printing. Is there also an option to switch off pretty printing? Here
is an example result that shows that spaces and newline is inserted:
?- atom_json_term(Request, _{model:'text-davinci-003',
prompt:'Generate a single random multiple choice quizz about Switzerland',
max_tokens:100,
temperature:0.7,
n:1}, []).
Request = '{\n "max_tokens":100,\n "model":"text-davinci-003",\n "n":
1,\n "prompt":"Generate a single random multiple choice quizz about
Switzerland",\n "temperature":0.7\n}'.