Hi team!
I have been getting these intermittent llm response chunk json parsing issues. Latest case:
DEFAULT 2024-08-13T10:30:26.180544Z Could not parse message into JSON: {"id":"chatcmpl-9vj5477rfPJ0jx7RqI9jL7jWp25NT","object":"chat.completion.chunk","created":1723545014,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_c9aa9c0491","choices":[{"index":0,"delta":{"content":"
DEFAULT 2024-08-13T10:30:26.181660Z From chunk: [
DEFAULT 2024-08-13T10:30:26.181668Z 'data: {"id":"chatcmpl-9vj5477rfPJ0jx7RqI9jL7jWp25NT","object":"chat.completion.chunk","created":1723545014,"model":"gpt-4o-2024-05-13","system_fingerprint":"fp_c9aa9c0491","choices":[{"index":0,"delta":{"content":"',
DEFAULT 2024-08-13T10:30:26.181672Z '"},"logprobs":null,"finish_reason":null}]}'
DEFAULT 2024-08-13T10:30:26.181675Z ]
DEFAULT 2024-08-13T10:30:26.189158Z iteratorToStream error: SyntaxError: Unterminated string in JSON at position 208 (line 1 column 209)
DEFAULT 2024-08-13T10:30:26.189176Z at JSON.parse (<anonymous>)
DEFAULT 2024-08-13T10:30:26.189179Z at o.<anonymous> (/app/.next/server/chunks/425.js:28:6577)
DEFAULT 2024-08-13T10:30:26.189182Z at Generator.next (<anonymous>)
DEFAULT 2024-08-13T10:30:26.189185Z at o (/app/.next/server/chunks/425.js:28:4834)
DEFAULT 2024-08-13T10:30:26.189188Z at n (/app/.next/server/chunks/425.js:28:4945)
DEFAULT 2024-08-13T10:30:26.189192Z at process.processTicksAndRejections (node:internal/process/task_queues:95:5) 66ba2051041a4d1bd1556822 66bb35b3b6fceb68b275a036
DEFAULT 2024-08-13T10:30:26.189905Z iteratorToStream error
Seems like this json wasn't parsed
{
"id": "chatcmpl-9vj5477rfPJ0jx7RqI9jL7jWp25NT",
"object": "chat.completion.chunk",
"created": 1723545014,
"model": "gpt-4o-2024-05-13",
"system_fingerprint": "fp_c9aa9c0491",
"choices": [
{
"index": 0,
"delta": {
"content": "','"
},
"logprobs": null,
"finish_reason": null
}
]
}