beswarm 0.1.64__py3-none-any.whl → 0.1.66__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.
- beswarm/aient/setup.py +1 -1
- beswarm/aient/src/aient/core/request.py +16 -4
- beswarm/aient/src/aient/core/utils.py +1 -0
- beswarm/aient/src/aient/plugins/excute_command.py +3 -0
- beswarm/tools/__init__.py +2 -0
- beswarm/tools/screenshot.py +34 -0
- {beswarm-0.1.64.dist-info → beswarm-0.1.66.dist-info}/METADATA +1 -1
- {beswarm-0.1.64.dist-info → beswarm-0.1.66.dist-info}/RECORD +10 -9
- {beswarm-0.1.64.dist-info → beswarm-0.1.66.dist-info}/WHEEL +0 -0
- {beswarm-0.1.64.dist-info → beswarm-0.1.66.dist-info}/top_level.txt +0 -0
beswarm/aient/setup.py
CHANGED
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
|
|
4
4
|
|
5
5
|
setup(
|
6
6
|
name="aient",
|
7
|
-
version="1.1.
|
7
|
+
version="1.1.19",
|
8
8
|
description="Aient: The Awakening of Agent.",
|
9
9
|
long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
|
10
10
|
long_description_content_type="text/markdown",
|
@@ -12,6 +12,7 @@ from .utils import (
|
|
12
12
|
c35s,
|
13
13
|
gemini1,
|
14
14
|
gemini2,
|
15
|
+
gemini2_5_pro_exp,
|
15
16
|
BaseAPI,
|
16
17
|
safe_get,
|
17
18
|
get_engine,
|
@@ -112,7 +113,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
|
|
112
113
|
if system_prompt.strip():
|
113
114
|
systemInstruction = {"parts": [{"text": system_prompt}]}
|
114
115
|
|
115
|
-
if any(off_model in original_model for off_model in gemini_max_token_65k_models) or original_model
|
116
|
+
if any(off_model in original_model for off_model in gemini_max_token_65k_models) or original_model.endswith("-image-generation"):
|
116
117
|
safety_settings = "OFF"
|
117
118
|
else:
|
118
119
|
safety_settings = "BLOCK_NONE"
|
@@ -167,6 +168,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
|
|
167
168
|
'response_format',
|
168
169
|
'stream_options',
|
169
170
|
'prompt',
|
171
|
+
'size',
|
170
172
|
]
|
171
173
|
generation_config = {}
|
172
174
|
|
@@ -221,7 +223,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
|
|
221
223
|
else:
|
222
224
|
payload["generationConfig"]["maxOutputTokens"] = 8192
|
223
225
|
|
224
|
-
if original_model
|
226
|
+
if original_model.endswith("-image-generation"):
|
225
227
|
payload["generationConfig"]["response_modalities"] = [
|
226
228
|
"Text",
|
227
229
|
"Image",
|
@@ -336,10 +338,11 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
|
|
336
338
|
pro_models = ["gemini-2.5", "gemini-2.0"]
|
337
339
|
if any(pro_model in original_model for pro_model in pro_models):
|
338
340
|
location = gemini2
|
339
|
-
# search_tool = {"googleSearch": {}}
|
340
341
|
else:
|
341
342
|
location = gemini1
|
342
|
-
|
343
|
+
|
344
|
+
if "gemini-2.5-pro-exp-03-25" == original_model:
|
345
|
+
location = gemini2_5_pro_exp
|
343
346
|
|
344
347
|
if "google-vertex-ai" in provider.get("base_url", ""):
|
345
348
|
url = provider.get("base_url").rstrip('/') + "/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
|
@@ -351,6 +354,13 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
|
|
351
354
|
elif api_key is not None and api_key[2] == ".":
|
352
355
|
url = f"https://aiplatform.googleapis.com/v1/publishers/google/models/{original_model}:{gemini_stream}?key={api_key}"
|
353
356
|
headers.pop("Authorization", None)
|
357
|
+
elif "gemini-2.5-pro-exp-03-25" == original_model:
|
358
|
+
url = "https://aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
|
359
|
+
LOCATION=await location.next(),
|
360
|
+
PROJECT_ID=project_id,
|
361
|
+
MODEL_ID=original_model,
|
362
|
+
stream=gemini_stream
|
363
|
+
)
|
354
364
|
else:
|
355
365
|
url = "https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
|
356
366
|
LOCATION=await location.next(),
|
@@ -464,6 +474,8 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
|
|
464
474
|
'logprobs',
|
465
475
|
'top_logprobs',
|
466
476
|
'stream_options',
|
477
|
+
'prompt',
|
478
|
+
'size',
|
467
479
|
]
|
468
480
|
generation_config = {}
|
469
481
|
|
@@ -437,6 +437,7 @@ c3o = ThreadSafeCircularList(["us-east5"])
|
|
437
437
|
c3h = ThreadSafeCircularList(["us-east5", "us-central1", "europe-west1", "europe-west4"])
|
438
438
|
gemini1 = ThreadSafeCircularList(["us-central1", "us-east4", "us-west1", "us-west4", "europe-west1", "europe-west2"])
|
439
439
|
gemini2 = ThreadSafeCircularList(["us-central1"])
|
440
|
+
gemini2_5_pro_exp = ThreadSafeCircularList(["global"])
|
440
441
|
|
441
442
|
|
442
443
|
|
@@ -185,6 +185,9 @@ def excute_command(command):
|
|
185
185
|
# print(f"is_same: {is_same}", flush=True)
|
186
186
|
# print(f"\n\n\n", flush=True)
|
187
187
|
new_output_lines.append(line)
|
188
|
+
# 限制输出行数
|
189
|
+
if len(new_output_lines) > 500:
|
190
|
+
new_output_lines = new_output_lines[:250] + new_output_lines[-250:]
|
188
191
|
final_output_log = "\n".join(new_output_lines)
|
189
192
|
# print(f"output_lines: {len(new_output_lines)}")
|
190
193
|
|
beswarm/tools/__init__.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
from .think import think
|
2
2
|
from .edit_file import edit_file
|
3
3
|
from .worker import worker, worker_gen
|
4
|
+
from .screenshot import save_screenshot_to_file
|
4
5
|
|
5
6
|
from .search_arxiv import search_arxiv
|
6
7
|
from .repomap import get_code_repo_map
|
@@ -45,4 +46,5 @@ __all__ = [
|
|
45
46
|
"scroll_screen",
|
46
47
|
"register_tool",
|
47
48
|
"search_web",
|
49
|
+
"save_screenshot_to_file",
|
48
50
|
]
|
@@ -0,0 +1,34 @@
|
|
1
|
+
from ..aient.src.aient.plugins import register_tool
|
2
|
+
|
3
|
+
@register_tool()
|
4
|
+
def save_screenshot_to_file(save_path):
|
5
|
+
"""
|
6
|
+
截取当前屏幕并保存到指定路径
|
7
|
+
|
8
|
+
参数:
|
9
|
+
save_path: 截图保存的完整路径,包括文件名和扩展名
|
10
|
+
|
11
|
+
返回:
|
12
|
+
成功返回True,失败返回False
|
13
|
+
"""
|
14
|
+
try:
|
15
|
+
import os
|
16
|
+
import pyautogui
|
17
|
+
|
18
|
+
# 确保目标目录存在
|
19
|
+
save_dir = os.path.dirname(save_path)
|
20
|
+
if save_dir and not os.path.exists(save_dir):
|
21
|
+
os.makedirs(save_dir)
|
22
|
+
|
23
|
+
# 截取屏幕
|
24
|
+
screenshot = pyautogui.screenshot()
|
25
|
+
img_width, img_height = pyautogui.size()
|
26
|
+
|
27
|
+
# 保存截图到指定路径
|
28
|
+
screenshot.save(save_path)
|
29
|
+
return f"截图成功保存,尺寸: {img_width}x{img_height},保存路径: {save_path}"
|
30
|
+
|
31
|
+
except ImportError:
|
32
|
+
return "请安装所需库: pip install Pillow pyautogui"
|
33
|
+
except Exception as e:
|
34
|
+
return f"截取屏幕或保存图像时出错: {e}"
|
@@ -1,14 +1,14 @@
|
|
1
1
|
beswarm/__init__.py,sha256=HZjUOJtZR5QhMuDbq-wukQQn1VrBusNWai_ysGo-VVI,20
|
2
2
|
beswarm/utils.py,sha256=Z2Kuus2BLp9EHUC2ZNL9iUsb6NWnPj-MTA7SYzGyg24,1755
|
3
3
|
beswarm/aient/main.py,sha256=SiYAIgQlLJqYusnTVEJOx1WNkSJKMImhgn5aWjfroxg,3814
|
4
|
-
beswarm/aient/setup.py,sha256=
|
4
|
+
beswarm/aient/setup.py,sha256=I9hZR__BG1kFGAzLuA1xI53W0hbWOB-iRslbHO9wZuU,487
|
5
5
|
beswarm/aient/src/aient/__init__.py,sha256=SRfF7oDVlOOAi6nGKiJIUK6B_arqYLO9iSMp-2IZZps,21
|
6
6
|
beswarm/aient/src/aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
|
7
7
|
beswarm/aient/src/aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
|
8
8
|
beswarm/aient/src/aient/core/models.py,sha256=kF-HLi1I2k_G5r153ZHuiGH8_NmpTlFMfK0_myB28YQ,7366
|
9
|
-
beswarm/aient/src/aient/core/request.py,sha256=
|
9
|
+
beswarm/aient/src/aient/core/request.py,sha256=qKj_w9UpXZePCGhhMuE-rX7rCPUdCx8GJ-HUXiurBho,66589
|
10
10
|
beswarm/aient/src/aient/core/response.py,sha256=YphzhA9jtQKzWb3L4XGTp9xJZ2FOzHr1aAMTsi896FQ,33201
|
11
|
-
beswarm/aient/src/aient/core/utils.py,sha256=
|
11
|
+
beswarm/aient/src/aient/core/utils.py,sha256=zidsBUBd3KskzcxQcPB1y5x1RhtWcbZeWvmgb4LAadA,27318
|
12
12
|
beswarm/aient/src/aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
|
13
13
|
beswarm/aient/src/aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
|
14
14
|
beswarm/aient/src/aient/core/test/test_image.py,sha256=_T4peNGdXKBHHxyQNx12u-NTyFE8TlYI6NvvagsG2LE,319
|
@@ -25,7 +25,7 @@ beswarm/aient/src/aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yu
|
|
25
25
|
beswarm/aient/src/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
|
26
26
|
beswarm/aient/src/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
|
27
27
|
beswarm/aient/src/aient/plugins/config.py,sha256=Vp6CG9ocdC_FAlCMEGtKj45xamir76DFxdJVvURNtog,6539
|
28
|
-
beswarm/aient/src/aient/plugins/excute_command.py,sha256=
|
28
|
+
beswarm/aient/src/aient/plugins/excute_command.py,sha256=9t7RB8ikltZZRv8NcjoxfaD8FkPuWbJTZ2Vwk7hEwTA,10683
|
29
29
|
beswarm/aient/src/aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
|
30
30
|
beswarm/aient/src/aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
|
31
31
|
beswarm/aient/src/aient/plugins/list_directory.py,sha256=JZVuImecMSfEv6jLqii-0uQJ1UCsrpMNmYlwW3PEDg4,1374
|
@@ -119,16 +119,17 @@ beswarm/queries/tree-sitter-languages/ruby-tags.scm,sha256=vIidsCeE2A0vdFN18yXKq
|
|
119
119
|
beswarm/queries/tree-sitter-languages/rust-tags.scm,sha256=9ljM1nzhfPs_ZTRw7cr2P9ToOyhGcKkCoN4_HPXSWi4,1451
|
120
120
|
beswarm/queries/tree-sitter-languages/scala-tags.scm,sha256=UxQjz80JIrrJ7Pm56uUnQyThfmQNvwk7aQzPNypB-Ao,1761
|
121
121
|
beswarm/queries/tree-sitter-languages/typescript-tags.scm,sha256=OMdCeedPiA24ky82DpgTMKXK_l2ySTuF2zrQ2fJAi9E,1253
|
122
|
-
beswarm/tools/__init__.py,sha256=
|
122
|
+
beswarm/tools/__init__.py,sha256=IJExt6D58d2yxBOjHVC6wYGhV7Pb7okmX61RvyqSCSY,1150
|
123
123
|
beswarm/tools/click.py,sha256=TygaekCXTmU3fIu6Uom7ZcyzEgYMlCC_GX-5SmWHuLI,20762
|
124
124
|
beswarm/tools/edit_file.py,sha256=xlAD0HB_xM0yZYc0eJwLE-9mAkywXa2UQPNHzG1OaW4,7664
|
125
125
|
beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
|
126
126
|
beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,45003
|
127
|
+
beswarm/tools/screenshot.py,sha256=u6t8FCgW5YHJ_Oc4coo8e0F3wTusWE_-H8dFh1rBq9Q,1011
|
127
128
|
beswarm/tools/search_arxiv.py,sha256=9slwBemXjEqrd7-YgVmyMijPXlkhZCybEDRVhWVQ9B0,7937
|
128
129
|
beswarm/tools/search_web.py,sha256=B24amOnGHnmdV_6S8bw8O2PdhZRRIDtJjg-wXcfP7dQ,11859
|
129
130
|
beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
|
130
131
|
beswarm/tools/worker.py,sha256=bZwMGUS4wt4yOleb2kKu0rCLHIJgPcokbCmh9bGMzXA,12679
|
131
|
-
beswarm-0.1.
|
132
|
-
beswarm-0.1.
|
133
|
-
beswarm-0.1.
|
134
|
-
beswarm-0.1.
|
132
|
+
beswarm-0.1.66.dist-info/METADATA,sha256=u1H0kHybNKYYajE6OJxivCH1-E1i-Izep8iz5Kt7M9A,3553
|
133
|
+
beswarm-0.1.66.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
134
|
+
beswarm-0.1.66.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
135
|
+
beswarm-0.1.66.dist-info/RECORD,,
|
File without changes
|
File without changes
|