Skip to content

Commit a418b18

Browse files
committed
Fix linting
1 parent da09de1 commit a418b18

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

lightrag/llm/openai.py

+9-5
Original file line numberDiff line numberDiff line change
@@ -201,14 +201,18 @@ async def inner():
201201
try:
202202
async for chunk in response:
203203
# 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:
205205
logger.warning(f"Received chunk without choices: {chunk}")
206206
continue
207-
207+
208208
# 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
212216
content = chunk.choices[0].delta.content
213217
if content is None:
214218
continue

0 commit comments

Comments
 (0)