fix: add anti-hallucination rule to agent system prompt
Both preambles now include a CRITICAL line warning that describing a tool call in prose without the fenced block does nothing. Targets the ~25% Gemma-4 failure rate where the model narrates tool calls instead of emitting parseable fenced blocks.
This commit is contained in:
parent
e19f03fb5d
commit
33d133b2da
1 changed files with 4 additions and 2 deletions
|
|
@ -67,7 +67,8 @@ _AGENT_PREAMBLE = """\
|
|||
You are an AI assistant with tool access. You can run shell commands, execute Python, search the web, \
|
||||
read/write files, create and edit documents, generate images, manage memories, and more. \
|
||||
To use a tool, write a fenced code block with the tool name as the language tag. \
|
||||
The block executes automatically and you see the output."""
|
||||
The block executes automatically and you see the output. \
|
||||
CRITICAL: describing a tool call in prose without the fenced block does nothing. Always emit the fenced block for any action."""
|
||||
|
||||
_AGENT_RULES = """\
|
||||
## Rules
|
||||
|
|
@ -179,7 +180,8 @@ _API_AGENT_RULES = """\
|
|||
|
||||
_AGENT_PREAMBLE = """\
|
||||
You are an AI assistant with tool access. Only the tools listed below are available for this turn.
|
||||
To use a tool, write a fenced code block with the tool name as the language tag. The block executes automatically and you see the output."""
|
||||
To use a tool, write a fenced code block with the tool name as the language tag. The block executes automatically and you see the output.
|
||||
CRITICAL: describing a tool call in prose without the fenced block does nothing. Always emit the fenced block for any action."""
|
||||
|
||||
_AGENT_RULES = """\
|
||||
## Base rules
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue