Ever since a few hours ago we’re seeing a different behavior with createChatCompletionRequest streaming api which was not present before.
The 2nd payload is always split into 2 chunks:
first chunk :
payloads [
'data: {"id":"chatcmpl-8IaMjS68fE6eEtFvAuzQloHnx1yAd","object":"chat.completion.chunk","created":1699440385,"model":"gpt-4-1106-preview","system_fingerprint":"fp_a24b4d720c","choices":[{"index":0,"delta":{"role":"assistant","content":""},"finish_reason":null}]}',
'data: {"id":"chatcmpl-8IaMjS68fE6eEtFvAuzQloHnx1yAd","object":"ch'
]
2nd chunk holds a continuation of the 2:
payloads [
‘at.completion.chunk",“created”:1699440385,“model”:“gpt-4-1106-preview”,“system_fingerprint”:“fp_a24b4d720c”,“choices”:[{“index”:0,“delta”:{“content”:“```”},“finish_reason”:null}]}’,
‘data: {“id”:“chatcmpl-8IaMjS68fE6eEtFvAuzQloHnx1yAd”,“object”:“chat.completion.chunk”,“created”:1699440385,“model”:“gpt-4-1106-preview”,“system_fingerprint”:“fp_a24b4d720c”,“choices”:[{“index”:0,“delta”:{“content”:“json”},“finish_reason”:null}]}’,
‘data: {“id”:“chatcmpl-8IaMjS68fE6eEtFvAuzQloHnx1yAd”,“object”:“chat.completion.chunk”,“created”:1699440385,“model”:“gpt-4-1106-preview”,“system_fingerprint”:“fp_a24b4d720c”,“choices”:[{“index”:0,“delta”:{“content”:“\n”},“finish_reason”:null}]}’,
‘’
]
I didn’t see any reference this behavior, is this expected? the weird thing is that it’s only the 2nd payload.