inspect-swe 0.1.5__py3-none-any.whl → 0.2.0__py3-none-any.whl
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.
- inspect_swe/_claude_code/claude_code.py +49 -2
- inspect_swe/_version.py +2 -2
- {inspect_swe-0.1.5.dist-info → inspect_swe-0.2.0.dist-info}/METADATA +6 -2
- inspect_swe-0.2.0.dist-info/RECORD +10 -0
- inspect_swe-0.1.5.dist-info/RECORD +0 -10
- {inspect_swe-0.1.5.dist-info → inspect_swe-0.2.0.dist-info}/WHEEL +0 -0
- {inspect_swe-0.1.5.dist-info → inspect_swe-0.2.0.dist-info}/licenses/LICENSE +0 -0
@@ -1,9 +1,56 @@
|
|
1
|
-
from inspect_ai.agent import
|
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
|
2
9
|
|
3
10
|
|
4
11
|
@agent
|
5
12
|
def claude_code() -> Agent:
|
6
13
|
async def execute(state: AgentState) -> AgentState:
|
7
|
-
|
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
|
+
)
|
8
55
|
|
9
56
|
return execute
|
inspect_swe/_version.py
CHANGED
@@ -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.
|
32
|
-
__version_tuple__ = version_tuple = (0,
|
31
|
+
__version__ = version = '0.2.0'
|
32
|
+
__version_tuple__ = version_tuple = (0, 2, 0)
|
33
33
|
|
34
34
|
__commit_id__ = commit_id = None
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: inspect_swe
|
3
|
-
Version: 0.
|
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
|
|
@@ -0,0 +1,10 @@
|
|
1
|
+
inspect_swe/__init__.py,sha256=6F52dddUoPvJA7RugtyDaswUqliDGgeaTK_OXWplvI0,185
|
2
|
+
inspect_swe/_version.py,sha256=Dg8AmJomLVpjKL6prJylOONZAPRtB86LOce7dorQS_A,704
|
3
|
+
inspect_swe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
inspect_swe/_claude_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
inspect_swe/_claude_code/claude_code.py,sha256=iE_-6Wv0m7hO1Tj-d21K8iZHgBIcTcfSqLHPVS1whMM,1788
|
6
|
+
inspect_swe/_claude_code/install_claude.py,sha256=g5nHIY-JVKDQFgm0IIhpCsCX5B6MadYj8-CtKpKU4YE,11796
|
7
|
+
inspect_swe-0.2.0.dist-info/METADATA,sha256=BspOyEN0yJbUDd_MK8Zn4A86osKL1tOGHq1axRM9iH8,1526
|
8
|
+
inspect_swe-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
+
inspect_swe-0.2.0.dist-info/licenses/LICENSE,sha256=Hi3UDcbD6yCKZ1mcgt7pprzSG0rDEnSrbrm3XinyiDA,1070
|
10
|
+
inspect_swe-0.2.0.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
inspect_swe/__init__.py,sha256=6F52dddUoPvJA7RugtyDaswUqliDGgeaTK_OXWplvI0,185
|
2
|
-
inspect_swe/_version.py,sha256=rdxBMYpwzYxiWk08QbPLHSAxHoDfeKWwyaJIAM0lSic,704
|
3
|
-
inspect_swe/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
inspect_swe/_claude_code/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
inspect_swe/_claude_code/claude_code.py,sha256=-WVHfA-kRDyEwCMeUlDR6A5fWSBcJGGV5o_np0Y6MnY,232
|
6
|
-
inspect_swe/_claude_code/install_claude.py,sha256=g5nHIY-JVKDQFgm0IIhpCsCX5B6MadYj8-CtKpKU4YE,11796
|
7
|
-
inspect_swe-0.1.5.dist-info/METADATA,sha256=5JqMYTi_E31VZmxOHqHICbc5Nhwq9tkhEZ8l2NtYQ14,1296
|
8
|
-
inspect_swe-0.1.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
9
|
-
inspect_swe-0.1.5.dist-info/licenses/LICENSE,sha256=Hi3UDcbD6yCKZ1mcgt7pprzSG0rDEnSrbrm3XinyiDA,1070
|
10
|
-
inspect_swe-0.1.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|