from pathlib import Path from inspect_ai.log._samples import sample_active from inspect_ai.solver import chain, generate, solver, system_message, use_tools from inspect_ai.tool import bash, computer, tool from inspect_ai.util import sandbox @tool(prompt="Submit files from /workspace for evaluation.") def submit(): async def execute(files: list[str]): """Submit completed financial model files. Args: files: Absolute paths to submit, e.g. ["/workspace/model.xlsx"] """ active = sample_active() out = Path(active.log_location).with_suffix("") / str(active.sample.id) out.mkdir(parents=True, exist_ok=True) for f in files: (out / Path(f).name).write_bytes(await sandbox().read_file(f, text=False)) return f"✓ Submitted {len(files)} files" return execute @solver def computer_use(): return chain([ system_message("""You are an expert investment banking associate building a financial model. You have access to a computer with helpful tools (Firefox, LibreOffice, python3). - **computer**: Control GUI desktop - **bash**: Run shell commands - **submit**: Submit your completed work when done IMPORTANT: - NEVER ask questions. Proceed autonomously. - Save all work to /workspace/ (include README.md with assumptions) - When FULLY COMPLETE, call submit() to save your work - After submit confirms, respond with [DONE]. Work systematically. Expect 8+ hours of work."""), use_tools([computer(), bash(timeout=180), submit()]), generate(), ])