fix: skill injected into system prompt

This commit is contained in:
qixinbo
2026-03-19 17:40:08 +08:00
parent d1c097b4d1
commit 7c9abcadfe
3 changed files with 12 additions and 2 deletions
+10
View File
@@ -135,6 +135,11 @@ async def nanobot_chat(request: ChatRequest):
elif request.route_mode == "chat":
message = f"[System: Normal chat mode. Do NOT use the nl2sql tool]\n{message}"
# Inject instructions for selected skills
if request.skill_ids:
skill_list = ", ".join(request.skill_ids)
message = f"[System: You must prioritize using the following skills/tools to answer the user's request: {skill_list}]\n{message}"
response = await nanobot_service.process_message(
message,
session_id=request.session_id,
@@ -186,6 +191,11 @@ async def nanobot_chat_stream(request: ChatRequest):
elif request.route_mode == "chat":
message = f"[System: Normal chat mode. Do NOT use the nl2sql tool]\n{message}"
# Inject instructions for selected skills
if request.skill_ids:
skill_list = ", ".join(request.skill_ids)
message = f"[System: You must prioritize using the following skills/tools to answer the user's request: {skill_list}]\n{message}"
current_task = asyncio.create_task(
nanobot_service.process_message(
message,