Skip to content

Commit 7655012

Browse files
committed
feat: support command in mcp
1 parent c1393f3 commit 7655012

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backend/apps/chat/api/chat.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,11 @@ async def analysis_or_predict(session: SessionDep, current_user: CurrentUser, ch
357357
traceback.print_exc()
358358
if stream:
359359
def _err(_e: Exception):
360-
yield 'data:' + orjson.dumps({'content': str(_e), 'type': 'error'}).decode() + '\n\n'
360+
if in_chat:
361+
yield 'data:' + orjson.dumps({'content': str(_e), 'type': 'error'}).decode() + '\n\n'
362+
else:
363+
yield f'❌ **ERROR:**\n'
364+
yield f'> {str(_e)}\n'
361365

362366
return StreamingResponse(_err(e), media_type="text/event-stream")
363367
else:

0 commit comments

Comments
 (0)