I have solved it on my end. It was not clear to me that sometimes citations are sent incomplete and I have to add multiple incoming half-JSONs together to make a full JSON. I did not expect that behavior! But it works now.
Something seems to be breaking my Azure Search Service.
Sometimes I get the following error message:
VM73:1 Uncaught (in promise) SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>) at send_chat (javascript.js:198:23)
But it's not clear why this happens. My files seem in order, the set-up works, but sometimes it just pops this message.
I've checked the content of the messages and that seems fine.
Clicking the error message gives more information:
{"id":"df6aa837-4883-4028-b2ac-ac5c0e0d2507","model":"gpt-4","created":1714404332,"object":"extensions.chat.completion.chunk","choices":[{"index":0,"delta":{"context":{"messages":[{"role":"tool","content":"{"citations":[{"content":"{\"Wordpress_ID\":10003,\"Titel\":\"Zeist\",\"Inhoud\":\"<....
It stops here after many thousands of characters after "Inhoud" which is one big string.
Also, what are all these slashes doing there anyway?