feat: support command in mcp

This commit is contained in:
ulleo
2025-12-25 11:28:00 +08:00
committed by ulleo
parent 3ae0f25d99
commit 6039c68f88
+5 -1
View File
@@ -357,7 +357,11 @@ async def analysis_or_predict(session: SessionDep, current_user: CurrentUser, ch
traceback.print_exc()
if stream:
def _err(_e: Exception):
yield 'data:' + orjson.dumps({'content': str(_e), 'type': 'error'}).decode() + '\n\n'
if in_chat:
yield 'data:' + orjson.dumps({'content': str(_e), 'type': 'error'}).decode() + '\n\n'
else:
yield f'❌ **ERROR:**\n'
yield f'> {str(_e)}\n'
return StreamingResponse(_err(e), media_type="text/event-stream")
else: