mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +05:00
feat(ipuaro): add JSON tool call parsing and improve prompts
- Add JSON fallback parsing in ResponseParser for LLMs that prefer JSON - Add tool name aliases (get_functions -> get_lines, etc.) - Improve system prompt with clear tool usage guidelines - Add native Ollama tools support in OllamaClient - Add E2E tests for full workflow with real Ollama
This commit is contained in:
@@ -18,6 +18,7 @@ import {
|
||||
buildInitialContext,
|
||||
type ProjectStructure,
|
||||
SYSTEM_PROMPT,
|
||||
TOOL_REMINDER,
|
||||
} from "../../infrastructure/llm/prompts.js"
|
||||
import { parseToolCalls } from "../../infrastructure/llm/ResponseParser.js"
|
||||
import type { IToolRegistry } from "../interfaces/IToolRegistry.js"
|
||||
@@ -277,6 +278,12 @@ export class HandleMessage {
|
||||
|
||||
messages.push(...session.history)
|
||||
|
||||
// Add tool reminder if last message is from user (first LLM call for this query)
|
||||
const lastMessage = session.history[session.history.length - 1]
|
||||
if (lastMessage?.role === "user") {
|
||||
messages.push(createSystemMessage(TOOL_REMINDER))
|
||||
}
|
||||
|
||||
return messages
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user