autobyteus 1.1.9__py3-none-any.whl → 1.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.
- autobyteus/clients/__init__.py +10 -0
- autobyteus/clients/autobyteus_client.py +318 -0
- autobyteus/clients/cert_utils.py +105 -0
- autobyteus/clients/certificates/cert.pem +34 -0
- autobyteus/llm/api/autobyteus_llm.py +1 -1
- autobyteus/llm/api/zhipu_llm.py +26 -0
- autobyteus/llm/autobyteus_provider.py +1 -1
- autobyteus/llm/llm_factory.py +23 -0
- autobyteus/llm/ollama_provider_resolver.py +1 -0
- autobyteus/llm/providers.py +1 -0
- autobyteus/llm/token_counter/token_counter_factory.py +3 -0
- autobyteus/llm/token_counter/zhipu_token_counter.py +24 -0
- autobyteus/multimedia/audio/api/autobyteus_audio_client.py +1 -1
- autobyteus/multimedia/audio/autobyteus_audio_provider.py +1 -1
- autobyteus/multimedia/image/api/autobyteus_image_client.py +1 -1
- autobyteus/multimedia/image/autobyteus_image_provider.py +1 -1
- autobyteus/task_management/__init__.py +2 -1
- autobyteus/task_management/schemas/task_definition.py +1 -1
- autobyteus/task_management/schemas/task_status_report.py +1 -1
- autobyteus/task_management/tools/__init__.py +2 -0
- autobyteus/task_management/tools/assign_task_to.py +125 -0
- autobyteus/tools/__init__.py +52 -16
- autobyteus/tools/download_media_tool.py +136 -0
- autobyteus/tools/file/file_editor.py +200 -0
- autobyteus/tools/usage/parsers/_string_decoders.py +18 -0
- autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py +9 -1
- autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py +15 -1
- autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py +4 -1
- autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py +4 -1
- {autobyteus-1.1.9.dist-info → autobyteus-1.2.0.dist-info}/METADATA +3 -2
- {autobyteus-1.1.9.dist-info → autobyteus-1.2.0.dist-info}/RECORD +34 -26
- autobyteus/tools/image_downloader.py +0 -99
- autobyteus/tools/pdf_downloader.py +0 -89
- {autobyteus-1.1.9.dist-info → autobyteus-1.2.0.dist-info}/WHEEL +0 -0
- {autobyteus-1.1.9.dist-info → autobyteus-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {autobyteus-1.1.9.dist-info → autobyteus-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
import re
|
|
3
|
+
import html
|
|
3
4
|
from typing import TYPE_CHECKING, Dict, Any, List
|
|
4
5
|
from dataclasses import dataclass, field
|
|
5
6
|
|
|
@@ -124,6 +125,7 @@ class _XmlArgumentsParser:
|
|
|
124
125
|
|
|
125
126
|
final_args = context.stack[0]
|
|
126
127
|
self._cleanup_internal_keys(final_args)
|
|
128
|
+
final_args = self._decode_entities_inplace(final_args)
|
|
127
129
|
return final_args
|
|
128
130
|
|
|
129
131
|
def process_tag(self, tag_content: str, context: '_ParsingContext'):
|
|
@@ -213,6 +215,19 @@ class _XmlArgumentsParser:
|
|
|
213
215
|
for item in data:
|
|
214
216
|
self._cleanup_internal_keys(item)
|
|
215
217
|
|
|
218
|
+
def _decode_entities_inplace(self, data: Any):
|
|
219
|
+
if isinstance(data, dict):
|
|
220
|
+
for key, value in list(data.items()):
|
|
221
|
+
data[key] = self._decode_entities_inplace(value)
|
|
222
|
+
return data
|
|
223
|
+
if isinstance(data, list):
|
|
224
|
+
for index, item in enumerate(data):
|
|
225
|
+
data[index] = self._decode_entities_inplace(item)
|
|
226
|
+
return data
|
|
227
|
+
if isinstance(data, str):
|
|
228
|
+
return html.unescape(data)
|
|
229
|
+
return data
|
|
230
|
+
|
|
216
231
|
|
|
217
232
|
# --- Main Parser Class ---
|
|
218
233
|
|
|
@@ -299,4 +314,3 @@ class DefaultXmlToolUsageParser(BaseToolUsageParser):
|
|
|
299
314
|
"""
|
|
300
315
|
parser = _XmlArgumentsParser(xml_string)
|
|
301
316
|
return parser.parse()
|
|
302
|
-
|
|
@@ -7,6 +7,7 @@ from autobyteus.agent.tool_invocation import ToolInvocation
|
|
|
7
7
|
from .base_parser import BaseToolUsageParser
|
|
8
8
|
from .exceptions import ToolUsageParseException
|
|
9
9
|
from ._json_extractor import _find_json_blobs
|
|
10
|
+
from ._string_decoders import decode_html_entities
|
|
10
11
|
|
|
11
12
|
if TYPE_CHECKING:
|
|
12
13
|
from autobyteus.llm.utils.response_types import CompleteResponse
|
|
@@ -55,8 +56,10 @@ class GeminiJsonToolUsageParser(BaseToolUsageParser):
|
|
|
55
56
|
arguments = call_data.get("args")
|
|
56
57
|
|
|
57
58
|
if tool_name and isinstance(tool_name, str) and isinstance(arguments, dict):
|
|
59
|
+
decoded_tool_name = decode_html_entities(tool_name)
|
|
60
|
+
decoded_arguments = decode_html_entities(arguments)
|
|
58
61
|
# Pass id=None to trigger deterministic ID generation in ToolInvocation
|
|
59
|
-
tool_invocation = ToolInvocation(name=
|
|
62
|
+
tool_invocation = ToolInvocation(name=decoded_tool_name, arguments=decoded_arguments)
|
|
60
63
|
invocations.append(tool_invocation)
|
|
61
64
|
logger.info(f"Successfully parsed Gemini JSON tool invocation for '{tool_name}'.")
|
|
62
65
|
else:
|
|
@@ -7,6 +7,7 @@ from autobyteus.agent.tool_invocation import ToolInvocation
|
|
|
7
7
|
from .base_parser import BaseToolUsageParser
|
|
8
8
|
from .exceptions import ToolUsageParseException
|
|
9
9
|
from ._json_extractor import _find_json_blobs
|
|
10
|
+
from ._string_decoders import decode_html_entities
|
|
10
11
|
|
|
11
12
|
if TYPE_CHECKING:
|
|
12
13
|
from autobyteus.llm.utils.response_types import CompleteResponse
|
|
@@ -138,7 +139,9 @@ class OpenAiJsonToolUsageParser(BaseToolUsageParser):
|
|
|
138
139
|
|
|
139
140
|
try:
|
|
140
141
|
# The ToolInvocation constructor will generate a deterministic ID if 'id' is None.
|
|
141
|
-
|
|
142
|
+
decoded_tool_name = decode_html_entities(tool_name)
|
|
143
|
+
decoded_arguments = decode_html_entities(arguments)
|
|
144
|
+
tool_invocation = ToolInvocation(name=decoded_tool_name, arguments=decoded_arguments, id=None)
|
|
142
145
|
logger.info(f"Successfully parsed OpenAI-style JSON tool invocation for '{tool_name}'.")
|
|
143
146
|
return tool_invocation
|
|
144
147
|
except Exception as e:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: autobyteus
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Multi-Agent framework
|
|
5
5
|
Home-page: https://github.com/AutoByteus/autobyteus
|
|
6
6
|
Author: Ryan Zheng
|
|
@@ -16,14 +16,15 @@ Description-Content-Type: text/markdown
|
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
Requires-Dist: aiohttp
|
|
18
18
|
Requires-Dist: anthropic
|
|
19
|
-
Requires-Dist: autobyteus-llm-client==1.1.3
|
|
20
19
|
Requires-Dist: beautifulsoup4
|
|
21
20
|
Requires-Dist: boto3
|
|
22
21
|
Requires-Dist: botocore
|
|
23
22
|
Requires-Dist: brui-core==1.0.9
|
|
24
23
|
Requires-Dist: certifi==2025.4.26
|
|
24
|
+
Requires-Dist: cryptography
|
|
25
25
|
Requires-Dist: google-api-python-client
|
|
26
26
|
Requires-Dist: google-genai==1.38.0
|
|
27
|
+
Requires-Dist: httpx
|
|
27
28
|
Requires-Dist: Jinja2
|
|
28
29
|
Requires-Dist: mcp[cli]
|
|
29
30
|
Requires-Dist: mistral_common
|
|
@@ -186,23 +186,27 @@ autobyteus/cli/workflow_tui/widgets/logo.py,sha256=TvfxdBvDXknf7-2vD3xkHuZkiymhM
|
|
|
186
186
|
autobyteus/cli/workflow_tui/widgets/renderables.py,sha256=hkRTjwz5DPSqaO8_8Zuvt1XxxAePZ9vGp582b3UMF18,3030
|
|
187
187
|
autobyteus/cli/workflow_tui/widgets/shared.py,sha256=vXUrJ0vU7gMLzi7j8mAdhSMgPMno1LanhHxkeyMOQtA,1732
|
|
188
188
|
autobyteus/cli/workflow_tui/widgets/status_bar.py,sha256=PLkw2IxJ4T2cDt-3HKRhnIme4luYIvXr1HpBVmfJH1c,455
|
|
189
|
+
autobyteus/clients/__init__.py,sha256=19KBdiG_V9DU0R1GsAPc4iSKk4HQhegI9PpJF_O_j44,331
|
|
190
|
+
autobyteus/clients/autobyteus_client.py,sha256=NyM6-yCKigs_LIoIVNUEec7FS12TpdEyncdg0lDWHHE,12563
|
|
191
|
+
autobyteus/clients/cert_utils.py,sha256=SL3CF9aoRzVScElXn258kh1YnxqE2Av7DRmu0QHUYMw,3808
|
|
192
|
+
autobyteus/clients/certificates/cert.pem,sha256=qb4Te3q7-b-_09GvHtX5dV--5_Vo_Dn_M6nbtCjrtoQ,2098
|
|
189
193
|
autobyteus/events/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
190
194
|
autobyteus/events/event_emitter.py,sha256=WKKwISFo2yDx0OpLjGFtXEl3DVV1siB0lXdndIAHhBg,2522
|
|
191
195
|
autobyteus/events/event_manager.py,sha256=c5RMlCtKzkHgQZkePBvqxPAxxOu-NapUrl8c2oRDkT8,5841
|
|
192
196
|
autobyteus/events/event_types.py,sha256=5CEMe2VmZ1L5ksKzMPqLRgPjXhxF31BD3ehrGJWfRJQ,3016
|
|
193
197
|
autobyteus/llm/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
194
|
-
autobyteus/llm/autobyteus_provider.py,sha256=
|
|
198
|
+
autobyteus/llm/autobyteus_provider.py,sha256=TuEXpiTkCN6V-hBc4ss8vR-4lA83VEmdlFDDmcooCzw,8387
|
|
195
199
|
autobyteus/llm/base_llm.py,sha256=OCiInGSNApZ-bcrdEMt3siOFwNkB9UwFGfqVNYImzEo,8036
|
|
196
|
-
autobyteus/llm/llm_factory.py,sha256=
|
|
200
|
+
autobyteus/llm/llm_factory.py,sha256=9UyZ9KqWNH-fVRaicIabicbxMHlQdWM59nrXyy8Y4hc,20081
|
|
197
201
|
autobyteus/llm/lmstudio_provider.py,sha256=RkM_drORSZ2zcSxN2Th5Upiva2oesIPw-6viqe2w9dY,4315
|
|
198
202
|
autobyteus/llm/models.py,sha256=ownBklNZrtJ_HWeMexa2T3s9TjWG0xggOt7wYrRs2l4,6963
|
|
199
203
|
autobyteus/llm/ollama_provider.py,sha256=CfcgC-DEWULjTwJiWazB5IXjErEyy1zZ41glrWhpj0g,4427
|
|
200
|
-
autobyteus/llm/ollama_provider_resolver.py,sha256=
|
|
201
|
-
autobyteus/llm/providers.py,sha256=
|
|
204
|
+
autobyteus/llm/ollama_provider_resolver.py,sha256=tH7kg2LbVjVVi3Y7veKXY0k2yEIqqOpfPUBAQvDwCYE,1889
|
|
205
|
+
autobyteus/llm/providers.py,sha256=q9olzK1SRlsgJVbkwQH9jqVDCu3wK1-Ta6aNm4Zg8pM,392
|
|
202
206
|
autobyteus/llm/runtimes.py,sha256=MzFNo3R1U3uWYAkuk-uuaba01Y0dDKQgVY_ElH_0dxU,315
|
|
203
207
|
autobyteus/llm/user_message.py,sha256=2hmICY_W7lwjYco3qT4zY1ELsBkpyxR2CjOgh33NMq0,3546
|
|
204
208
|
autobyteus/llm/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
205
|
-
autobyteus/llm/api/autobyteus_llm.py,sha256=
|
|
209
|
+
autobyteus/llm/api/autobyteus_llm.py,sha256=xwby9QELHFgrg1GoDSd66huY7kJ280dbxSdT2OZAGyQ,4919
|
|
206
210
|
autobyteus/llm/api/bedrock_llm.py,sha256=8B7dNSkQPRfRi8GAPEB31A2pZLZfTIQUtxXjQ_E4rAE,3768
|
|
207
211
|
autobyteus/llm/api/claude_llm.py,sha256=quPfUmg3oASRKVer01_tIcBxrqNP-xIenCU-tWbfTlU,5286
|
|
208
212
|
autobyteus/llm/api/deepseek_llm.py,sha256=TEWtXAqM4OuKH1etj5kknzkbPsRGvEpWzTq_CoAU6po,894
|
|
@@ -217,6 +221,7 @@ autobyteus/llm/api/ollama_llm.py,sha256=PmrgxOS-RU59DxUAw4aAvKeJHghpWcb3PKgsZk-w
|
|
|
217
221
|
autobyteus/llm/api/openai_compatible_llm.py,sha256=TFEem7RLpqtB9-ExHYBDk9dC0iJe2fAeLLJRE6sGciM,9108
|
|
218
222
|
autobyteus/llm/api/openai_llm.py,sha256=414fWDFvTm7IkG3STfYCWT4mz1FQwEGnD4N5MpTyf6M,905
|
|
219
223
|
autobyteus/llm/api/qwen_llm.py,sha256=wN4fHEfjpuece0xd19elwknBeRKJnhj--btNQl3_e_o,877
|
|
224
|
+
autobyteus/llm/api/zhipu_llm.py,sha256=RrwWaSTvmQ1dF-fMK0QAxrlbB4PmLlcd9_1zXL67D4I,892
|
|
220
225
|
autobyteus/llm/extensions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
221
226
|
autobyteus/llm/extensions/base_extension.py,sha256=ZqwmwNKBURFseAeRec53tpC4v1mnRTubdifk575eqlo,1273
|
|
222
227
|
autobyteus/llm/extensions/extension_registry.py,sha256=b4b3U5cQB9kZpJpqmT_e1lviLzjGQBsp7gJuYppjpjU,1254
|
|
@@ -228,7 +233,8 @@ autobyteus/llm/token_counter/deepseek_token_counter.py,sha256=YWCng71H6h5ZQX0Drj
|
|
|
228
233
|
autobyteus/llm/token_counter/kimi_token_counter.py,sha256=KuzgcbSWiqybCKHaukd-n917zEgUFebGXMAxlkZxue8,854
|
|
229
234
|
autobyteus/llm/token_counter/mistral_token_counter.py,sha256=YAUPqksnonTQRd1C7NjjFUPsjEDq_AKWxTc5GNTVGqU,4760
|
|
230
235
|
autobyteus/llm/token_counter/openai_token_counter.py,sha256=hGpKSo52NjtLKU8ZMHr76243wglFkfM9-ycSXJW-cwE,2811
|
|
231
|
-
autobyteus/llm/token_counter/token_counter_factory.py,sha256=
|
|
236
|
+
autobyteus/llm/token_counter/token_counter_factory.py,sha256=PeH_uPHWCWPrfrQYSShzDQsygw0D5XdurzPzcKBoRU4,2363
|
|
237
|
+
autobyteus/llm/token_counter/zhipu_token_counter.py,sha256=5vU__vhclgqgPBg1jq8Cy4e22ltzG4CCm-xWrUiW6qk,846
|
|
232
238
|
autobyteus/llm/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
233
239
|
autobyteus/llm/utils/llm_config.py,sha256=yzRlUmeyGkKvb-jfywGaR3tWGeQ2l6f8GZ8KdFzHNDk,9911
|
|
234
240
|
autobyteus/llm/utils/media_payload_formatter.py,sha256=S-pZxIlGHuKzzrHbqv7SUx99BfYlZ7dVUGcUrGDShF0,3676
|
|
@@ -244,18 +250,18 @@ autobyteus/multimedia/runtimes.py,sha256=mgmA06Ng7Gh6UW6YNi0O5CmwV6oDw3kX2qxLssU
|
|
|
244
250
|
autobyteus/multimedia/audio/__init__.py,sha256=RsUo63rEz8_HLJ7RonaSrYkoDKwhBmHomeseTnBX-Hg,287
|
|
245
251
|
autobyteus/multimedia/audio/audio_client_factory.py,sha256=ivR8iM3wYFGuz7PFnM-7dDgrJM8K9xUOwbOIj7tihpk,6382
|
|
246
252
|
autobyteus/multimedia/audio/audio_model.py,sha256=tiFRspsfrlOifjPH7wJDNxT7Rl695RkjD5VLNiJvI0Q,4069
|
|
247
|
-
autobyteus/multimedia/audio/autobyteus_audio_provider.py,sha256=
|
|
253
|
+
autobyteus/multimedia/audio/autobyteus_audio_provider.py,sha256=p4vfp8orsKiYGtrtNYfXyJlP95b-FKWRxiACug0GfuI,4934
|
|
248
254
|
autobyteus/multimedia/audio/base_audio_client.py,sha256=zl12JZrvDUmKEnNhEtdY7jXK0TYmil9rUgIkU_VWbL0,1498
|
|
249
255
|
autobyteus/multimedia/audio/api/__init__.py,sha256=_LHCfFqfwvbr0qSTLlioTcnb_EnfZtY1usY6nHegr1k,168
|
|
250
|
-
autobyteus/multimedia/audio/api/autobyteus_audio_client.py,sha256=
|
|
256
|
+
autobyteus/multimedia/audio/api/autobyteus_audio_client.py,sha256=KhhWCWSdbmYp3rVM3pASjWr4qZHD69Xi23hUZ1mLCgU,2641
|
|
251
257
|
autobyteus/multimedia/audio/api/gemini_audio_client.py,sha256=Mg9c7_7am8iuBNQQv1To37H8mY1Vc1xx5ZKtEfp5Sig,6410
|
|
252
258
|
autobyteus/multimedia/image/__init__.py,sha256=YWwPtRgbTtPoZBgAmjt87P-pTREOZEpJzDbKhD9jSRg,287
|
|
253
|
-
autobyteus/multimedia/image/autobyteus_image_provider.py,sha256=
|
|
259
|
+
autobyteus/multimedia/image/autobyteus_image_provider.py,sha256=mioCkUnp-ogNAt53lpdjijd5sxmvr6piCutiA3jWih0,5044
|
|
254
260
|
autobyteus/multimedia/image/base_image_client.py,sha256=sDm2n8yol590tWkujYc_FDf2cuyBNP0t4voRz9vuGr4,2819
|
|
255
261
|
autobyteus/multimedia/image/image_client_factory.py,sha256=oKNmQpIY_vMjsVDDQ_ZhrAzuJXBAmCmQv3b2IKryFzY,5636
|
|
256
262
|
autobyteus/multimedia/image/image_model.py,sha256=BxkWiQr30Fp5o6mLYMYD_6XAnElZQCU5yYe-MBN52jk,4077
|
|
257
263
|
autobyteus/multimedia/image/api/__init__.py,sha256=Vh_FC_6rxcPhJqFpAvgv3yBqHYVmxrzjyVSSrCM7rww,255
|
|
258
|
-
autobyteus/multimedia/image/api/autobyteus_image_client.py,sha256=
|
|
264
|
+
autobyteus/multimedia/image/api/autobyteus_image_client.py,sha256=MYkd-w9AMjNEEGiCaDepbMty1b0cBhyOFF3P2ybv4jc,4184
|
|
259
265
|
autobyteus/multimedia/image/api/gemini_image_client.py,sha256=OXYd9av43VjezuiaqSNehiA28EMlGlvGR2C4FC0tDes,6108
|
|
260
266
|
autobyteus/multimedia/image/api/openai_image_client.py,sha256=eiC2hh3y7flLQPWQQiuaesaTR-PBa9UD96go41mFEt8,6240
|
|
261
267
|
autobyteus/multimedia/utils/__init__.py,sha256=pH2c5CB2V-QXVl6SgL6N70KKH0VShByhZHS8m7L9TCg,298
|
|
@@ -290,7 +296,7 @@ autobyteus/rpc/server/base_method_handler.py,sha256=6sKWucR1vUYeritjJPHIX_sCQOD2
|
|
|
290
296
|
autobyteus/rpc/server/method_handlers.py,sha256=Zqrr1R3yu_hVD0qCOPpxXm4ujkvdds9wCCneIeT3gU8,14702
|
|
291
297
|
autobyteus/rpc/server/sse_server_handler.py,sha256=3F1LNLw6fXcB08hmWOUhGZROYhpPdk8xwz2TakiR-2M,16273
|
|
292
298
|
autobyteus/rpc/server/stdio_server_handler.py,sha256=pSAvVtxyo0Hytzld7WINeKHvGBqEjp0Bad-xkY2Rul4,7398
|
|
293
|
-
autobyteus/task_management/__init__.py,sha256=
|
|
299
|
+
autobyteus/task_management/__init__.py,sha256=d8OewIpNyrBOzmYFWF-g-dV2KsjCEawP7UdmOrAUykg,1604
|
|
294
300
|
autobyteus/task_management/base_task_board.py,sha256=w-mvFFgzeQuY0_P9VNWTID7SX623-iivfM1w9R4JYfk,2363
|
|
295
301
|
autobyteus/task_management/deliverable.py,sha256=cXuWD7UhP_oElhUzLGGdCwE8Fn4IokURuanz4zg35Ps,490
|
|
296
302
|
autobyteus/task_management/events.py,sha256=bDxlCW5iKtILcEF4T34AM3anQqaso8G-yDuiaAUd8zg,824
|
|
@@ -302,20 +308,20 @@ autobyteus/task_management/deliverables/__init__.py,sha256=RYBzSxKgzPnh8uE0TA2hA
|
|
|
302
308
|
autobyteus/task_management/deliverables/file_deliverable.py,sha256=tTdpgdAtXwkZ-US0n8ilEl6CYI8dRVXhGEdBBCTay8c,425
|
|
303
309
|
autobyteus/task_management/schemas/__init__.py,sha256=MfNFFHjosjuMKFRwLNwlQFFOqZOzmggWvWdxbJA2pw8,514
|
|
304
310
|
autobyteus/task_management/schemas/deliverable_schema.py,sha256=8_3F93gAeTfp6NeHqhIQLWFMpVwfiDuSOk0lnHnxxFU,603
|
|
305
|
-
autobyteus/task_management/schemas/task_definition.py,sha256=
|
|
306
|
-
autobyteus/task_management/schemas/task_status_report.py,sha256=
|
|
307
|
-
autobyteus/task_management/tools/__init__.py,sha256=
|
|
311
|
+
autobyteus/task_management/schemas/task_definition.py,sha256=ytFK2kikLnQjPgSj6X6OTethqljvTEnZ9U-tcxubZF8,2154
|
|
312
|
+
autobyteus/task_management/schemas/task_status_report.py,sha256=FgF7NNtK-GMfQNK610wlrWuEsbh43x4eAVk-d2ccO5I,1884
|
|
313
|
+
autobyteus/task_management/tools/__init__.py,sha256=OHzl_sSU-VTttwga9XKD97zMPlUdpzEQeCT1v-dqUqk,523
|
|
314
|
+
autobyteus/task_management/tools/assign_task_to.py,sha256=F1FhhEAteBdofAsUMm-g8mXhmAWJflw0L306Y1_OdYs,6245
|
|
308
315
|
autobyteus/task_management/tools/get_my_tasks.py,sha256=2SQ7UmckvlpTZWTh5JJkvfqt7n_718NmYIHk1g_rZeA,3312
|
|
309
316
|
autobyteus/task_management/tools/get_task_board_status.py,sha256=eglF_IWVCQwJBJ4gmHhGXjnDGFHRWYz45G0UbRzsf7o,2748
|
|
310
317
|
autobyteus/task_management/tools/publish_task.py,sha256=0A3gEhoiAYEECeWogMDXMSb9zsWc6W8NdV8Mz9T7Em4,3366
|
|
311
318
|
autobyteus/task_management/tools/publish_tasks.py,sha256=WkNBt6H8IQNqhCOFvp4n1H4FonbwtgqHymcVNh0xF40,3157
|
|
312
319
|
autobyteus/task_management/tools/update_task_status.py,sha256=OtlVhe3apLTcw_0yfAIdGEz9LdL4gIEmCy4knNmgcXA,5921
|
|
313
|
-
autobyteus/tools/__init__.py,sha256=
|
|
320
|
+
autobyteus/tools/__init__.py,sha256=YHODhicVhk5YOv4h83BSiKgd_LmqinLN1CLRlD7rwwE,4439
|
|
314
321
|
autobyteus/tools/base_tool.py,sha256=s7wf06jqxWBX3pu18cgooxN9RQ8u6W3GCV8I5Zwi8UA,8738
|
|
322
|
+
autobyteus/tools/download_media_tool.py,sha256=K42E3l1e3tb7-ujGUKTSr-LwbAEcVCeZGPj5aGTq7n8,6549
|
|
315
323
|
autobyteus/tools/functional_tool.py,sha256=FyifQc5D0CZIpF_5GsOV72kFMrTL_nlvVuFXHvexuKY,10393
|
|
316
324
|
autobyteus/tools/google_search.py,sha256=2x86gNHk6PGe8fQRDLw099g1KG2MXLbOW_dBex4PJB4,5890
|
|
317
|
-
autobyteus/tools/image_downloader.py,sha256=wKSzBoq7d4FgHdPoenMUmzchaeaerU4XUzzvup5mAV4,4868
|
|
318
|
-
autobyteus/tools/pdf_downloader.py,sha256=0WeznZhkYvXvgU2CH21q6LSVEQm8S1mAm7gtw_CjsJM,3927
|
|
319
325
|
autobyteus/tools/pydantic_schema_converter.py,sha256=qDVCXDBUWuXxYzO0d_taFum1gd1Av1VvHCvTzTtilF0,3402
|
|
320
326
|
autobyteus/tools/timer.py,sha256=1PI3fhmwQDgRjmXBDX6NbsE3zqNaXeuitXX75IdVog0,7384
|
|
321
327
|
autobyteus/tools/tool_category.py,sha256=pSf3C4kDc5ZGRYLmlGaU0th9YgdI-3TSS_yOdqbEzLU,740
|
|
@@ -352,6 +358,7 @@ autobyteus/tools/browser/standalone/factory/webpage_screenshot_taker_factory.py,
|
|
|
352
358
|
autobyteus/tools/factory/__init__.py,sha256=EQXbTH6BcqK2SM3JEq2PkLwzZSczExv3KDvlhWHlsGQ,275
|
|
353
359
|
autobyteus/tools/factory/tool_factory.py,sha256=-gUhcBwiQu1FQiR0nAKJp1aUZ2sXbcz-pIn4f4heFbE,1066
|
|
354
360
|
autobyteus/tools/file/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
361
|
+
autobyteus/tools/file/file_editor.py,sha256=VTJv4RscYjrh9u0uO_b0qGQArTHVoqeUkgJMOFZQ-70,8994
|
|
355
362
|
autobyteus/tools/file/file_reader.py,sha256=U8xtPXDkm-UHqizzHpTgq56-QuDLxhz8WhjlGgsseBU,2557
|
|
356
363
|
autobyteus/tools/file/file_writer.py,sha256=LQgd9arr3jLFEzpjv6WnTP9XhsD44wxBVphgznqf7O4,2681
|
|
357
364
|
autobyteus/tools/handlers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -398,13 +405,14 @@ autobyteus/tools/usage/formatters/openai_json_example_formatter.py,sha256=-Ggx3V
|
|
|
398
405
|
autobyteus/tools/usage/formatters/openai_json_schema_formatter.py,sha256=3pN4CnmWiBJaZMhV7qnWcSKPpyZ2cEdiU-FVMRfPT1w,948
|
|
399
406
|
autobyteus/tools/usage/parsers/__init__.py,sha256=4y235cYvUm60v30m4KCwQ4g9x9yP81QYBhSkUmjFWAU,915
|
|
400
407
|
autobyteus/tools/usage/parsers/_json_extractor.py,sha256=Q7BJsEcFkEZJ8q-ifIl-7t4FXZgFoFEwFXAGvKFYhCk,3601
|
|
408
|
+
autobyteus/tools/usage/parsers/_string_decoders.py,sha256=8dp5FfDIehHh5A7sKmomeEdTXqsMSJyHiuolFvipu68,638
|
|
401
409
|
autobyteus/tools/usage/parsers/anthropic_xml_tool_usage_parser.py,sha256=xAVq7bPlyfZK5YBVsNlXyyc-1J4kyVr4-wDNI0ekl_o,433
|
|
402
410
|
autobyteus/tools/usage/parsers/base_parser.py,sha256=iNHVUXMzAydnhYeEBgcXU0g8L_H9KTMavOEd-iwDLbk,1366
|
|
403
|
-
autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py,sha256=
|
|
404
|
-
autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py,sha256=
|
|
411
|
+
autobyteus/tools/usage/parsers/default_json_tool_usage_parser.py,sha256=s5B8TT5jwBpFQyDYzxPVRUptsHT3WHsJGK9XWSAnDbg,3803
|
|
412
|
+
autobyteus/tools/usage/parsers/default_xml_tool_usage_parser.py,sha256=esamQXffzI5-lsvRmOHwqF3WYOdMVW5zBdzPYVpBjgk,12344
|
|
405
413
|
autobyteus/tools/usage/parsers/exceptions.py,sha256=CncCSH4IJUYPaCTilj1oPgfZWdCycIxQBrWiSKuWXtc,468
|
|
406
|
-
autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py,sha256=
|
|
407
|
-
autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py,sha256=
|
|
414
|
+
autobyteus/tools/usage/parsers/gemini_json_tool_usage_parser.py,sha256=bL9i4jqWKDXK7thOblfozggLfGPKMNIpIsTcYFEYtcA,3721
|
|
415
|
+
autobyteus/tools/usage/parsers/openai_json_tool_usage_parser.py,sha256=_p8Uyzv29yhhAG7MPgp7a5JEPZYNCx6ffUbRBb3eYwU,7111
|
|
408
416
|
autobyteus/tools/usage/parsers/provider_aware_tool_usage_parser.py,sha256=OVPQpNlDCvAIKE5kKXFUIMdaTTK3pyJW2oCQ_bkOPBk,2829
|
|
409
417
|
autobyteus/tools/usage/providers/__init__.py,sha256=C8GmfzYwzSS2OGv7MbvxtRe0OsIALvkC7rN7OWvA5p4,445
|
|
410
418
|
autobyteus/tools/usage/providers/tool_manifest_provider.py,sha256=r-q9YkNYXEbNApAjufvxGuU4JPiu78x6u60wjTZcnfM,4668
|
|
@@ -471,7 +479,7 @@ autobyteus/workflow/streaming/workflow_stream_event_payloads.py,sha256=jv1bVYg-7
|
|
|
471
479
|
autobyteus/workflow/streaming/workflow_stream_events.py,sha256=75P29jNgcL7Go7D9wVz236KTwPfmqc5K7hUvVnc94K0,2221
|
|
472
480
|
autobyteus/workflow/utils/__init__.py,sha256=SzaMZHnJBIJKcT_r-HOeyIcuxzRu2bGeFkOcMLJaalk,222
|
|
473
481
|
autobyteus/workflow/utils/wait_for_idle.py,sha256=FgHtz59DN0eg8Na1PkkVR55Ihdd2e5Gn_mr7RVHl4qI,2001
|
|
474
|
-
autobyteus-1.
|
|
482
|
+
autobyteus-1.2.0.dist-info/licenses/LICENSE,sha256=Ompok_c8HRsXRwmax-pGR9OZRRxZC9RPp4JB6eTJd0M,1360
|
|
475
483
|
examples/__init__.py,sha256=BtTQJ6yeHyksK5GC3kfN6RFR6Gcrwq1TBmp6FIIj3Z8,40
|
|
476
484
|
examples/discover_phase_transitions.py,sha256=NiFK_XzDCpWwmNsQqf0Ou2w6L5bofKIKODq7sH5uPzk,3679
|
|
477
485
|
examples/run_browser_agent.py,sha256=tpBJGIYYvVsNZAUo_WsZbhV_8fdeORUoHlQ8uQvnXPM,11737
|
|
@@ -482,7 +490,7 @@ examples/run_mcp_list_tools.py,sha256=-dOM-7xyyDM2gp5e_8KZVGbX5ZxWqFQB9l-fHfR8Xx
|
|
|
482
490
|
examples/run_poem_writer.py,sha256=cHOy-EoLG01cHTeX0Xf8a-Mti4CCoeDEqzw0mYG1QOU,13145
|
|
483
491
|
examples/run_sqlite_agent.py,sha256=wy1Mp_F7RR0WmvfmxsPLG9JFPi6SpTVd0x_Ep76bUQ8,13159
|
|
484
492
|
examples/agent_team/__init__.py,sha256=WIg0HENp1TUClJ3p2gIRn0C-VW9Qr7Ttqtedr4xQ3Jo,51
|
|
485
|
-
autobyteus-1.
|
|
486
|
-
autobyteus-1.
|
|
487
|
-
autobyteus-1.
|
|
488
|
-
autobyteus-1.
|
|
493
|
+
autobyteus-1.2.0.dist-info/METADATA,sha256=tRkJzpfqgU4lqbrzIEZUMbBc0fKerbI-HcrmyNJIzaM,10179
|
|
494
|
+
autobyteus-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
495
|
+
autobyteus-1.2.0.dist-info/top_level.txt,sha256=vNmK1Y8Irbc0iDPdRtr9gIx5eLM-c2v1ntItkzICzHU,20
|
|
496
|
+
autobyteus-1.2.0.dist-info/RECORD,,
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import os
|
|
2
|
-
import aiohttp
|
|
3
|
-
import logging
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
from typing import Optional, TYPE_CHECKING, Any
|
|
6
|
-
|
|
7
|
-
from autobyteus.tools.base_tool import BaseTool
|
|
8
|
-
from autobyteus.tools.tool_config import ToolConfig
|
|
9
|
-
from autobyteus.utils.parameter_schema import ParameterSchema, ParameterDefinition, ParameterType
|
|
10
|
-
from autobyteus.tools.tool_category import ToolCategory
|
|
11
|
-
from PIL import Image
|
|
12
|
-
from io import BytesIO
|
|
13
|
-
from autobyteus.utils.file_utils import get_default_download_folder
|
|
14
|
-
from autobyteus.events.event_types import EventType
|
|
15
|
-
|
|
16
|
-
if TYPE_CHECKING:
|
|
17
|
-
from autobyteus.agent.context import AgentContext
|
|
18
|
-
|
|
19
|
-
logger = logging.getLogger(__name__)
|
|
20
|
-
|
|
21
|
-
class ImageDownloader(BaseTool):
|
|
22
|
-
CATEGORY = ToolCategory.WEB
|
|
23
|
-
supported_formats = ['.jpeg', '.jpg', '.gif', '.png', '.webp']
|
|
24
|
-
|
|
25
|
-
def __init__(self, config: Optional[ToolConfig] = None):
|
|
26
|
-
super().__init__(config=config)
|
|
27
|
-
|
|
28
|
-
custom_download_folder = None
|
|
29
|
-
if config:
|
|
30
|
-
custom_download_folder = config.get('custom_download_folder')
|
|
31
|
-
|
|
32
|
-
self.default_download_folder = get_default_download_folder()
|
|
33
|
-
self.download_folder = custom_download_folder or self.default_download_folder
|
|
34
|
-
self.last_downloaded_image = None
|
|
35
|
-
|
|
36
|
-
# Explicitly subscribe the handler in the constructor
|
|
37
|
-
self.subscribe(EventType.WEIBO_POST_COMPLETED, self.on_weibo_post_completed)
|
|
38
|
-
|
|
39
|
-
logger.debug(f"ImageDownloader initialized with download_folder: {self.download_folder}")
|
|
40
|
-
|
|
41
|
-
@classmethod
|
|
42
|
-
def get_description(cls) -> str:
|
|
43
|
-
return f"Downloads an image from a given URL. Supported formats: {', '.join(format.upper()[1:] for format in cls.supported_formats)}."
|
|
44
|
-
|
|
45
|
-
@classmethod
|
|
46
|
-
def get_argument_schema(cls) -> Optional[ParameterSchema]:
|
|
47
|
-
schema = ParameterSchema()
|
|
48
|
-
schema.add_parameter(ParameterDefinition(name="url", param_type=ParameterType.STRING, description=f"A direct URL to an image file (must end with {', '.join(cls.supported_formats)}).", required=True))
|
|
49
|
-
schema.add_parameter(ParameterDefinition(name="folder", param_type=ParameterType.STRING, description="Optional. Custom directory path to save this specific image. Overrides instance default.", required=False))
|
|
50
|
-
return schema
|
|
51
|
-
|
|
52
|
-
@classmethod
|
|
53
|
-
def get_config_schema(cls) -> Optional[ParameterSchema]:
|
|
54
|
-
schema = ParameterSchema()
|
|
55
|
-
schema.add_parameter(ParameterDefinition(name="custom_download_folder", param_type=ParameterType.STRING, description="Custom directory path where downloaded images will be saved by default.", required=False, default_value=None))
|
|
56
|
-
return schema
|
|
57
|
-
|
|
58
|
-
async def _execute(self, context: 'AgentContext', url: str, folder: Optional[str] = None) -> str:
|
|
59
|
-
current_download_folder = folder or self.download_folder
|
|
60
|
-
if not any(url.lower().endswith(fmt) for fmt in self.supported_formats):
|
|
61
|
-
raise ValueError(f"Unsupported image format. URL must end with one of: {', '.join(self.supported_formats)}.")
|
|
62
|
-
|
|
63
|
-
try:
|
|
64
|
-
async with aiohttp.ClientSession() as session:
|
|
65
|
-
async with session.get(url) as response:
|
|
66
|
-
response.raise_for_status()
|
|
67
|
-
image_bytes = await response.read()
|
|
68
|
-
|
|
69
|
-
with Image.open(BytesIO(image_bytes)) as img:
|
|
70
|
-
img.verify()
|
|
71
|
-
|
|
72
|
-
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
73
|
-
extension = os.path.splitext(url)[1].lower() or ".png"
|
|
74
|
-
|
|
75
|
-
filename = f"downloaded_image_{timestamp}{extension}"
|
|
76
|
-
filepath = os.path.join(current_download_folder, filename)
|
|
77
|
-
|
|
78
|
-
os.makedirs(current_download_folder, exist_ok=True)
|
|
79
|
-
with open(filepath, 'wb') as f:
|
|
80
|
-
f.write(image_bytes)
|
|
81
|
-
|
|
82
|
-
self.last_downloaded_image = filepath
|
|
83
|
-
logger.info(f"The image is downloaded and stored at: {filepath}")
|
|
84
|
-
self.emit(EventType.IMAGE_DOWNLOADED, image_path=filepath)
|
|
85
|
-
return f"The image is downloaded and stored at: {filepath}"
|
|
86
|
-
except Exception as e:
|
|
87
|
-
logger.error(f"Error processing image from {url}: {str(e)}", exc_info=True)
|
|
88
|
-
raise ValueError(f"Error processing image from {url}: {str(e)}")
|
|
89
|
-
|
|
90
|
-
def on_weibo_post_completed(self): # No **kwargs needed due to intelligent dispatch
|
|
91
|
-
if self.last_downloaded_image and os.path.exists(self.last_downloaded_image):
|
|
92
|
-
try:
|
|
93
|
-
os.remove(self.last_downloaded_image)
|
|
94
|
-
logger.info(f"Removed downloaded image: {self.last_downloaded_image} after Weibo post.")
|
|
95
|
-
except Exception as e:
|
|
96
|
-
logger.error(f"Failed to remove downloaded image: {self.last_downloaded_image}. Error: {str(e)}", exc_info=True)
|
|
97
|
-
else:
|
|
98
|
-
logger.debug("No last downloaded image to remove or image file not found.")
|
|
99
|
-
self.last_downloaded_image = None
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# This was top-level, keep it there.
|
|
2
|
-
import os
|
|
3
|
-
import logging
|
|
4
|
-
import asyncio
|
|
5
|
-
import requests
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
from typing import TYPE_CHECKING, Optional
|
|
8
|
-
|
|
9
|
-
from autobyteus.tools import tool
|
|
10
|
-
from autobyteus.tools.tool_category import ToolCategory
|
|
11
|
-
from autobyteus.utils.file_utils import get_default_download_folder
|
|
12
|
-
|
|
13
|
-
if TYPE_CHECKING:
|
|
14
|
-
from autobyteus.agent.context import AgentContext
|
|
15
|
-
|
|
16
|
-
logger = logging.getLogger(__name__)
|
|
17
|
-
|
|
18
|
-
@tool(name="PDFDownloader", category=ToolCategory.WEB)
|
|
19
|
-
async def pdf_downloader( # function name can be pdf_downloader
|
|
20
|
-
context: 'AgentContext',
|
|
21
|
-
url: str,
|
|
22
|
-
folder: Optional[str] = None
|
|
23
|
-
) -> str:
|
|
24
|
-
"""
|
|
25
|
-
Downloads a PDF file from a given URL and saves it locally.
|
|
26
|
-
'url' is the URL of the PDF.
|
|
27
|
-
'folder' (optional) is a custom directory to save the PDF. If not given,
|
|
28
|
-
uses the system's default download folder. Validates Content-Type.
|
|
29
|
-
"""
|
|
30
|
-
logger.debug(f"Functional PDFDownloader tool for agent {context.agent_id}, URL: {url}, Folder: {folder}")
|
|
31
|
-
|
|
32
|
-
current_download_folder = folder if folder else get_default_download_folder()
|
|
33
|
-
|
|
34
|
-
try:
|
|
35
|
-
loop = asyncio.get_event_loop()
|
|
36
|
-
response = await loop.run_in_executor(None, lambda: requests.get(url, stream=True, timeout=30))
|
|
37
|
-
response.raise_for_status()
|
|
38
|
-
|
|
39
|
-
content_type = response.headers.get('Content-Type', '').lower()
|
|
40
|
-
if 'application/pdf' not in content_type:
|
|
41
|
-
response.close()
|
|
42
|
-
raise ValueError(f"The URL does not point to a PDF file. Content-Type: {content_type}")
|
|
43
|
-
|
|
44
|
-
timestamp = datetime.now().strftime("%Y%m%d_%H%M%S")
|
|
45
|
-
filename_from_header = None
|
|
46
|
-
if 'Content-Disposition' in response.headers:
|
|
47
|
-
import re
|
|
48
|
-
match = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', response.headers['Content-Disposition'])
|
|
49
|
-
if match: filename_from_header = match.group(1)
|
|
50
|
-
|
|
51
|
-
if filename_from_header and filename_from_header.lower().endswith(".pdf"):
|
|
52
|
-
import string
|
|
53
|
-
valid_chars = "-_.() %s%s" % (string.ascii_letters, string.digits)
|
|
54
|
-
filename_from_header = ''.join(c for c in filename_from_header if c in valid_chars)[:200]
|
|
55
|
-
filename = f"{timestamp}_{filename_from_header}"
|
|
56
|
-
else:
|
|
57
|
-
filename = f"downloaded_pdf_{timestamp}.pdf"
|
|
58
|
-
|
|
59
|
-
save_path = os.path.join(current_download_folder, filename)
|
|
60
|
-
os.makedirs(current_download_folder, exist_ok=True)
|
|
61
|
-
|
|
62
|
-
def download_and_save_sync():
|
|
63
|
-
with open(save_path, 'wb') as file_handle:
|
|
64
|
-
for chunk in response.iter_content(chunk_size=8192):
|
|
65
|
-
file_handle.write(chunk)
|
|
66
|
-
response.close()
|
|
67
|
-
|
|
68
|
-
await loop.run_in_executor(None, download_and_save_sync)
|
|
69
|
-
|
|
70
|
-
logger.info(f"PDF successfully downloaded and saved to {save_path}")
|
|
71
|
-
return f"PDF successfully downloaded and saved to {save_path}"
|
|
72
|
-
except requests.exceptions.Timeout:
|
|
73
|
-
logger.error(f"Timeout downloading PDF from {url}", exc_info=True)
|
|
74
|
-
return f"Error downloading PDF: Timeout occurred for URL {url}"
|
|
75
|
-
except requests.exceptions.RequestException as e:
|
|
76
|
-
logger.error(f"Error downloading PDF from {url}: {str(e)}", exc_info=True)
|
|
77
|
-
return f"Error downloading PDF: {str(e)}"
|
|
78
|
-
except ValueError as e:
|
|
79
|
-
logger.error(f"Content type error for PDF from {url}: {str(e)}", exc_info=True)
|
|
80
|
-
return str(e)
|
|
81
|
-
except IOError as e:
|
|
82
|
-
logger.error(f"Error saving PDF to {current_download_folder}: {str(e)}", exc_info=True)
|
|
83
|
-
return f"Error saving PDF: {str(e)}"
|
|
84
|
-
except Exception as e:
|
|
85
|
-
logger.error(f"Unexpected error downloading PDF from {url}: {str(e)}", exc_info=True)
|
|
86
|
-
return f"An unexpected error occurred: {str(e)}"
|
|
87
|
-
finally:
|
|
88
|
-
if 'response' in locals() and hasattr(response, 'close') and response.raw and not response.raw.closed:
|
|
89
|
-
response.close()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|