fix: skill injected into system prompt
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -264,7 +264,7 @@ export function ChatInterface() {
|
||||
const formattedMessages = data.messages
|
||||
.filter((m) => {
|
||||
if (m.role === 'system' || m.role === 'tool' || m.role === 'function') return false;
|
||||
if (m.role === 'assistant' && m.tool_calls && m.tool_calls.length > 0 && !m.viz) return false;
|
||||
if (m.role === 'assistant' && m.tool_calls && m.tool_calls.length > 0 && !m.viz && (!m.content || m.content.trim() === '')) return false;
|
||||
return true;
|
||||
})
|
||||
.map((m, idx) => ({
|
||||
|
||||
@@ -227,7 +227,7 @@ export function Skills() {
|
||||
</div>
|
||||
</TableCell>
|
||||
<TableCell className="py-4 px-4 text-right">
|
||||
<div className="flex justify-end gap-1">
|
||||
<div className="flex items-center justify-end gap-1">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
|
||||
Reference in New Issue
Block a user