beswarm 0.1.92__py3-none-any.whl → 0.1.93__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/tools/search_web.py +11 -6
- beswarm/tools/worker.py +2 -2
- {beswarm-0.1.92.dist-info → beswarm-0.1.93.dist-info}/METADATA +1 -1
- {beswarm-0.1.92.dist-info → beswarm-0.1.93.dist-info}/RECORD +6 -6
- {beswarm-0.1.92.dist-info → beswarm-0.1.93.dist-info}/WHEEL +0 -0
- {beswarm-0.1.92.dist-info → beswarm-0.1.93.dist-info}/top_level.txt +0 -0
beswarm/tools/search_web.py
CHANGED
@@ -48,27 +48,32 @@ async def search_web(query: str):
|
|
48
48
|
except httpx.HTTPStatusError as e:
|
49
49
|
return {
|
50
50
|
"error": f"HTTP error occurred: {e.response.status_code} - {e.response.text}",
|
51
|
-
"status_code": e.response.status_code
|
51
|
+
"status_code": e.response.status_code,
|
52
|
+
"code": 400
|
52
53
|
}
|
53
54
|
except httpx.RequestError as e:
|
54
55
|
return {
|
55
56
|
"error": f"An error occurred while requesting {e.request.url!r}: {e}",
|
56
|
-
"request_url": str(e.request.url)
|
57
|
+
"request_url": str(e.request.url),
|
58
|
+
"code": 400
|
57
59
|
}
|
58
60
|
except json.JSONDecodeError:
|
59
61
|
return {
|
60
62
|
"error": "Failed to decode JSON response from the API.",
|
61
|
-
"response_text": response.text if 'response' in locals() else "No response text available"
|
63
|
+
"response_text": response.text if 'response' in locals() else "No response text available",
|
64
|
+
"code": 400
|
62
65
|
}
|
63
66
|
except Exception as e:
|
64
67
|
return {
|
65
|
-
"error": f"An unexpected error occurred: {str(e)}"
|
68
|
+
"error": f"An unexpected error occurred: {str(e)}",
|
69
|
+
"code": 400
|
66
70
|
}
|
67
71
|
|
68
72
|
unique_urls = []
|
69
|
-
if "error" in results:
|
70
|
-
print(f"Error fetching search results for '{query}':")
|
73
|
+
if "error" in results or results.get("code", 200) != 200:
|
74
|
+
# print(f"Error fetching search results for '{query}':")
|
71
75
|
print(json.dumps(results, indent=2, ensure_ascii=False))
|
76
|
+
raise Exception(f"Error fetching search results for '{query}':")
|
72
77
|
else:
|
73
78
|
# print(f"Search results for '{query}':")
|
74
79
|
html_content = results.get("data", {}).get("result", {}).get("html", "")
|
beswarm/tools/worker.py
CHANGED
@@ -72,7 +72,7 @@ async def worker(goal, tools, work_dir, cache_messages=None):
|
|
72
72
|
if cache_file_path.exists():
|
73
73
|
with cache_file_path.open("r", encoding="utf-8") as f:
|
74
74
|
cache_messages = json.load(f)
|
75
|
-
if cache_messages and isinstance(cache_messages, list) and len(cache_messages) >
|
75
|
+
if cache_messages and isinstance(cache_messages, list) and len(cache_messages) > 1:
|
76
76
|
first_user_message = replace_xml_content(cache_messages[1]["content"], "goal", goal)
|
77
77
|
work_agent_config["cache_messages"] = cache_messages[0:1] + [{"role": "user", "content": first_user_message}] + cache_messages[2:]
|
78
78
|
|
@@ -240,7 +240,7 @@ async def worker_gen(goal, tools, work_dir, cache_messages=None):
|
|
240
240
|
if cache_file_path.exists():
|
241
241
|
with cache_file_path.open("r", encoding="utf-8") as f:
|
242
242
|
cache_messages = json.load(f)
|
243
|
-
if cache_messages and isinstance(cache_messages, list) and len(cache_messages) >
|
243
|
+
if cache_messages and isinstance(cache_messages, list) and len(cache_messages) > 1:
|
244
244
|
first_user_message = replace_xml_content(cache_messages[1]["content"], "goal", goal)
|
245
245
|
work_agent_config["cache_messages"] = cache_messages[0:1] + [{"role": "user", "content": first_user_message}] + cache_messages[2:]
|
246
246
|
|
@@ -131,10 +131,10 @@ beswarm/tools/planner.py,sha256=lguBCS6kpwNPoXQvqH-WySabVubT82iyWOkJnjt6dXw,1265
|
|
131
131
|
beswarm/tools/repomap.py,sha256=N09K0UgwjCN7Zjg_5TYlVsulp3n2fztYlS8twalChU8,45003
|
132
132
|
beswarm/tools/screenshot.py,sha256=u6t8FCgW5YHJ_Oc4coo8e0F3wTusWE_-H8dFh1rBq9Q,1011
|
133
133
|
beswarm/tools/search_arxiv.py,sha256=GpuIOYX8T0iRC-X-hmuR9AUJVn15WWZq864DaoC7BUc,8004
|
134
|
-
beswarm/tools/search_web.py,sha256=
|
134
|
+
beswarm/tools/search_web.py,sha256=w0T0aCqOVlb6Of5hn_TtpnrGXo6bMtw2aKZdkrYjycI,12069
|
135
135
|
beswarm/tools/think.py,sha256=WLw-7jNIsnS6n8MMSYUin_f-BGLENFmnKM2LISEp0co,1760
|
136
|
-
beswarm/tools/worker.py,sha256=
|
137
|
-
beswarm-0.1.
|
138
|
-
beswarm-0.1.
|
139
|
-
beswarm-0.1.
|
140
|
-
beswarm-0.1.
|
136
|
+
beswarm/tools/worker.py,sha256=E0NmvoAqHAxRCIUkn75Tf51kPmp3si1RA56TT-akzP8,17597
|
137
|
+
beswarm-0.1.93.dist-info/METADATA,sha256=kbRl2mGdzYj3vVZuPfZHjIUI6QGiRfi_jHC7-p8r1Ww,3584
|
138
|
+
beswarm-0.1.93.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
139
|
+
beswarm-0.1.93.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
140
|
+
beswarm-0.1.93.dist-info/RECORD,,
|
File without changes
|
File without changes
|