agently 4.0.6.2__py3-none-any.whl → 4.0.6.4__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.
- agently/builtins/plugins/ModelRequester/OpenAICompatible.py +6 -2
- agently/builtins/plugins/ToolManager/AgentlyToolManager.py +15 -2
- agently/utils/Storage.py +1 -0
- agently/utils/__init__.py +2 -1
- {agently-4.0.6.2.dist-info → agently-4.0.6.4.dist-info}/METADATA +1 -2
- {agently-4.0.6.2.dist-info → agently-4.0.6.4.dist-info}/RECORD +8 -8
- {agently-4.0.6.2.dist-info → agently-4.0.6.4.dist-info}/WHEEL +0 -0
- {agently-4.0.6.2.dist-info → agently-4.0.6.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -391,7 +391,9 @@ class OpenAICompatible(ModelRequester):
|
|
|
391
391
|
# Raise status code >= 400
|
|
392
392
|
if response.status_code >= 400:
|
|
393
393
|
e = RequestError(
|
|
394
|
-
f"Status Code: { response.status_code }\n"
|
|
394
|
+
f"Status Code: { response.status_code }\n"
|
|
395
|
+
f"Detail: { response.text }\n"
|
|
396
|
+
f"Request Data: {full_request_data}"
|
|
395
397
|
)
|
|
396
398
|
self._messenger.error(
|
|
397
399
|
e,
|
|
@@ -461,7 +463,9 @@ class OpenAICompatible(ModelRequester):
|
|
|
461
463
|
)
|
|
462
464
|
if response.status_code >= 400:
|
|
463
465
|
e = RequestError(
|
|
464
|
-
f"Status Code: { response.status_code }\n"
|
|
466
|
+
f"Status Code: { response.status_code }\n"
|
|
467
|
+
f"Detail: { response.text }\n"
|
|
468
|
+
f"Request Data: {full_request_data}"
|
|
465
469
|
)
|
|
466
470
|
self._messenger.error(
|
|
467
471
|
e,
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# See the License for the specific language governing permissions and
|
|
13
13
|
# limitations under the License.
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
import json
|
|
16
16
|
import inspect
|
|
17
17
|
|
|
18
18
|
from typing import (
|
|
@@ -206,6 +206,7 @@ class AgentlyToolManager(ToolManager):
|
|
|
206
206
|
):
|
|
207
207
|
async def _call_mcp_tool(**kwargs):
|
|
208
208
|
from fastmcp import Client
|
|
209
|
+
from mcp.types import TextContent, ImageContent, AudioContent, ResourceLink, EmbeddedResource
|
|
209
210
|
|
|
210
211
|
async with Client(transport) as client: # type: ignore
|
|
211
212
|
mcp_result = await client.call_tool(
|
|
@@ -216,7 +217,19 @@ class AgentlyToolManager(ToolManager):
|
|
|
216
217
|
if mcp_result.is_error:
|
|
217
218
|
return {"error": mcp_result.content[0].text} # type: ignore
|
|
218
219
|
else:
|
|
219
|
-
|
|
220
|
+
if mcp_result.structured_content:
|
|
221
|
+
return mcp_result.structured_content
|
|
222
|
+
try:
|
|
223
|
+
result = mcp_result.content[0]
|
|
224
|
+
if isinstance(result, TextContent):
|
|
225
|
+
try:
|
|
226
|
+
return json.loads(result.text)
|
|
227
|
+
except json.decoder.JSONDecodeError:
|
|
228
|
+
return result.text
|
|
229
|
+
elif isinstance(result, (ImageContent, AudioContent, ResourceLink, EmbeddedResource)):
|
|
230
|
+
return result.model_dump()
|
|
231
|
+
except:
|
|
232
|
+
return None
|
|
220
233
|
|
|
221
234
|
return _call_mcp_tool
|
|
222
235
|
|
agently/utils/Storage.py
CHANGED
|
@@ -29,6 +29,7 @@ from .LazyImport import LazyImport
|
|
|
29
29
|
|
|
30
30
|
LazyImport.import_package("sqlmodel")
|
|
31
31
|
LazyImport.import_package("sqlalchemy")
|
|
32
|
+
LazyImport.import_package("aiosqlite")
|
|
32
33
|
|
|
33
34
|
from sqlmodel import SQLModel, select, inspect, create_engine, Session # type: ignore
|
|
34
35
|
from sqlalchemy.ext.asyncio import create_async_engine, AsyncSession, async_sessionmaker # type: ignore
|
agently/utils/__init__.py
CHANGED
|
@@ -17,7 +17,8 @@ from .Messenger import create_messenger
|
|
|
17
17
|
from .RuntimeData import RuntimeData, RuntimeDataNamespace
|
|
18
18
|
from .SerializableRuntimeData import SerializableRuntimeData, SerializableRuntimeDataNamespace
|
|
19
19
|
from .Settings import Settings, SettingsNamespace
|
|
20
|
-
|
|
20
|
+
|
|
21
|
+
# from .Storage import Storage, AsyncStorage
|
|
21
22
|
from .FunctionShifter import FunctionShifter
|
|
22
23
|
from .DataFormatter import DataFormatter
|
|
23
24
|
from .DataPathBuilder import DataPathBuilder
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: agently
|
|
3
|
-
Version: 4.0.6.
|
|
3
|
+
Version: 4.0.6.4
|
|
4
4
|
Summary:
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -14,7 +14,6 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.12
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.13
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.14
|
|
17
|
-
Requires-Dist: aiosqlite (>=0.21.0,<0.22.0)
|
|
18
17
|
Requires-Dist: greenlet (>=3.2.3,<4.0.0)
|
|
19
18
|
Requires-Dist: httpx (>=0.28.1,<0.29.0)
|
|
20
19
|
Requires-Dist: httpx-sse (>=0.4.1,<0.5.0)
|
|
@@ -11,10 +11,10 @@ agently/builtins/agent_extensions/__init__.py,sha256=IxWRQogF8PCVNXeY7D4qhGukEx3
|
|
|
11
11
|
agently/builtins/hookers/ConsoleHooker.py,sha256=aJdDj_nG8CiwyelA505zvtpzBSwD52nFIkBRDJGgq3Y,8099
|
|
12
12
|
agently/builtins/hookers/PureLoggerHooker.py,sha256=fzN0OfhQzgns4KeCNH-qcdm-BdQT0W2kqEmt3Zp2pYI,1906
|
|
13
13
|
agently/builtins/hookers/SystemMessageHooker.py,sha256=nU5rOzcuXKdaTXWix3jhZ-4QoD4cMQJZo02wNTpZpjI,5396
|
|
14
|
-
agently/builtins/plugins/ModelRequester/OpenAICompatible.py,sha256=
|
|
14
|
+
agently/builtins/plugins/ModelRequester/OpenAICompatible.py,sha256=ApH6EKAWY66eKpm-BtK6qID73CelLFA_7EfJ4zvRH1k,25233
|
|
15
15
|
agently/builtins/plugins/PromptGenerator/AgentlyPromptGenerator.py,sha256=hUj3bkWLZvLmYwJoFpEfGjbF0VL-gKiHHoKoHFJgzvs,28906
|
|
16
16
|
agently/builtins/plugins/ResponseParser/AgentlyResponseParser.py,sha256=FEhfsiHB4Bx7HfghnObklLj08j8IVwGh0WEVD6U-G3U,17445
|
|
17
|
-
agently/builtins/plugins/ToolManager/AgentlyToolManager.py,sha256=
|
|
17
|
+
agently/builtins/plugins/ToolManager/AgentlyToolManager.py,sha256=oaqte5LAryZQMD6vuEbKhe6kOLUyZTRZswC1MDFiYxw,9138
|
|
18
18
|
agently/builtins/plugins/__init__.py,sha256=wj4_U9TTekc2CmjppbXKUREDFRXFX1y0ySOW-CxQuok,801
|
|
19
19
|
agently/builtins/tools/Browse.py,sha256=gIePs-gtsqOI_ZTReGqEcoKvhs4FkBzTxow--QS5_ek,3469
|
|
20
20
|
agently/builtins/tools/Search.py,sha256=tUynNiW_ZMAGaB2ua3HRcY_trIbLEoASFE-p2QMQ0Zg,7362
|
|
@@ -66,11 +66,11 @@ agently/utils/Messenger.py,sha256=dLasJvDt1HxJttt6X9dutwGPvyAtL7yp6BZ3TDxuFDI,72
|
|
|
66
66
|
agently/utils/RuntimeData.py,sha256=SewZ8D1fljuDwfVZTAqZ0XTNEcU2cuAr7QlVqk0vzrE,21925
|
|
67
67
|
agently/utils/SerializableRuntimeData.py,sha256=bVVwin50VnOs30W881ClFepSXAK8GCOUZnVd-SiolRw,3314
|
|
68
68
|
agently/utils/Settings.py,sha256=_s300H2doCMKcvMAmFwW3cLQqmd0N8BVmb226tAfVec,5294
|
|
69
|
-
agently/utils/Storage.py,sha256=
|
|
69
|
+
agently/utils/Storage.py,sha256=E7QyNJ9T0yOUafPgdP90La698hgLMSGjhJ7qCEHzxxw,9438
|
|
70
70
|
agently/utils/StreamingJSONCompleter.py,sha256=aZ9zuGUTQlP-QKbXHUZCf6EtVuG49MKn8xdhw0VhDEA,4292
|
|
71
71
|
agently/utils/StreamingJSONParser.py,sha256=sPPJOtj5OYvsrukRErcoxRl4yuV1zDuf7pQ_pvw_Zow,21116
|
|
72
|
-
agently/utils/__init__.py,sha256=
|
|
73
|
-
agently-4.0.6.
|
|
74
|
-
agently-4.0.6.
|
|
75
|
-
agently-4.0.6.
|
|
76
|
-
agently-4.0.6.
|
|
72
|
+
agently/utils/__init__.py,sha256=7MDln5OVkqFEdhhuG8VTdr2q02UWwCj-udndwzWV_iQ,1280
|
|
73
|
+
agently-4.0.6.4.dist-info/METADATA,sha256=KqzCtQbUuUuuq6bDvLprqwHxzc96-W-WAbCx-83EpBU,7112
|
|
74
|
+
agently-4.0.6.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
75
|
+
agently-4.0.6.4.dist-info/licenses/LICENSE,sha256=Y5ZgAdYgMFigPT8dhN18dTLRtBshOSfWhTDRO1t0Cq4,11360
|
|
76
|
+
agently-4.0.6.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|