Something seems to be breaking my Azure Search Service.

Dirk Broenink 105 Reputation points
2024-04-29T14:13:17.31+00:00

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\":\"&lt....

It stops here after many thousands of characters after "Inhoud" which is one big string.

Also, what are all these slashes doing there anyway?

Azure AI Language
Azure AI Language
An Azure service that provides natural language capabilities including sentiment analysis, entity extraction, and automated question answering.
363 questions
Azure AI services
Azure AI services
A group of Azure services, SDKs, and APIs designed to make apps more intelligent, engaging, and discoverable.
2,436 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Dirk Broenink 105 Reputation points
    2024-05-02T08:28:19.34+00:00

    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.

    1 person found this answer helpful.
    0 comments No comments