Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -191,25 +191,15 @@ ragent_client = OpenAI(
|
|
| 191 |
api_key=ACCESS_TOKEN,
|
| 192 |
)
|
| 193 |
|
| 194 |
-
SYSTEM_PROMPT = """
|
| 195 |
|
| 196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 197 |
|
| 198 |
-
1. **Thought:**
|
| 199 |
-
- Analyze the problem and explain your reasoning.
|
| 200 |
-
- Identify any necessary tools or techniques.
|
| 201 |
-
|
| 202 |
-
2. **Code:**
|
| 203 |
-
- Implement the solution using Python.
|
| 204 |
-
- Enclose the code block with `<end_code>`.
|
| 205 |
-
|
| 206 |
-
3. **Observation:**
|
| 207 |
-
- Explain the output and verify correctness.
|
| 208 |
-
|
| 209 |
-
4. **Final Answer:**
|
| 210 |
-
- Summarize the solution clearly.
|
| 211 |
-
|
| 212 |
-
Always adhere to the **Thought → Code → Observation → Final Answer** structure.
|
| 213 |
"""
|
| 214 |
|
| 215 |
def ragent_reasoning(prompt: str, history: list[dict], max_tokens: int = 512, temperature: float = 0.7, top_p: float = 0.95):
|
|
|
|
| 191 |
api_key=ACCESS_TOKEN,
|
| 192 |
)
|
| 193 |
|
| 194 |
+
SYSTEM_PROMPT = """
|
| 195 |
|
| 196 |
+
"You are an expert assistant who solves tasks using Python code. Follow these steps:\n"
|
| 197 |
+
"1. **Thought**: Explain your reasoning and plan for solving the task.\n"
|
| 198 |
+
"2. **Code**: Write Python code to implement your solution.\n"
|
| 199 |
+
"3. **Observation**: Analyze the output of the code and summarize the results.\n"
|
| 200 |
+
"4. **Final Answer**: Provide a concise conclusion or final result.\n\n"
|
| 201 |
+
f"Task: {task}"
|
| 202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 203 |
"""
|
| 204 |
|
| 205 |
def ragent_reasoning(prompt: str, history: list[dict], max_tokens: int = 512, temperature: float = 0.7, top_p: float = 0.95):
|