Update app.py
Browse filesuse r1 and support py files
app.py
CHANGED
|
@@ -42,7 +42,7 @@ def read_file_tool(file_name: str) -> str:
|
|
| 42 |
download_file(file_name)
|
| 43 |
file_type = file_name.split(".")[-1]
|
| 44 |
try:
|
| 45 |
-
if file_type
|
| 46 |
with open(file_name, "r", encoding="utf-8") as f:
|
| 47 |
return f.read()
|
| 48 |
elif file_type == "json":
|
|
@@ -87,7 +87,8 @@ def reverse_string_tool(text: str) -> str:
|
|
| 87 |
|
| 88 |
# --- Agent ---
|
| 89 |
# MODEL_ID = "Qwen/Qwen3-8B"
|
| 90 |
-
MODEL_ID = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
|
|
|
| 91 |
PROVIDER = "auto"
|
| 92 |
TOOLS = [read_file_tool, reverse_string_tool, search_tool, visit_webpage_tool, final_answer_tool]
|
| 93 |
AUTORIZED_IMPORTS = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "requests", "csv", "urllib"]
|
|
@@ -113,9 +114,9 @@ When given a question:
|
|
| 113 |
- If you are asked for a string, don't use articles, nor abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
| 114 |
- If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
| 115 |
- Only answer after you have gathered enough information by reading the actual page contents.
|
| 116 |
-
- Once you have the final answer, you must call `
|
| 117 |
-
- Do not retry or execute anything else after calling `
|
| 118 |
-
- `
|
| 119 |
- Provide ONLY the precise answer requested.
|
| 120 |
- Do not include explanations, steps, reasoning, or additional text.
|
| 121 |
- Be direct and specific. GAIA benchmark requires exact matching answers.
|
|
|
|
| 42 |
download_file(file_name)
|
| 43 |
file_type = file_name.split(".")[-1]
|
| 44 |
try:
|
| 45 |
+
if file_type in {"txt", "py"}:
|
| 46 |
with open(file_name, "r", encoding="utf-8") as f:
|
| 47 |
return f.read()
|
| 48 |
elif file_type == "json":
|
|
|
|
| 87 |
|
| 88 |
# --- Agent ---
|
| 89 |
# MODEL_ID = "Qwen/Qwen3-8B"
|
| 90 |
+
# MODEL_ID = "Qwen/Qwen3-235B-A22B-Thinking-2507"
|
| 91 |
+
MODEL_ID = "deepseek-ai/DeepSeek-R1"
|
| 92 |
PROVIDER = "auto"
|
| 93 |
TOOLS = [read_file_tool, reverse_string_tool, search_tool, visit_webpage_tool, final_answer_tool]
|
| 94 |
AUTORIZED_IMPORTS = ["pandas", "numpy", "datetime", "json", "re", "math", "os", "requests", "csv", "urllib"]
|
|
|
|
| 114 |
- If you are asked for a string, don't use articles, nor abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise.
|
| 115 |
- If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string.
|
| 116 |
- Only answer after you have gathered enough information by reading the actual page contents.
|
| 117 |
+
- Once you have the final answer, you must call `final_answer_tool("your_answer")` immediately after printing it.
|
| 118 |
+
- Do not retry or execute anything else after calling `final_answer_tool`.
|
| 119 |
+
- `final_answer_tool` must wrap the exact printed value.
|
| 120 |
- Provide ONLY the precise answer requested.
|
| 121 |
- Do not include explanations, steps, reasoning, or additional text.
|
| 122 |
- Be direct and specific. GAIA benchmark requires exact matching answers.
|