mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 06:55:57 +08:00
fix: [azure_openai] Error: 'NoneType' object has no attribute 'content' (#3389)
This commit is contained in:
parent
e76693cad9
commit
b699945b47
@ -343,8 +343,12 @@ class AzureOpenAILargeLanguageModel(_CommonAzureOpenAI, LargeLanguageModel):
|
|||||||
|
|
||||||
delta = chunk.choices[0]
|
delta = chunk.choices[0]
|
||||||
|
|
||||||
if delta.finish_reason is None and (delta.delta.content is None or delta.delta.content == '') and \
|
# Handling exceptions when content filters' streaming mode is set to asynchronous modified filter
|
||||||
delta.delta.function_call is None:
|
if delta.delta is None or (
|
||||||
|
delta.finish_reason is None
|
||||||
|
and (delta.delta.content is None or delta.delta.content == '')
|
||||||
|
and delta.delta.function_call is None
|
||||||
|
):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# assistant_message_tool_calls = delta.delta.tool_calls
|
# assistant_message_tool_calls = delta.delta.tool_calls
|
||||||
|
Loading…
x
Reference in New Issue
Block a user