mini-swe-agent 1.14.1__py3-none-any.whl → 1.14.3__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.
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/METADATA +1 -1
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/RECORD +11 -11
- minisweagent/__init__.py +1 -1
- minisweagent/models/litellm_model.py +2 -1
- minisweagent/models/openrouter_model.py +2 -1
- minisweagent/models/portkey_model.py +13 -1
- minisweagent/run/mini.py +1 -1
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/WHEEL +0 -0
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/entry_points.txt +0 -0
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/licenses/LICENSE.md +0 -0
- {mini_swe_agent-1.14.1.dist-info → mini_swe_agent-1.14.3.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-swe-agent
|
|
3
|
-
Version: 1.14.
|
|
3
|
+
Version: 1.14.3
|
|
4
4
|
Summary: Nano SWE Agent - A simple AI software engineering agent
|
|
5
5
|
Author-email: Kilian Lieret <kilian.lieret@posteo.de>, "Carlos E. Jimenez" <carlosej@princeton.edu>
|
|
6
6
|
License: MIT License
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
mini_swe_agent-1.14.
|
|
2
|
-
minisweagent/__init__.py,sha256=
|
|
1
|
+
mini_swe_agent-1.14.3.dist-info/licenses/LICENSE.md,sha256=D3luWPkdHAe7LBsdD4vzqDAXw6Xewb3G-uczss0uh1s,1094
|
|
2
|
+
minisweagent/__init__.py,sha256=EwS3u5P_ms-e-uhpEGYcAoM93ejSAkrWV0saNM3r--c,2016
|
|
3
3
|
minisweagent/__main__.py,sha256=FIyAOiw--c3FQ2g240FOM1FdL0lk_PxSpixu0pQ7WFo,194
|
|
4
4
|
minisweagent/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
5
|
minisweagent/agents/__init__.py,sha256=cpjJLzg1IGxLM-tZpoMJV9S33ye13XtdBO0x7DU_Lrk,48
|
|
@@ -25,9 +25,9 @@ minisweagent/environments/extra/bubblewrap.py,sha256=G12Dm63N30qByfLb1SKNsI4G4gL
|
|
|
25
25
|
minisweagent/environments/extra/swerex_docker.py,sha256=WPYbohT_vqTHkde9cxpbV6chLXCpLl0PDAcgMbZsV0M,1707
|
|
26
26
|
minisweagent/models/__init__.py,sha256=Ol95N3oEDlojz7IBw10A7xf5rKfxtjESyJuEWOwZyzo,4171
|
|
27
27
|
minisweagent/models/anthropic.py,sha256=4p-LxQ_RYQUX1rBsffAj3T1bBb2uMRhA4IyKfDcMpgo,1517
|
|
28
|
-
minisweagent/models/litellm_model.py,sha256=
|
|
29
|
-
minisweagent/models/openrouter_model.py,sha256=
|
|
30
|
-
minisweagent/models/portkey_model.py,sha256=
|
|
28
|
+
minisweagent/models/litellm_model.py,sha256=wtGeCwjvCbL2pRN8PTDDIaGYoCnPyMjD0dGn0fkjcLo,3533
|
|
29
|
+
minisweagent/models/openrouter_model.py,sha256=RMVcj74yO0TMzEPn35NjUzJ_PIOeO6TZpP-MmLJbGRw,4209
|
|
30
|
+
minisweagent/models/portkey_model.py,sha256=3bfs1_6fGfjjHm_95QrCRmoiuP1MRdOkRE92fEWCBUw,5893
|
|
31
31
|
minisweagent/models/test_models.py,sha256=ItCA6ddntzkYA7dzSuUEaLMV-AE8TBuXBFP8CzpiO3U,1351
|
|
32
32
|
minisweagent/models/extra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
33
33
|
minisweagent/models/extra/roulette.py,sha256=SqLj_wz9Vkbxou7i9Ef4Uzmg_eheDouNySkkV7pm2Ys,2093
|
|
@@ -38,7 +38,7 @@ minisweagent/run/__init__.py,sha256=WIoYgHVl7iZF2YncrfV3IttupG6P5KogroKHKECka3A,
|
|
|
38
38
|
minisweagent/run/github_issue.py,sha256=35mZoPLc4JV6XXJKRv55lnuKbXf5lDftd51N89-x9J0,3192
|
|
39
39
|
minisweagent/run/hello_world.py,sha256=erLnEwNmPFLxq3-8zyv66Vy1kIqMqQf97vISX7LrQXg,959
|
|
40
40
|
minisweagent/run/inspector.py,sha256=QnY3oYzm-yq3w9Jzs112Lco2Rg84vSocAWrQRVz_1lc,7127
|
|
41
|
-
minisweagent/run/mini.py,sha256=
|
|
41
|
+
minisweagent/run/mini.py,sha256=uDRb_gac9WcVBVF7kZxknHCwoAPRtLwtPi77ox6Zhjw,4945
|
|
42
42
|
minisweagent/run/mini_extra.py,sha256=ecA1PnTWElpO60G9RktvVLtUOf3bZ_ESmnSttS6izhQ,1465
|
|
43
43
|
minisweagent/run/extra/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
44
|
minisweagent/run/extra/config.py,sha256=5s0ZjjE4QTphOqQzCJqHD2APq5jCdod5jFjGo3sXDms,3868
|
|
@@ -50,8 +50,8 @@ minisweagent/run/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3
|
|
|
50
50
|
minisweagent/run/utils/save.py,sha256=2xd-UnUzI7Fr_AUZ5KEJ53Aa4kpuuGYxkLwyUcvqyMM,2503
|
|
51
51
|
minisweagent/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
52
52
|
minisweagent/utils/log.py,sha256=ruDMNKMrVC9NPvCeHwO3QYz5jsVNUGQB2dRAEAPAWp8,996
|
|
53
|
-
mini_swe_agent-1.14.
|
|
54
|
-
mini_swe_agent-1.14.
|
|
55
|
-
mini_swe_agent-1.14.
|
|
56
|
-
mini_swe_agent-1.14.
|
|
57
|
-
mini_swe_agent-1.14.
|
|
53
|
+
mini_swe_agent-1.14.3.dist-info/METADATA,sha256=dvHQUSE4yIjvxgIivgaAC97cbhsVZg4V4uEXDFQaayU,14151
|
|
54
|
+
mini_swe_agent-1.14.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
55
|
+
mini_swe_agent-1.14.3.dist-info/entry_points.txt,sha256=d1_yRbTaGjs1UXHa6JQK0sKDGBIVGm8oeW0k2kfbJgQ,182
|
|
56
|
+
mini_swe_agent-1.14.3.dist-info/top_level.txt,sha256=zKF4t8bFpV87fdVABZt2Da-vnb4Vkh_CxkwQx5YT4Ew,13
|
|
57
|
+
mini_swe_agent-1.14.3.dist-info/RECORD,,
|
minisweagent/__init__.py
CHANGED
|
@@ -38,7 +38,7 @@ class LitellmModel:
|
|
|
38
38
|
litellm.utils.register_model(json.loads(Path(self.config.litellm_model_registry).read_text()))
|
|
39
39
|
|
|
40
40
|
@retry(
|
|
41
|
-
stop=stop_after_attempt(10),
|
|
41
|
+
stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
|
|
42
42
|
wait=wait_exponential(multiplier=1, min=4, max=60),
|
|
43
43
|
before_sleep=before_sleep_log(logger, logging.WARNING),
|
|
44
44
|
retry=retry_if_not_exception_type(
|
|
@@ -76,6 +76,7 @@ class LitellmModel:
|
|
|
76
76
|
)
|
|
77
77
|
raise
|
|
78
78
|
self.n_calls += 1
|
|
79
|
+
assert cost >= 0.0, f"Cost is negative: {cost}"
|
|
79
80
|
self.cost += cost
|
|
80
81
|
GLOBAL_MODEL_STATS.add(cost)
|
|
81
82
|
return {
|
|
@@ -54,7 +54,7 @@ class OpenRouterModel:
|
|
|
54
54
|
self._api_key = os.getenv("OPENROUTER_API_KEY", "")
|
|
55
55
|
|
|
56
56
|
@retry(
|
|
57
|
-
stop=stop_after_attempt(10),
|
|
57
|
+
stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
|
|
58
58
|
wait=wait_exponential(multiplier=1, min=4, max=60),
|
|
59
59
|
before_sleep=before_sleep_log(logger, logging.WARNING),
|
|
60
60
|
retry=retry_if_not_exception_type(
|
|
@@ -100,6 +100,7 @@ class OpenRouterModel:
|
|
|
100
100
|
# Extract cost from usage information
|
|
101
101
|
usage = response.get("usage", {})
|
|
102
102
|
cost = usage.get("cost", 0.0)
|
|
103
|
+
assert cost >= 0.0, f"Cost is negative: {cost}"
|
|
103
104
|
|
|
104
105
|
# If total_cost is not available, raise an error
|
|
105
106
|
if cost == 0.0:
|
|
@@ -74,7 +74,7 @@ class PortkeyModel:
|
|
|
74
74
|
self.client = Portkey(**client_kwargs)
|
|
75
75
|
|
|
76
76
|
@retry(
|
|
77
|
-
stop=stop_after_attempt(10),
|
|
77
|
+
stop=stop_after_attempt(int(os.getenv("MSWEA_MODEL_RETRY_STOP_AFTER_ATTEMPT", "10"))),
|
|
78
78
|
wait=wait_exponential(multiplier=1, min=4, max=60),
|
|
79
79
|
before_sleep=before_sleep_log(logger, logging.WARNING),
|
|
80
80
|
retry=retry_if_not_exception_type((KeyboardInterrupt, TypeError, ValueError)),
|
|
@@ -95,6 +95,17 @@ class PortkeyModel:
|
|
|
95
95
|
if self.config.litellm_model_name_override:
|
|
96
96
|
if response_for_cost_calc.model:
|
|
97
97
|
response_for_cost_calc.model = self.config.litellm_model_name_override
|
|
98
|
+
prompt_tokens = response_for_cost_calc.usage.prompt_tokens
|
|
99
|
+
total_tokens = response_for_cost_calc.usage.total_tokens
|
|
100
|
+
completion_tokens = response_for_cost_calc.usage.completion_tokens
|
|
101
|
+
if total_tokens - prompt_tokens - completion_tokens != 0:
|
|
102
|
+
# This is most likely related to how portkey treats cached tokens: It doesn't count them towards the prompt tokens (?)
|
|
103
|
+
logger.warning(
|
|
104
|
+
f"WARNING: Total tokens - prompt tokens - completion tokens != 0: {response_for_cost_calc.model_dump()}."
|
|
105
|
+
" This is probably a portkey bug or incompatibility with litellm cost tracking. "
|
|
106
|
+
"Setting prompt tokens based on total tokens and completion tokens. You might want to double check your costs."
|
|
107
|
+
)
|
|
108
|
+
response_for_cost_calc.usage.prompt_tokens = total_tokens - completion_tokens
|
|
98
109
|
try:
|
|
99
110
|
cost = litellm.cost_calculator.completion_cost(
|
|
100
111
|
response_for_cost_calc, model=self.config.litellm_model_name_override or None
|
|
@@ -106,6 +117,7 @@ class PortkeyModel:
|
|
|
106
117
|
"https://klieret.short.gy/litellm-model-registry Still stuck? Please open a github issue for help!"
|
|
107
118
|
)
|
|
108
119
|
raise
|
|
120
|
+
assert cost >= 0.0, f"Cost is negative: {cost}"
|
|
109
121
|
|
|
110
122
|
self.n_calls += 1
|
|
111
123
|
self.cost += cost
|
minisweagent/run/mini.py
CHANGED
|
@@ -77,7 +77,7 @@ def main(
|
|
|
77
77
|
|
|
78
78
|
if yolo:
|
|
79
79
|
config.setdefault("agent", {})["mode"] = "yolo"
|
|
80
|
-
if cost_limit:
|
|
80
|
+
if cost_limit is not None:
|
|
81
81
|
config.setdefault("agent", {})["cost_limit"] = cost_limit
|
|
82
82
|
if exit_immediately:
|
|
83
83
|
config.setdefault("agent", {})["confirm_exit"] = False
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|