I could be mistaken - but I am reasonably confident the streaming option is not working with the new chat endpoint. (Has anyone got it working)
When I make a blocking call (streaming=false), I get a message. (id removed for privacy reasons, also manually spaced to highlight the role response)
{"id":"","object":"chat.completion","created":1677718504,"model":"gpt-3.5-turbo-0301","usage":{"prompt_tokens":8,"completion_tokens":11,"total_tokens":19},
"choices":[{"message":
{"role":"assistant","content":"Hello! How can I assist you today?"},
"finish_reason":"stop","index":0}]}
When I make an async (streaming=true) call, I also get a valid response - but the assistant text is blank.
{"id":"","object":"chat.completion.chunk","created":1677718890,"model":"gpt-3.5-turbo-0301",
"choices":[{"delta":
{"role":"assistant"},
"index":0,"finish_reason":null}]}
Notice the choices is a delta instead of a message. The next part of the async loop returns a blank string (no content - but the connection is still up and running with the API - Done is never received)
It never sends the [DONE] tag and gets stuck in a timeout loop (possibly hanging the connections at OpenAI’s end too)
This is for the same request. The only difference is the streaming true/false setting.