fix(chatgpt): Resolve async response issue with Azure GPT-4o API (#1772)

This commit is contained in:
JxQggg
2024-08-05 10:34:44 +08:00
committed by GitHub
parent d754168ede
commit 5bd946fbdd

View File

@@ -262,6 +262,9 @@ class OpenAILLMClient(ProxyLLMClient):
async for r in chat_completion:
if len(r.choices) == 0:
continue
# Check for empty 'choices' issue in Azure GPT-4o responses
if r.choices[0] is not None and r.choices[0].delta is None:
continue
if r.choices[0].delta.content is not None:
content = r.choices[0].delta.content
text += content