Update tool.py
Browse files
tool.py
CHANGED
|
@@ -45,42 +45,6 @@ class VisitTool(Tool):
|
|
| 45 |
header, content = self.browser._state()
|
| 46 |
return header.strip() + "\n=======================\n" + content
|
| 47 |
|
| 48 |
-
class SystemPromptTool(Tool):
|
| 49 |
-
name = "system_prompt"
|
| 50 |
-
description = "Generate a system prompt based on the intent."
|
| 51 |
-
inputs = {"intent": {"type": "string", "description": "The intent for which to generate the system prompt."}}
|
| 52 |
-
output_type = "string"
|
| 53 |
-
|
| 54 |
-
def generate_system_prompt(intent: str) -> str:
|
| 55 |
-
system_prompt = (
|
| 56 |
-
"You are a concise assistant. "
|
| 57 |
-
"Always respond with a **minimal**, **direct** answer. "
|
| 58 |
-
"Do not include any explanations, reasoning, or additional context."
|
| 59 |
-
)
|
| 60 |
-
|
| 61 |
-
if intent == "count":
|
| 62 |
-
system_prompt += " Respond with a single number only."
|
| 63 |
-
elif intent == "name":
|
| 64 |
-
system_prompt += " Respond with only the name."
|
| 65 |
-
elif intent == "date":
|
| 66 |
-
system_prompt += " Respond with only the date or year."
|
| 67 |
-
elif intent == "location":
|
| 68 |
-
system_prompt += " Respond with only the location."
|
| 69 |
-
elif intent == "fact":
|
| 70 |
-
system_prompt += " Respond with the minimal factual answer only."
|
| 71 |
-
elif intent == "yes_or_no":
|
| 72 |
-
system_prompt += " Respond with 'Yes' or 'No' only."
|
| 73 |
-
elif intent == "code":
|
| 74 |
-
system_prompt += " Respond with the code snippet only."
|
| 75 |
-
elif intent == "definition":
|
| 76 |
-
system_prompt += " Respond with the definition only."
|
| 77 |
-
elif intent == "list":
|
| 78 |
-
system_prompt += " Respond with a comma-separated list only."
|
| 79 |
-
else:
|
| 80 |
-
system_prompt += " Respond as briefly as possible."
|
| 81 |
-
|
| 82 |
-
return system_prompt
|
| 83 |
-
|
| 84 |
class Browser:
|
| 85 |
def __init__(self):
|
| 86 |
self.current_page = None
|
|
|
|
| 45 |
header, content = self.browser._state()
|
| 46 |
return header.strip() + "\n=======================\n" + content
|
| 47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
class Browser:
|
| 49 |
def __init__(self):
|
| 50 |
self.current_page = None
|