refactor: cleanup old use_websearch param
This commit is contained in:
@@ -54,7 +54,6 @@ class TestChallengeTool:
|
||||
assert "model" not in properties
|
||||
assert "temperature" not in properties
|
||||
assert "thinking_mode" not in properties
|
||||
assert "use_websearch" not in properties
|
||||
assert "continuation_id" not in properties
|
||||
|
||||
def test_request_model_validation(self):
|
||||
|
||||
@@ -131,7 +131,6 @@ class TestConsensusTool:
|
||||
assert "issues_found" not in schema["properties"]
|
||||
assert "temperature" not in schema["properties"]
|
||||
assert "thinking_mode" not in schema["properties"]
|
||||
assert "use_websearch" not in schema["properties"]
|
||||
|
||||
# Images should be present now
|
||||
assert "images" in schema["properties"]
|
||||
|
||||
@@ -63,7 +63,6 @@ class TestPlannerTool:
|
||||
assert "files" not in schema["properties"] # Excluded for planning
|
||||
assert "temperature" not in schema["properties"]
|
||||
assert "thinking_mode" not in schema["properties"]
|
||||
assert "use_websearch" not in schema["properties"]
|
||||
|
||||
# Check required fields
|
||||
assert "step" in schema["required"]
|
||||
|
||||
@@ -1099,19 +1099,16 @@ class BaseTool(ABC):
|
||||
)
|
||||
return result, actually_processed_files
|
||||
|
||||
def get_websearch_instruction(self, use_websearch: bool, tool_specific: Optional[str] = None) -> str:
|
||||
def get_websearch_instruction(self, tool_specific: Optional[str] = None) -> str:
|
||||
"""
|
||||
Generate standardized web search instruction based on the use_websearch parameter.
|
||||
Generate standardized web search instruction.
|
||||
|
||||
Args:
|
||||
use_websearch: Whether web search is enabled
|
||||
tool_specific: Optional tool-specific search guidance
|
||||
|
||||
Returns:
|
||||
str: Web search instruction to append to prompt, or empty string
|
||||
str: Web search instruction to append to prompt
|
||||
"""
|
||||
if not use_websearch:
|
||||
return ""
|
||||
|
||||
base_instruction = """
|
||||
|
||||
|
||||
@@ -796,7 +796,7 @@ class SimpleTool(BaseTool):
|
||||
self._validate_token_limit(content_to_validate, "Content")
|
||||
|
||||
# Add standardized web search guidance
|
||||
websearch_instruction = self.get_websearch_instruction(True, self.get_websearch_guidance())
|
||||
websearch_instruction = self.get_websearch_instruction(self.get_websearch_guidance())
|
||||
|
||||
# Combine system prompt with user content
|
||||
full_prompt = f"""{system_prompt}{websearch_instruction}
|
||||
|
||||
Reference in New Issue
Block a user