beswarm 0.3.10__py3-none-any.whl → 0.3.11__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 +7 -1
- {beswarm-0.3.10.dist-info → beswarm-0.3.11.dist-info}/METADATA +1 -1
- {beswarm-0.3.10.dist-info → beswarm-0.3.11.dist-info}/RECORD +6 -6
- {beswarm-0.3.10.dist-info → beswarm-0.3.11.dist-info}/WHEEL +0 -0
- {beswarm-0.3.10.dist-info → beswarm-0.3.11.dist-info}/entry_points.txt +0 -0
- {beswarm-0.3.10.dist-info → beswarm-0.3.11.dist-info}/top_level.txt +0 -0
beswarm/tools/search_web.py
CHANGED
@@ -51,7 +51,13 @@ async def search_web(query: str):
|
|
51
51
|
async with httpx.AsyncClient() as client:
|
52
52
|
response = await client.post(api_url, headers=headers, data=payload)
|
53
53
|
response.raise_for_status() # 如果状态码是 4xx 或 5xx,则引发 HTTPStatusError
|
54
|
-
|
54
|
+
# The API can return either a JSON object or a string containing JSON.
|
55
|
+
# This handles both cases to avoid a TypeError.
|
56
|
+
decoded_response = response.json()
|
57
|
+
if isinstance(decoded_response, str):
|
58
|
+
results = json.loads(decoded_response)
|
59
|
+
else:
|
60
|
+
results = decoded_response
|
55
61
|
except httpx.HTTPStatusError as e:
|
56
62
|
return {
|
57
63
|
"error": f"HTTP error occurred: {e.response.status_code} - {e.response.text}",
|
@@ -116,13 +116,13 @@ beswarm/tools/repomap.py,sha256=w98aHmjNjtvcUVc5maWORqzKqDy2KVGLooOe__uJVCU,4523
|
|
116
116
|
beswarm/tools/request_input.py,sha256=3n2UW8m8Q7dxGhd7L7hzSJ1kk4ekMbtdtNZZT3dJf20,938
|
117
117
|
beswarm/tools/screenshot.py,sha256=hyL6F8_k9Y03Nb_X18cY-klCpWWdkqyC-iGXfKX-7jc,1007
|
118
118
|
beswarm/tools/search_arxiv.py,sha256=NLiJV1B7Um6EuZXLxnL950d837_he2LGG7qaGACSgwg,10750
|
119
|
-
beswarm/tools/search_web.py,sha256=
|
119
|
+
beswarm/tools/search_web.py,sha256=yARa0fLRXGDm3Wdrxb_ISmWe99b-fPH-BrP37qsdMYY,17804
|
120
120
|
beswarm/tools/subtasks.py,sha256=Fsf_542CkECcwFwxD-F38_IUsmk06xe1P7e6pBPTy4Y,12894
|
121
121
|
beswarm/tools/worker.py,sha256=mQ1qdrQ8MgL99byAbTvxfEByFFGN9mty3UHqHjARMQ8,2331
|
122
122
|
beswarm/tools/write_csv.py,sha256=u0Hq18Ksfheb52MVtyLNCnSDHibITpsYBPs2ub7USYA,1466
|
123
123
|
beswarm/tools/write_file.py,sha256=L2coBqz-aRFxPBvJBrbWbUJhu7p3oKAAGb9R144bFtk,4926
|
124
|
-
beswarm-0.3.
|
125
|
-
beswarm-0.3.
|
126
|
-
beswarm-0.3.
|
127
|
-
beswarm-0.3.
|
128
|
-
beswarm-0.3.
|
124
|
+
beswarm-0.3.11.dist-info/METADATA,sha256=Lg7pycqsatSZLBeuoHVbeiQ6gMthrI87seEw3RLaOtk,3878
|
125
|
+
beswarm-0.3.11.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
126
|
+
beswarm-0.3.11.dist-info/entry_points.txt,sha256=URK7Y4PDzBgxIecQnxsWTu4O-eaFa1CoAcNTWh5R7LM,45
|
127
|
+
beswarm-0.3.11.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
|
128
|
+
beswarm-0.3.11.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|