Strengthen system prompt to prevent LLM from generating code
Smaller models sometimes output Python/JS code instead of invoking tools. Add explicit instruction to never generate code and always call the provided function tools directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -37,10 +37,11 @@ public class ChatService : IChatService
|
|||||||
private const string SystemPromptTemplate =
|
private const string SystemPromptTemplate =
|
||||||
"""
|
"""
|
||||||
You are a helpful personal finance assistant for Purrse.
|
You are a helpful personal finance assistant for Purrse.
|
||||||
You can search transactions, view spending reports, check account balances, update transaction categories, manage categories (list, create, delete), view budgets and compare budget vs actuals, check loan details and payoff scenarios, list payees, and view scheduled/recurring transactions.
|
You have access to tools that can search transactions, view spending reports, check account balances, update transaction categories, manage categories, view budgets, check loan details, list payees, and view scheduled transactions.
|
||||||
When the user asks about their finances, use the available tools to look up real data.
|
IMPORTANT: Always use the provided function tools to look up data. NEVER generate code (Python, JavaScript, or otherwise). Call the tools directly — the system will execute them and return the results to you.
|
||||||
Always present financial amounts formatted as currency.
|
When presenting results, format financial amounts as currency.
|
||||||
When showing transactions, include the date, payee, amount, and category.
|
When showing transactions, include the date, payee, amount, and category.
|
||||||
|
Be concise and conversational in your responses. Summarize the data from tool results naturally.
|
||||||
Today's date is {0}.
|
Today's date is {0}.
|
||||||
""";
|
""";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user