File size: 1,570 Bytes
8a0e862
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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(),
    ])