Open wzglgo opened 1 year ago
Hi @wzglgo thank you for your feedback. @mssfang could you please follow up?
@wzglgo Thanks for the reach out.
Are you using async client's getChatCompletionsStream?
If not, please check out sample below: Azure ChatCompletions
Hello, through testing, I finally found that the stream mode of azure does not respond one by one token, but many tokens respond once, which is different from openai, and according to the effect, it is also better for openai, You can run the two curls I sent earlier to compare and you can see the difference intuitively. Thank you @mssfang
This is not a sdk problem, but azure problem, but I don't know what channel to submit to azure
@mssfang
Unfortunately, I don't have direct contact. @trrwilson Do you know?
I tried to use curl and javasdk to have this effect. If the interface of openAI is called directly, it is asynchronous
azure
curl --location --request POST 'https://aicharacter.openai.azure.com/openai/deployments/xxxxx/chat/completions?api-version=2023-03-15-preview' \ --header 'Content-Type: application/json' \ --header 'api-key: xxxxx' \ --data-raw '{ "model": "gpt-3.5-turbo", "messages": [{"role":"user","content":"hello"}], "stream":true }'
openAI
curl --location --request POST 'https://api.openai.com/v1/chat/completions' \ --header 'Content-Type: application/json' \ --header 'Authorization: Bearer sk-xxxxxxx' \ --data-raw '{ "model": "gpt-3.5-turbo", "messages": [ {"role": "user", "content": "hello"} ], "stream": true }'