File tree 1 file changed +9
-5
lines changed
1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -201,14 +201,18 @@ async def inner():
201
201
try :
202
202
async for chunk in response :
203
203
# Check if choices exists and is not empty
204
- if not hasattr (chunk , ' choices' ) or not chunk .choices :
204
+ if not hasattr (chunk , " choices" ) or not chunk .choices :
205
205
logger .warning (f"Received chunk without choices: { chunk } " )
206
206
continue
207
-
207
+
208
208
# Check if delta exists and has content
209
- if not hasattr (chunk .choices [0 ], 'delta' ) or not hasattr (chunk .choices [0 ].delta , 'content' ):
210
- logger .warning (f"Received chunk without delta content: { chunk .choices [0 ]} " )
211
- continue
209
+ if not hasattr (chunk .choices [0 ], "delta" ) or not hasattr (
210
+ chunk .choices [0 ].delta , "content"
211
+ ):
212
+ logger .warning (
213
+ f"Received chunk without delta content: { chunk .choices [0 ]} "
214
+ )
215
+ continue
212
216
content = chunk .choices [0 ].delta .content
213
217
if content is None :
214
218
continue
You can’t perform that action at this time.
0 commit comments