Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -32,25 +32,25 @@ def build_agent():
|
|
| 32 |
}
|
| 33 |
|
| 34 |
def enhancer(state: AgentState):
|
| 35 |
-
sys_msg = """
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
If
|
| 49 |
-
|
| 50 |
-
|
| 51 |
return {
|
| 52 |
"messages": [{"role": "system", "content": sys_msg}] + state["messages"],
|
| 53 |
-
"wiki_table":
|
| 54 |
}
|
| 55 |
|
| 56 |
## The graph
|
|
|
|
| 32 |
}
|
| 33 |
|
| 34 |
def enhancer(state: AgentState):
|
| 35 |
+
sys_msg = """You are a reasoning assistant that can answer complex questions using external tools. You must follow a structured reasoning format and always output a final answer.
|
| 36 |
+
Always follow this step-by-step structure:
|
| 37 |
+
|
| 38 |
+
- Thought: Describe your reasoning.
|
| 39 |
+
- Action: Call a tool, using this format → Action: tool_name(input)
|
| 40 |
+
- Observation: Describe what the tool returned.
|
| 41 |
+
- Repeat Thought → Action → Observation as needed.
|
| 42 |
+
|
| 43 |
+
When you are ready to answer, say:
|
| 44 |
+
|
| 45 |
+
FINAL ANSWER: [your final answer here]
|
| 46 |
+
|
| 47 |
+
Formatting rules for FINAL ANSWER:
|
| 48 |
+
- If a number: no commas, no units unless explicitly asked.
|
| 49 |
+
- If a string: no articles, no abbreviations, digits in plain text.
|
| 50 |
+
- If a comma-separated list: apply the above rules to each element."""
|
| 51 |
return {
|
| 52 |
"messages": [{"role": "system", "content": sys_msg}] + state["messages"],
|
| 53 |
+
"wiki_table": None
|
| 54 |
}
|
| 55 |
|
| 56 |
## The graph
|