Fix some ruff issues in code

This commit is contained in:
2025-12-07 05:33:39 +01:00
parent 7c9598f632
commit 10704896f9
12 changed files with 27 additions and 28 deletions
+7 -2
View File
@@ -207,7 +207,9 @@ async def chat_completions(chat_request: ChatCompletionRequest):
async def event_generator():
try:
# Stream the agent execution
async for chunk in agent.step_streaming(user_input, completion_id, created_ts, chat_request.model):
async for chunk in agent.step_streaming(
user_input, completion_id, created_ts, chat_request.model
):
yield f"data: {json.dumps(chunk, ensure_ascii=False)}\n\n"
yield "data: [DONE]\n\n"
except LLMAPIError as e:
@@ -237,7 +239,10 @@ async def chat_completions(chat_request: ChatCompletionRequest):
"choices": [
{
"index": 0,
"delta": {"role": "assistant", "content": "Internal agent error"},
"delta": {
"role": "assistant",
"content": "Internal agent error",
},
"finish_reason": "stop",
}
],