Open Propheticus opened 3 months ago
Great find! @Propheticus
hi @Propheticus, the issue was resolved in our nightlybuild, would you mind retrying it? thank you
@Van-QA Will do as soon as I get Avast to stop sandboxing and blocking the installer.
That works! Also the JSON is formatted with newlines and indents now.
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: no-cache
Connection: keep-alive
Access-Control-Allow-Origin: *
Date: Tue, 09 Apr 2024 07:46:50 GMT
Transfer-Encoding: chunked
{
"choices":[
{
"finish_reason":null,
"index":0,
"message":{
"content":" Positive.",
"role":"assistant"
}
}
],
"created":1712648810,
"id":"pfSUz0sCcSG0jTqmQdlg",
"model":"_",
"object":"chat.completion",
"system_fingerprint":"_",
"usage":{
"completion_tokens":3,
"prompt_tokens":59,
"total_tokens":62
}
}
2 remarks:
The finish_reason is shown as null
. That is normal for chunks that are not the last chunk. The last chunk, or in this case the only 'chunk' should mention the stop reason, e.g. "finish_reason":"stop"
or .."length". Open AI spec.
The Transfer-Encoding: chunked
is still shown in the header while I'd expect a Content-Length: <length>
instead. HTTP header doc.
When calling the /chat/completions API endpoint without
"stream": true
set, the response is indeed a single JSON object of type "chat.completion" and not a streaming of multiple server event lines starting with "data: " followed by objects of type "chat.completion.chunk".So instead of
We get
However, the response header still says:
I would expect a content-type of "application/json" and not "text/event-stream". Also the transfer-encoding: chunked is false.