agentex-sdk 0.9.0__py3-none-any.whl → 0.9.2__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.
- agentex/_base_client.py +5 -2
- agentex/_compat.py +3 -3
- agentex/_utils/_json.py +35 -0
- agentex/_version.py +1 -1
- agentex/lib/adk/providers/_modules/litellm.py +7 -1
- agentex/lib/types/llm_messages.py +1 -0
- {agentex_sdk-0.9.0.dist-info → agentex_sdk-0.9.2.dist-info}/METADATA +2 -2
- {agentex_sdk-0.9.0.dist-info → agentex_sdk-0.9.2.dist-info}/RECORD +11 -10
- {agentex_sdk-0.9.0.dist-info → agentex_sdk-0.9.2.dist-info}/WHEEL +0 -0
- {agentex_sdk-0.9.0.dist-info → agentex_sdk-0.9.2.dist-info}/entry_points.txt +0 -0
- {agentex_sdk-0.9.0.dist-info → agentex_sdk-0.9.2.dist-info}/licenses/LICENSE +0 -0
agentex/_base_client.py
CHANGED
|
@@ -86,6 +86,7 @@ from ._exceptions import (
|
|
|
86
86
|
APIConnectionError,
|
|
87
87
|
APIResponseValidationError,
|
|
88
88
|
)
|
|
89
|
+
from ._utils._json import openapi_dumps
|
|
89
90
|
|
|
90
91
|
log: logging.Logger = logging.getLogger(__name__)
|
|
91
92
|
|
|
@@ -554,8 +555,10 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
|
554
555
|
kwargs["content"] = options.content
|
|
555
556
|
elif isinstance(json_data, bytes):
|
|
556
557
|
kwargs["content"] = json_data
|
|
557
|
-
|
|
558
|
-
|
|
558
|
+
elif not files:
|
|
559
|
+
# Don't set content when JSON is sent as multipart/form-data,
|
|
560
|
+
# since httpx's content param overrides other body arguments
|
|
561
|
+
kwargs["content"] = openapi_dumps(json_data) if is_given(json_data) and json_data is not None else None
|
|
559
562
|
kwargs["files"] = files
|
|
560
563
|
else:
|
|
561
564
|
headers.pop("Content-Type", None)
|
agentex/_compat.py
CHANGED
|
@@ -139,6 +139,7 @@ def model_dump(
|
|
|
139
139
|
exclude_defaults: bool = False,
|
|
140
140
|
warnings: bool = True,
|
|
141
141
|
mode: Literal["json", "python"] = "python",
|
|
142
|
+
by_alias: bool | None = None,
|
|
142
143
|
) -> dict[str, Any]:
|
|
143
144
|
if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
|
|
144
145
|
return model.model_dump(
|
|
@@ -148,13 +149,12 @@ def model_dump(
|
|
|
148
149
|
exclude_defaults=exclude_defaults,
|
|
149
150
|
# warnings are not supported in Pydantic v1
|
|
150
151
|
warnings=True if PYDANTIC_V1 else warnings,
|
|
152
|
+
by_alias=by_alias,
|
|
151
153
|
)
|
|
152
154
|
return cast(
|
|
153
155
|
"dict[str, Any]",
|
|
154
156
|
model.dict( # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
|
|
155
|
-
exclude=exclude,
|
|
156
|
-
exclude_unset=exclude_unset,
|
|
157
|
-
exclude_defaults=exclude_defaults,
|
|
157
|
+
exclude=exclude, exclude_unset=exclude_unset, exclude_defaults=exclude_defaults, by_alias=bool(by_alias)
|
|
158
158
|
),
|
|
159
159
|
)
|
|
160
160
|
|
agentex/_utils/_json.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing_extensions import override
|
|
5
|
+
|
|
6
|
+
import pydantic
|
|
7
|
+
|
|
8
|
+
from .._compat import model_dump
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def openapi_dumps(obj: Any) -> bytes:
|
|
12
|
+
"""
|
|
13
|
+
Serialize an object to UTF-8 encoded JSON bytes.
|
|
14
|
+
|
|
15
|
+
Extends the standard json.dumps with support for additional types
|
|
16
|
+
commonly used in the SDK, such as `datetime`, `pydantic.BaseModel`, etc.
|
|
17
|
+
"""
|
|
18
|
+
return json.dumps(
|
|
19
|
+
obj,
|
|
20
|
+
cls=_CustomEncoder,
|
|
21
|
+
# Uses the same defaults as httpx's JSON serialization
|
|
22
|
+
ensure_ascii=False,
|
|
23
|
+
separators=(",", ":"),
|
|
24
|
+
allow_nan=False,
|
|
25
|
+
).encode()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class _CustomEncoder(json.JSONEncoder):
|
|
29
|
+
@override
|
|
30
|
+
def default(self, o: Any) -> Any:
|
|
31
|
+
if isinstance(o, datetime):
|
|
32
|
+
return o.isoformat()
|
|
33
|
+
if isinstance(o, pydantic.BaseModel):
|
|
34
|
+
return model_dump(o, exclude_unset=True, mode="json", by_alias=True)
|
|
35
|
+
return super().default(o)
|
agentex/_version.py
CHANGED
|
@@ -26,7 +26,13 @@ from agentex.lib.core.temporal.activities.adk.providers.litellm_activities impor
|
|
|
26
26
|
logger = make_logger(__name__)
|
|
27
27
|
|
|
28
28
|
# Default retry policy for all LiteLLM operations
|
|
29
|
-
|
|
29
|
+
# Retries with exponential backoff: 1s, 2s, 4s, ... up to 30s between attempts
|
|
30
|
+
DEFAULT_RETRY_POLICY = RetryPolicy(
|
|
31
|
+
maximum_attempts=3,
|
|
32
|
+
initial_interval=timedelta(seconds=1),
|
|
33
|
+
backoff_coefficient=2.0,
|
|
34
|
+
maximum_interval=timedelta(seconds=30),
|
|
35
|
+
)
|
|
30
36
|
|
|
31
37
|
|
|
32
38
|
class LiteLLMModule:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: agentex-sdk
|
|
3
|
-
Version: 0.9.
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: The official Python library for the agentex API
|
|
5
5
|
Project-URL: Homepage, https://github.com/scaleapi/scale-agentex-python
|
|
6
6
|
Project-URL: Repository, https://github.com/scaleapi/scale-agentex-python
|
|
@@ -47,7 +47,7 @@ Requires-Dist: pyyaml<7,>=6.0.2
|
|
|
47
47
|
Requires-Dist: questionary<3,>=2.0.1
|
|
48
48
|
Requires-Dist: redis<6,>=5.2.0
|
|
49
49
|
Requires-Dist: rich<14,>=13.9.2
|
|
50
|
-
Requires-Dist: scale-gp-beta
|
|
50
|
+
Requires-Dist: scale-gp-beta>=0.1.0a20
|
|
51
51
|
Requires-Dist: scale-gp>=0.1.0a59
|
|
52
52
|
Requires-Dist: sniffio
|
|
53
53
|
Requires-Dist: temporalio<2,>=1.18.2
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
agentex/__init__.py,sha256=TvS8DtvGAnubcoUjYIsuCpBzpsdpxBaJCS76s-l-PRo,2712
|
|
2
|
-
agentex/_base_client.py,sha256=
|
|
2
|
+
agentex/_base_client.py,sha256=M7ZqaZpxBrCwUhnZAfGUHn42kRjqsG1RYYoeLeDbDs4,73659
|
|
3
3
|
agentex/_client.py,sha256=39ydvoIqEPVYkM891ZMhCMKrbXR59QUxuKTtrTJGgMM,28482
|
|
4
|
-
agentex/_compat.py,sha256=
|
|
4
|
+
agentex/_compat.py,sha256=teO44AYozpv2wFRrUi7brcZfGPpFSERQZ4fcdX6zVvs,6627
|
|
5
5
|
agentex/_constants.py,sha256=oGldMuFz7eZtwD8_6rJUippKhZB5fGSA7ffbCDGourA,466
|
|
6
6
|
agentex/_exceptions.py,sha256=B09aFjWFRSShb9BFJd-MNDblsGDyGk3w-vItYmjg_AI,3222
|
|
7
7
|
agentex/_files.py,sha256=KnEzGi_O756MvKyJ4fOCW_u3JhOeWPQ4RsmDvqihDQU,3545
|
|
@@ -11,11 +11,12 @@ agentex/_resource.py,sha256=S1t7wmR5WUvoDIhZjo_x-E7uoTJBynJ3d8tPJMQYdjw,1106
|
|
|
11
11
|
agentex/_response.py,sha256=Tb9zazsnemO2rTxWtBjAD5WBqlhli5ZaXGbiKgdu5DE,28794
|
|
12
12
|
agentex/_streaming.py,sha256=aOvLOte7kaclPGm-D0iNdM3uRcWrZ-T2B8t9BDNmpuA,10225
|
|
13
13
|
agentex/_types.py,sha256=fa7vkH4XTd2n7GdGxf8-i_2kMDtXgwO3X_usN1GyknI,7595
|
|
14
|
-
agentex/_version.py,sha256=
|
|
14
|
+
agentex/_version.py,sha256=OawrYfHrb4YHUdja00eu4HXsP48H_fuwTx6l7EDpZ6I,159
|
|
15
15
|
agentex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
agentex/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
agentex/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
18
18
|
agentex/_utils/_datetime_parse.py,sha256=bABTs0Bc6rabdFvnIwXjEhWL15TcRgWZ_6XGTqN8xUk,4204
|
|
19
|
+
agentex/_utils/_json.py,sha256=bl95uuIWwgSfXX-gP1trK_lDAPwJujYfJ05Cxo2SEC4,962
|
|
19
20
|
agentex/_utils/_logs.py,sha256=LUjFPc3fweSChBUmjhQD8uYmwQAmFMNDuVFKfjYBQfM,777
|
|
20
21
|
agentex/_utils/_proxy.py,sha256=aglnj2yBTDyGX9Akk2crZHrl10oqRmceUy2Zp008XEs,1975
|
|
21
22
|
agentex/_utils/_reflection.py,sha256=ZmGkIgT_PuwedyNBrrKGbxoWtkpytJNU1uU4QHnmEMU,1364
|
|
@@ -42,7 +43,7 @@ agentex/lib/adk/_modules/tasks.py,sha256=aWrOrRvMYfPjFyI6Wt6-5STTyQsTaVZUFZ0XdWC
|
|
|
42
43
|
agentex/lib/adk/_modules/tracing.py,sha256=LZvItZg2ALZZMvJasrsGEBgss4wnXGMnL_lw0l15z04,7505
|
|
43
44
|
agentex/lib/adk/providers/__init__.py,sha256=bOS-D_lXV3QXRtGKrUvsYb2ZAcZG51ZAtHdfiHgYN-M,306
|
|
44
45
|
agentex/lib/adk/providers/_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
|
-
agentex/lib/adk/providers/_modules/litellm.py,sha256=
|
|
46
|
+
agentex/lib/adk/providers/_modules/litellm.py,sha256=zWy6VuG8pG4qR4k-QARmNAPmEFEnhx67Clv8IaReLVU,9672
|
|
46
47
|
agentex/lib/adk/providers/_modules/openai.py,sha256=rguTE4uGLodqr8zx5GRRtSkcWC9llNA1kUFKF0yhdK0,23679
|
|
47
48
|
agentex/lib/adk/providers/_modules/sgp.py,sha256=x64axb0oVmVh5W8hwpnMMPqxad2HySf2DYHPxRNwjck,3208
|
|
48
49
|
agentex/lib/adk/providers/_modules/sync_provider.py,sha256=YNiApD2NQO0wQXkGAtQwz72dx9HPxgm4UZ_R-Vs-yds,31369
|
|
@@ -260,7 +261,7 @@ agentex/lib/types/credentials.py,sha256=k6gtiIqSsKuS8vgucgQAHzb8oUlFdTj4CLtU69sk
|
|
|
260
261
|
agentex/lib/types/fastacp.py,sha256=WlFfChfd3CKovZHcVsVXkFEw58SLwvZRnf6iU_humaU,2239
|
|
261
262
|
agentex/lib/types/files.py,sha256=sNxiuR_oEo7Z0YMqjQShErvS3txWyobrZzc4QMMM61U,320
|
|
262
263
|
agentex/lib/types/json_rpc.py,sha256=jxr8Jb4M3Z4F58gx6aRI6thsWb_66wmZtJhKNazE4Q8,1104
|
|
263
|
-
agentex/lib/types/llm_messages.py,sha256=
|
|
264
|
+
agentex/lib/types/llm_messages.py,sha256=fDX1QeqMpESjOXMSL1pDIM4GmxYou6XbGL41EkmugZM,10736
|
|
264
265
|
agentex/lib/types/tracing.py,sha256=6B8tCODAd4EAUoZXXyLYZ7KT6EHcdT4IEbo--aVZWlk,803
|
|
265
266
|
agentex/lib/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
266
267
|
agentex/lib/utils/completions.py,sha256=TS0eYK_3yuF3fv4DiOIKLGVRsp0-AfN4RenCPSa_Wsk,4678
|
|
@@ -362,8 +363,8 @@ agentex/types/messages/batch_update_params.py,sha256=Ug5CThbD49a8j4qucg04OdmVrp_
|
|
|
362
363
|
agentex/types/messages/batch_update_response.py,sha256=TbSBe6SuPzjXXWSj-nRjT1JHGBooTshHQQDa1AixQA8,278
|
|
363
364
|
agentex/types/shared/__init__.py,sha256=IKs-Qn5Yja0kFh1G1kDqYZo43qrOu1hSoxlPdN-85dI,149
|
|
364
365
|
agentex/types/shared/delete_response.py,sha256=8qH3zvQXaOHYQSHyXi7UQxdR4miTzR7V9K4zXVsiUyk,215
|
|
365
|
-
agentex_sdk-0.9.
|
|
366
|
-
agentex_sdk-0.9.
|
|
367
|
-
agentex_sdk-0.9.
|
|
368
|
-
agentex_sdk-0.9.
|
|
369
|
-
agentex_sdk-0.9.
|
|
366
|
+
agentex_sdk-0.9.2.dist-info/METADATA,sha256=LXmG1t5m2W0izEKj3NLWJ_mJweirnxwpO3CKTPUhPWI,15553
|
|
367
|
+
agentex_sdk-0.9.2.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
368
|
+
agentex_sdk-0.9.2.dist-info/entry_points.txt,sha256=V7vJuMZdF0UlvgX6KiBN7XUvq_cxF5kplcYvc1QlFaQ,62
|
|
369
|
+
agentex_sdk-0.9.2.dist-info/licenses/LICENSE,sha256=Eejl902yry8m7Bl6gRYRUObLifIrC61CmV369C6-dqQ,11337
|
|
370
|
+
agentex_sdk-0.9.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|