feat: update requirements and enhance task guide UI

- Added core dependencies for file handling (Pillow, openpyxl, python-docx, PyPDF2, chardet) to requirements.txt.
- Modified SandboxRunner to create a dedicated codes directory for task scripts.
- Expanded prompts.py with a list of allowed libraries for code generation.
- Simplified the task guide UI by removing drag-and-drop functionality and enhancing layout and styling for better user experience.
This commit is contained in:
Mimikko-zeus
2026-01-07 00:47:07 +08:00
parent 5fbaa13b38
commit fc11ce8871
12 changed files with 237 additions and 208 deletions

View File

@@ -46,11 +46,13 @@ class SandboxRunner:
self.input_dir = self.workspace / "input"
self.output_dir = self.workspace / "output"
self.logs_dir = self.workspace / "logs"
self.codes_dir = self.workspace / "codes"
# 确保目录存在
self.input_dir.mkdir(parents=True, exist_ok=True)
self.output_dir.mkdir(parents=True, exist_ok=True)
self.logs_dir.mkdir(parents=True, exist_ok=True)
self.codes_dir.mkdir(parents=True, exist_ok=True)
def save_task_code(self, code: str, task_id: Optional[str] = None) -> tuple[str, Path]:
"""
@@ -66,7 +68,7 @@ class SandboxRunner:
if not task_id:
task_id = self._generate_task_id()
code_path = self.workspace / f"task_{task_id}.py"
code_path = self.codes_dir / f"task_{task_id}.py"
code_path.write_text(code, encoding='utf-8')
return task_id, code_path