mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-27 13:57:46 +00:00
fix(chatgpt): Resolve async response issue with Azure GPT-4o API (#1772)
This commit is contained in:
parent
d754168ede
commit
5bd946fbdd
@ -262,6 +262,9 @@ class OpenAILLMClient(ProxyLLMClient):
|
|||||||
async for r in chat_completion:
|
async for r in chat_completion:
|
||||||
if len(r.choices) == 0:
|
if len(r.choices) == 0:
|
||||||
continue
|
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:
|
if r.choices[0].delta.content is not None:
|
||||||
content = r.choices[0].delta.content
|
content = r.choices[0].delta.content
|
||||||
text += content
|
text += content
|
||||||
|
Loading…
Reference in New Issue
Block a user