You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚡ [agents] Refactor tool handling and add dependency management support
- Add utilize `safe_fileio` for secure file I/O within tool handling, and introduced a dependency retrieval method (`deps`) to manage runtime requirements.
Improves code modularity for better aligns with agent processing flows for code generation and execution.
Implementation Plan: {{ plan | tojson(indent=2) }}
155
153
Working Directory: {{ working_dir }}
156
154
Environment: {{ env | tojson(indent=2) }}
157
155
158
-
Your task is to generate the complete, working Python code that implements the solution. Call the write_file, mkdir, and read_file function tools to inspect and generate the necessary files.
159
-
IMPORTANT:
160
-
1. Generate a single file `solution.py` that contains all the code for the solution, including imports, constants, functions, classes, main guard (`if __name__ == "__main__":`), argument parsing (if needed), execution logic, and docstrings.
161
-
Focus on:
156
+
Your task is to generate the complete, working Python code. Focus points to consider:
162
157
1. Clean, readable code
163
158
2. Proper data handling
164
159
3. Model implementation
165
160
4. Training and evaluation logic
166
161
5. Kaggle submission format
162
+
""".strip()
163
+
)
164
+
)
165
+
166
+
CODE_PROMPT=Template(
167
+
textwrap.dedent(
168
+
"""
169
+
Implement Python code to solve the following task:
170
+
## Task: {{ task }}
171
+
{{ description }}
167
172
168
-
After finalizing the code, you will call the `create_file` function to save the code to `solution.py`
169
-
After the tool calling result is given back, you should also provide the dependencies required to run the code and the command to run the code in a JSON format:
173
+
Make sure to follow the requirements and provide the code in a single Python file. Call any necessary tools to inspect the data.
174
+
Once ready, call the ` create_file ` tool to save the code.
175
+
176
+
The code should include:
177
+
1. A single file `solution.py` that contains all the code for the solution, including imports, constants, functions, classes, main guard (`if __name__ == "__main__":`), argument parsing (if needed), execution logic, and docstrings.
178
+
2. Overwrite existing code; do not supply diffs or partial patches.
179
+
""".strip()
180
+
)
181
+
)
182
+
183
+
CODER_DEPS_PROMPT=Template(
184
+
textwrap.dedent(
185
+
"""
186
+
Look at the latest created code in the chat history and analyze the dependencies required to run the code.
187
+
Providing the dependencies required and the command to run the code in a JSON format.
0 commit comments