From 2aeed315b3da2df31b4697d52a272c3aad4c5482 Mon Sep 17 00:00:00 2001 From: qixinbo Date: Thu, 19 Mar 2026 15:24:31 +0800 Subject: [PATCH] nothing --- backend/main.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/backend/main.py b/backend/main.py index 4ff3e5a..f9efc89 100644 --- a/backend/main.py +++ b/backend/main.py @@ -131,9 +131,9 @@ async def nanobot_chat(request: ChatRequest): # Inject instructions if explicitly routed message = request.message if request.route_mode == "sql" or request.prefer_sql_chart: - message = f"[System: User explicitly requested data analysis. Please use the nl2sql tool to answer the following query.]\n{message}" + message = f"[System: Use the nl2sql tool to answer the query]\n{message}" elif request.route_mode == "chat": - message = f"[System: User explicitly requested normal chat. Do NOT use the nl2sql tool.]\n{message}" + message = f"[System: Normal chat mode. Do NOT use the nl2sql tool]\n{message}" response = await nanobot_service.process_message( message, @@ -182,9 +182,9 @@ async def nanobot_chat_stream(request: ChatRequest): # Inject instructions if explicitly routed message = request.message if request.route_mode == "sql" or request.prefer_sql_chart: - message = f"[System: User explicitly requested data analysis. Please use the nl2sql tool to answer the following query.]\n{message}" + message = f"[System: Use the nl2sql tool to answer the query]\n{message}" elif request.route_mode == "chat": - message = f"[System: User explicitly requested normal chat. Do NOT use the nl2sql tool.]\n{message}" + message = f"[System: Normal chat mode. Do NOT use the nl2sql tool]\n{message}" current_task = asyncio.create_task( nanobot_service.process_message( @@ -228,7 +228,7 @@ async def nanobot_chat_stream(request: ChatRequest): if session.messages and session.messages[-1].get("role") == "assistant": session.messages[-1]["viz"] = viz_payload nanobot_service.agent.sessions.save(session) - + for idx in range(0, len(text), STREAM_DELTA_CHUNK_SIZE): chunk = text[idx: idx + STREAM_DELTA_CHUNK_SIZE] yield f"data: {json.dumps({'type': 'delta', 'content': chunk}, ensure_ascii=False)}\n\n"