Fix some ruff issues in code
This commit is contained in:
@@ -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",
|
||||
}
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user