Unfucked gemini's mess
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
"""Tests for PromptBuilder."""
|
||||
|
||||
|
||||
from agent.prompts import PromptBuilder
|
||||
from agent.registry import make_tools
|
||||
|
||||
@@ -22,7 +21,7 @@ class TestPromptBuilder:
|
||||
|
||||
prompt = builder.build_system_prompt()
|
||||
|
||||
assert "AI agent" in prompt
|
||||
assert "AI assistant" in prompt
|
||||
assert "media library" in prompt
|
||||
assert "AVAILABLE TOOLS" in prompt
|
||||
|
||||
@@ -106,7 +105,7 @@ class TestPromptBuilder:
|
||||
|
||||
prompt = builder.build_system_prompt()
|
||||
|
||||
assert "LAST ERROR" in prompt
|
||||
assert "RECENT ERRORS" in prompt
|
||||
assert "API timeout" in prompt
|
||||
|
||||
def test_includes_workflow(self, memory):
|
||||
@@ -189,16 +188,9 @@ class TestPromptBuilder:
|
||||
assert "Torrent 0" in prompt or "1." in prompt
|
||||
assert "... and" in prompt or "more" in prompt
|
||||
|
||||
def test_json_format_in_prompt(self, memory):
|
||||
"""Should include JSON format instructions."""
|
||||
tools = make_tools()
|
||||
builder = PromptBuilder(tools)
|
||||
|
||||
prompt = builder.build_system_prompt()
|
||||
|
||||
assert '"action"' in prompt
|
||||
assert '"name"' in prompt
|
||||
assert '"args"' in prompt
|
||||
# REMOVED: test_json_format_in_prompt
|
||||
# We removed the "action" format from prompts as it was confusing the LLM
|
||||
# The LLM now uses native OpenAI tool calling format
|
||||
|
||||
|
||||
class TestFormatToolsDescription:
|
||||
@@ -261,20 +253,21 @@ class TestFormatEpisodicContext:
|
||||
|
||||
assert "LAST SEARCH" in context
|
||||
assert "ACTIVE DOWNLOADS" in context
|
||||
assert "LAST ERROR" in context
|
||||
assert "RECENT ERRORS" in context
|
||||
|
||||
|
||||
class TestFormatStmContext:
|
||||
"""Tests for _format_stm_context method."""
|
||||
|
||||
def test_empty_stm(self, memory):
|
||||
"""Should return empty string for empty STM."""
|
||||
"""Should return language info even for empty STM."""
|
||||
tools = make_tools()
|
||||
builder = PromptBuilder(tools)
|
||||
|
||||
context = builder._format_stm_context()
|
||||
|
||||
assert context == ""
|
||||
# Should at least show language
|
||||
assert "CONVERSATION LANGUAGE" in context or context == ""
|
||||
|
||||
def test_with_workflow(self, memory):
|
||||
"""Should format workflow."""
|
||||
|
||||
Reference in New Issue
Block a user