inspect-swe 0.1.5__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,3 +208,9 @@ __marimo__/
208
208
 
209
209
  # Dynamic version
210
210
  src/inspect_swe/_version.py
211
+
212
+ # Inspect logs
213
+ logs/
214
+
215
+ # MacOS
216
+ .DS_Store
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: inspect_swe
3
- Version: 0.1.5
3
+ Version: 0.2.0
4
4
  Summary: Software engineering agents for Inspect AI.
5
5
  Project-URL: Documentation, https://meridianlabs-ai.github.io/inspect_swe/
6
6
  Project-URL: Source Code, https://github.com/meridianlabs-ai/inspect_swe
@@ -9,11 +9,14 @@ Author: Meridian Labs
9
9
  License: MIT License
10
10
  License-File: LICENSE
11
11
  Requires-Python: >=3.10
12
- Requires-Dist: inspect-ai
12
+ Requires-Dist: inspect-ai>=0.3.125
13
13
  Requires-Dist: typing-extensions>=4.9.0
14
14
  Provides-Extra: dev
15
+ Requires-Dist: anthropic; extra == 'dev'
15
16
  Requires-Dist: mypy; extra == 'dev'
17
+ Requires-Dist: openai; extra == 'dev'
16
18
  Requires-Dist: pytest; extra == 'dev'
19
+ Requires-Dist: pytest-dotenv; extra == 'dev'
17
20
  Requires-Dist: ruff; extra == 'dev'
18
21
  Provides-Extra: doc
19
22
  Requires-Dist: quarto-cli==1.7.31; extra == 'doc'
@@ -21,6 +24,7 @@ Description-Content-Type: text/markdown
21
24
 
22
25
  Welcome to Inspect SWE, a suite of software engineering agents for [Inspect AI](https://inspect.aisi.org.uk/).
23
26
 
27
+ For details on using Inspect SWE, please visit <https://meridianlabs-ai.github.io/inspect_swe/>.
24
28
 
25
29
  ## Installation
26
30
 
@@ -1,5 +1,6 @@
1
1
  Welcome to Inspect SWE, a suite of software engineering agents for [Inspect AI](https://inspect.aisi.org.uk/).
2
2
 
3
+ For details on using Inspect SWE, please visit <https://meridianlabs-ai.github.io/inspect_swe/>.
3
4
 
4
5
  ## Installation
5
6
 
@@ -10,7 +10,7 @@ authors = [{ name = "Meridian Labs" }]
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
12
12
  license = { text = "MIT License" }
13
- dependencies = ["inspect_ai", "typing_extensions>=4.9.0"]
13
+ dependencies = ["inspect_ai>=0.3.125", "typing_extensions>=4.9.0"]
14
14
 
15
15
  [project.urls]
16
16
  Documentation = "https://meridianlabs-ai.github.io/inspect_swe/"
@@ -19,7 +19,7 @@ Documentation = "https://meridianlabs-ai.github.io/inspect_swe/"
19
19
 
20
20
 
21
21
  [project.optional-dependencies]
22
- dev = ["ruff", "mypy", "pytest"]
22
+ dev = ["ruff", "mypy", "pytest", "anthropic", "openai", "pytest-dotenv"]
23
23
  doc = ["quarto-cli==1.7.31"]
24
24
 
25
25
  [tool.hatch.build]
@@ -0,0 +1,56 @@
1
+ from inspect_ai.agent import (
2
+ Agent,
3
+ AgentState,
4
+ agent,
5
+ sandbox_agent_bridge,
6
+ )
7
+ from inspect_ai.model import ChatMessageSystem, ChatMessageUser
8
+ from inspect_ai.util import sandbox
9
+
10
+
11
+ @agent
12
+ def claude_code() -> Agent:
13
+ async def execute(state: AgentState) -> AgentState:
14
+ async with sandbox_agent_bridge(state) as bridge:
15
+ # base options
16
+ cmd = [
17
+ "claude",
18
+ "--print", # run without interactions
19
+ "--dangerously-skip-permissions",
20
+ "--model", # use current inspect model
21
+ "inspect",
22
+ ]
23
+
24
+ # system message
25
+ system_message = "\n\n".join(
26
+ [m.text for m in state.messages if isinstance(m, ChatMessageSystem)]
27
+ )
28
+ if system_message:
29
+ cmd.extend(["--append-system-prompt", system_message])
30
+
31
+ # user prompt
32
+ prompt = "\n\n".join(
33
+ [m.text for m in state.messages if isinstance(m, ChatMessageUser)]
34
+ )
35
+ cmd.append(prompt)
36
+
37
+ # execute the agent
38
+ result = await sandbox().exec(
39
+ cmd=cmd,
40
+ env={
41
+ "ANTHROPIC_BASE_URL": f"http://localhost:{bridge.port}",
42
+ "ANTHROPIC_API_KEY": "sk-ant-api03-DOq5tyLPrk9M4hPE",
43
+ "ANTHROPIC_SMALL_FAST_MODEL": "inspect",
44
+ "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
45
+ "IS_SANDBOX": "1",
46
+ },
47
+ )
48
+
49
+ if result.success:
50
+ return bridge.state
51
+ else:
52
+ raise RuntimeError(
53
+ f"Error executing claude code agent: {result.stdout}\n{result.stderr}"
54
+ )
55
+
56
+ return execute
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
28
28
  commit_id: COMMIT_ID
29
29
  __commit_id__: COMMIT_ID
30
30
 
31
- __version__ = version = '0.1.5'
32
- __version_tuple__ = version_tuple = (0, 1, 5)
31
+ __version__ = version = '0.2.0'
32
+ __version_tuple__ = version_tuple = (0, 2, 0)
33
33
 
34
34
  __commit_id__ = commit_id = None
@@ -1,9 +0,0 @@
1
- from inspect_ai.agent import Agent, AgentState, agent
2
-
3
-
4
- @agent
5
- def claude_code() -> Agent:
6
- async def execute(state: AgentState) -> AgentState:
7
- raise RuntimeError("claude_code() not yet implemented.")
8
-
9
- return execute
File without changes