agentex-sdk 0.4.23__py3-none-any.whl → 0.4.25__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/__init__.py +3 -1
- agentex/_base_client.py +9 -9
- agentex/_client.py +12 -12
- agentex/_models.py +10 -4
- agentex/_qs.py +7 -7
- agentex/_types.py +18 -11
- agentex/_utils/_transform.py +2 -2
- agentex/_utils/_utils.py +4 -4
- agentex/_version.py +1 -1
- agentex/lib/cli/handlers/deploy_handlers.py +1 -1
- agentex/lib/core/temporal/workers/worker.py +2 -2
- agentex/resources/agents.py +25 -25
- agentex/resources/events.py +9 -9
- agentex/resources/messages/batch.py +5 -5
- agentex/resources/messages/messages.py +15 -15
- agentex/resources/spans.py +39 -39
- agentex/resources/states.py +15 -15
- agentex/resources/tasks.py +19 -19
- agentex/resources/tracker.py +17 -17
- {agentex_sdk-0.4.23.dist-info → agentex_sdk-0.4.25.dist-info}/METADATA +3 -3
- {agentex_sdk-0.4.23.dist-info → agentex_sdk-0.4.25.dist-info}/RECORD +24 -24
- {agentex_sdk-0.4.23.dist-info → agentex_sdk-0.4.25.dist-info}/WHEEL +0 -0
- {agentex_sdk-0.4.23.dist-info → agentex_sdk-0.4.25.dist-info}/entry_points.txt +0 -0
- {agentex_sdk-0.4.23.dist-info → agentex_sdk-0.4.25.dist-info}/licenses/LICENSE +0 -0
agentex/__init__.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
import typing as _t
|
4
4
|
|
5
5
|
from . import types
|
6
|
-
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
|
6
|
+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
|
7
7
|
from ._utils import file_from_path
|
8
8
|
from ._client import (
|
9
9
|
ENVIRONMENTS,
|
@@ -49,7 +49,9 @@ __all__ = [
|
|
49
49
|
"ProxiesTypes",
|
50
50
|
"NotGiven",
|
51
51
|
"NOT_GIVEN",
|
52
|
+
"not_given",
|
52
53
|
"Omit",
|
54
|
+
"omit",
|
53
55
|
"AgentexError",
|
54
56
|
"APIError",
|
55
57
|
"APIStatusError",
|
agentex/_base_client.py
CHANGED
@@ -42,7 +42,6 @@ from . import _exceptions
|
|
42
42
|
from ._qs import Querystring
|
43
43
|
from ._files import to_httpx_files, async_to_httpx_files
|
44
44
|
from ._types import (
|
45
|
-
NOT_GIVEN,
|
46
45
|
Body,
|
47
46
|
Omit,
|
48
47
|
Query,
|
@@ -57,6 +56,7 @@ from ._types import (
|
|
57
56
|
RequestOptions,
|
58
57
|
HttpxRequestFiles,
|
59
58
|
ModelBuilderProtocol,
|
59
|
+
not_given,
|
60
60
|
)
|
61
61
|
from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
|
62
62
|
from ._compat import PYDANTIC_V1, model_copy, model_dump
|
@@ -145,9 +145,9 @@ class PageInfo:
|
|
145
145
|
def __init__(
|
146
146
|
self,
|
147
147
|
*,
|
148
|
-
url: URL | NotGiven =
|
149
|
-
json: Body | NotGiven =
|
150
|
-
params: Query | NotGiven =
|
148
|
+
url: URL | NotGiven = not_given,
|
149
|
+
json: Body | NotGiven = not_given,
|
150
|
+
params: Query | NotGiven = not_given,
|
151
151
|
) -> None:
|
152
152
|
self.url = url
|
153
153
|
self.json = json
|
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
|
|
595
595
|
# we internally support defining a temporary header to override the
|
596
596
|
# default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
|
597
597
|
# see _response.py for implementation details
|
598
|
-
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER,
|
598
|
+
override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
|
599
599
|
if is_given(override_cast_to):
|
600
600
|
options.headers = headers
|
601
601
|
return cast(Type[ResponseT], override_cast_to)
|
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
|
|
825
825
|
version: str,
|
826
826
|
base_url: str | URL,
|
827
827
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
828
|
-
timeout: float | Timeout | None | NotGiven =
|
828
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
829
829
|
http_client: httpx.Client | None = None,
|
830
830
|
custom_headers: Mapping[str, str] | None = None,
|
831
831
|
custom_query: Mapping[str, object] | None = None,
|
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
|
|
1356
1356
|
base_url: str | URL,
|
1357
1357
|
_strict_response_validation: bool,
|
1358
1358
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
1359
|
-
timeout: float | Timeout | None | NotGiven =
|
1359
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
1360
1360
|
http_client: httpx.AsyncClient | None = None,
|
1361
1361
|
custom_headers: Mapping[str, str] | None = None,
|
1362
1362
|
custom_query: Mapping[str, object] | None = None,
|
@@ -1818,8 +1818,8 @@ def make_request_options(
|
|
1818
1818
|
extra_query: Query | None = None,
|
1819
1819
|
extra_body: Body | None = None,
|
1820
1820
|
idempotency_key: str | None = None,
|
1821
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
1822
|
-
post_parser: PostParser | NotGiven =
|
1821
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
1822
|
+
post_parser: PostParser | NotGiven = not_given,
|
1823
1823
|
) -> RequestOptions:
|
1824
1824
|
"""Create a dict of type RequestOptions without keys of NotGiven values."""
|
1825
1825
|
options: RequestOptions = {}
|
agentex/_client.py
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
from __future__ import annotations
|
4
4
|
|
5
5
|
import os
|
6
|
-
from typing import Any, Dict,
|
6
|
+
from typing import Any, Dict, Mapping, cast
|
7
7
|
from typing_extensions import Self, Literal, override
|
8
8
|
|
9
9
|
import httpx
|
@@ -11,13 +11,13 @@ import httpx
|
|
11
11
|
from . import _exceptions
|
12
12
|
from ._qs import Querystring
|
13
13
|
from ._types import (
|
14
|
-
NOT_GIVEN,
|
15
14
|
Omit,
|
16
15
|
Timeout,
|
17
16
|
NotGiven,
|
18
17
|
Transport,
|
19
18
|
ProxiesTypes,
|
20
19
|
RequestOptions,
|
20
|
+
not_given,
|
21
21
|
)
|
22
22
|
from ._utils import is_given, get_async_library
|
23
23
|
from ._version import __version__
|
@@ -69,9 +69,9 @@ class Agentex(SyncAPIClient):
|
|
69
69
|
self,
|
70
70
|
*,
|
71
71
|
api_key: str | None = None,
|
72
|
-
environment: Literal["production", "development"] | NotGiven =
|
73
|
-
base_url: str | httpx.URL | None | NotGiven =
|
74
|
-
timeout:
|
72
|
+
environment: Literal["production", "development"] | NotGiven = not_given,
|
73
|
+
base_url: str | httpx.URL | None | NotGiven = not_given,
|
74
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
75
75
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
76
76
|
default_headers: Mapping[str, str] | None = None,
|
77
77
|
default_query: Mapping[str, object] | None = None,
|
@@ -172,9 +172,9 @@ class Agentex(SyncAPIClient):
|
|
172
172
|
api_key: str | None = None,
|
173
173
|
environment: Literal["production", "development"] | None = None,
|
174
174
|
base_url: str | httpx.URL | None = None,
|
175
|
-
timeout: float | Timeout | None | NotGiven =
|
175
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
176
176
|
http_client: httpx.Client | None = None,
|
177
|
-
max_retries: int | NotGiven =
|
177
|
+
max_retries: int | NotGiven = not_given,
|
178
178
|
default_headers: Mapping[str, str] | None = None,
|
179
179
|
set_default_headers: Mapping[str, str] | None = None,
|
180
180
|
default_query: Mapping[str, object] | None = None,
|
@@ -273,9 +273,9 @@ class AsyncAgentex(AsyncAPIClient):
|
|
273
273
|
self,
|
274
274
|
*,
|
275
275
|
api_key: str | None = None,
|
276
|
-
environment: Literal["production", "development"] | NotGiven =
|
277
|
-
base_url: str | httpx.URL | None | NotGiven =
|
278
|
-
timeout:
|
276
|
+
environment: Literal["production", "development"] | NotGiven = not_given,
|
277
|
+
base_url: str | httpx.URL | None | NotGiven = not_given,
|
278
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
279
279
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
280
280
|
default_headers: Mapping[str, str] | None = None,
|
281
281
|
default_query: Mapping[str, object] | None = None,
|
@@ -376,9 +376,9 @@ class AsyncAgentex(AsyncAPIClient):
|
|
376
376
|
api_key: str | None = None,
|
377
377
|
environment: Literal["production", "development"] | None = None,
|
378
378
|
base_url: str | httpx.URL | None = None,
|
379
|
-
timeout: float | Timeout | None | NotGiven =
|
379
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
380
380
|
http_client: httpx.AsyncClient | None = None,
|
381
|
-
max_retries: int | NotGiven =
|
381
|
+
max_retries: int | NotGiven = not_given,
|
382
382
|
default_headers: Mapping[str, str] | None = None,
|
383
383
|
set_default_headers: Mapping[str, str] | None = None,
|
384
384
|
default_query: Mapping[str, object] | None = None,
|
agentex/_models.py
CHANGED
@@ -256,7 +256,7 @@ class BaseModel(pydantic.BaseModel):
|
|
256
256
|
mode: Literal["json", "python"] | str = "python",
|
257
257
|
include: IncEx | None = None,
|
258
258
|
exclude: IncEx | None = None,
|
259
|
-
by_alias: bool =
|
259
|
+
by_alias: bool | None = None,
|
260
260
|
exclude_unset: bool = False,
|
261
261
|
exclude_defaults: bool = False,
|
262
262
|
exclude_none: bool = False,
|
@@ -264,6 +264,7 @@ class BaseModel(pydantic.BaseModel):
|
|
264
264
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
265
265
|
context: dict[str, Any] | None = None,
|
266
266
|
serialize_as_any: bool = False,
|
267
|
+
fallback: Callable[[Any], Any] | None = None,
|
267
268
|
) -> dict[str, Any]:
|
268
269
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
|
269
270
|
|
@@ -295,10 +296,12 @@ class BaseModel(pydantic.BaseModel):
|
|
295
296
|
raise ValueError("context is only supported in Pydantic v2")
|
296
297
|
if serialize_as_any != False:
|
297
298
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
299
|
+
if fallback is not None:
|
300
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
298
301
|
dumped = super().dict( # pyright: ignore[reportDeprecated]
|
299
302
|
include=include,
|
300
303
|
exclude=exclude,
|
301
|
-
by_alias=by_alias,
|
304
|
+
by_alias=by_alias if by_alias is not None else False,
|
302
305
|
exclude_unset=exclude_unset,
|
303
306
|
exclude_defaults=exclude_defaults,
|
304
307
|
exclude_none=exclude_none,
|
@@ -313,13 +316,14 @@ class BaseModel(pydantic.BaseModel):
|
|
313
316
|
indent: int | None = None,
|
314
317
|
include: IncEx | None = None,
|
315
318
|
exclude: IncEx | None = None,
|
316
|
-
by_alias: bool =
|
319
|
+
by_alias: bool | None = None,
|
317
320
|
exclude_unset: bool = False,
|
318
321
|
exclude_defaults: bool = False,
|
319
322
|
exclude_none: bool = False,
|
320
323
|
round_trip: bool = False,
|
321
324
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
322
325
|
context: dict[str, Any] | None = None,
|
326
|
+
fallback: Callable[[Any], Any] | None = None,
|
323
327
|
serialize_as_any: bool = False,
|
324
328
|
) -> str:
|
325
329
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
|
@@ -348,11 +352,13 @@ class BaseModel(pydantic.BaseModel):
|
|
348
352
|
raise ValueError("context is only supported in Pydantic v2")
|
349
353
|
if serialize_as_any != False:
|
350
354
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
355
|
+
if fallback is not None:
|
356
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
351
357
|
return super().json( # type: ignore[reportDeprecated]
|
352
358
|
indent=indent,
|
353
359
|
include=include,
|
354
360
|
exclude=exclude,
|
355
|
-
by_alias=by_alias,
|
361
|
+
by_alias=by_alias if by_alias is not None else False,
|
356
362
|
exclude_unset=exclude_unset,
|
357
363
|
exclude_defaults=exclude_defaults,
|
358
364
|
exclude_none=exclude_none,
|
agentex/_qs.py
CHANGED
@@ -4,7 +4,7 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar
|
|
4
4
|
from urllib.parse import parse_qs, urlencode
|
5
5
|
from typing_extensions import Literal, get_args
|
6
6
|
|
7
|
-
from ._types import
|
7
|
+
from ._types import NotGiven, not_given
|
8
8
|
from ._utils import flatten
|
9
9
|
|
10
10
|
_T = TypeVar("_T")
|
@@ -41,8 +41,8 @@ class Querystring:
|
|
41
41
|
self,
|
42
42
|
params: Params,
|
43
43
|
*,
|
44
|
-
array_format:
|
45
|
-
nested_format:
|
44
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
45
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
46
46
|
) -> str:
|
47
47
|
return urlencode(
|
48
48
|
self.stringify_items(
|
@@ -56,8 +56,8 @@ class Querystring:
|
|
56
56
|
self,
|
57
57
|
params: Params,
|
58
58
|
*,
|
59
|
-
array_format:
|
60
|
-
nested_format:
|
59
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
60
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
61
61
|
) -> list[tuple[str, str]]:
|
62
62
|
opts = Options(
|
63
63
|
qs=self,
|
@@ -143,8 +143,8 @@ class Options:
|
|
143
143
|
self,
|
144
144
|
qs: Querystring = _qs,
|
145
145
|
*,
|
146
|
-
array_format:
|
147
|
-
nested_format:
|
146
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
147
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
148
148
|
) -> None:
|
149
149
|
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
|
150
150
|
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
|
agentex/_types.py
CHANGED
@@ -117,18 +117,21 @@ class RequestOptions(TypedDict, total=False):
|
|
117
117
|
# Sentinel class used until PEP 0661 is accepted
|
118
118
|
class NotGiven:
|
119
119
|
"""
|
120
|
-
|
121
|
-
|
120
|
+
For parameters with a meaningful None value, we need to distinguish between
|
121
|
+
the user explicitly passing None, and the user not passing the parameter at
|
122
|
+
all.
|
123
|
+
|
124
|
+
User code shouldn't need to use not_given directly.
|
122
125
|
|
123
126
|
For example:
|
124
127
|
|
125
128
|
```py
|
126
|
-
def
|
129
|
+
def create(timeout: Timeout | None | NotGiven = not_given): ...
|
127
130
|
|
128
131
|
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
+
create(timeout=1) # 1s timeout
|
133
|
+
create(timeout=None) # No timeout
|
134
|
+
create() # Default timeout behavior
|
132
135
|
```
|
133
136
|
"""
|
134
137
|
|
@@ -140,13 +143,14 @@ class NotGiven:
|
|
140
143
|
return "NOT_GIVEN"
|
141
144
|
|
142
145
|
|
143
|
-
|
146
|
+
not_given = NotGiven()
|
147
|
+
# for backwards compatibility:
|
144
148
|
NOT_GIVEN = NotGiven()
|
145
149
|
|
146
150
|
|
147
151
|
class Omit:
|
148
|
-
"""
|
149
|
-
|
152
|
+
"""
|
153
|
+
To explicitly omit something from being sent in a request, use `omit`.
|
150
154
|
|
151
155
|
```py
|
152
156
|
# as the default `Content-Type` header is `application/json` that will be sent
|
@@ -156,8 +160,8 @@ class Omit:
|
|
156
160
|
# to look something like: 'multipart/form-data; boundary=0d8382fcf5f8c3be01ca2e11002d2983'
|
157
161
|
client.post(..., headers={"Content-Type": "multipart/form-data"})
|
158
162
|
|
159
|
-
# instead you can remove the default `application/json` header by passing
|
160
|
-
client.post(..., headers={"Content-Type":
|
163
|
+
# instead you can remove the default `application/json` header by passing omit
|
164
|
+
client.post(..., headers={"Content-Type": omit})
|
161
165
|
```
|
162
166
|
"""
|
163
167
|
|
@@ -165,6 +169,9 @@ class Omit:
|
|
165
169
|
return False
|
166
170
|
|
167
171
|
|
172
|
+
omit = Omit()
|
173
|
+
|
174
|
+
|
168
175
|
@runtime_checkable
|
169
176
|
class ModelBuilderProtocol(Protocol):
|
170
177
|
@classmethod
|
agentex/_utils/_transform.py
CHANGED
@@ -268,7 +268,7 @@ def _transform_typeddict(
|
|
268
268
|
annotations = get_type_hints(expected_type, include_extras=True)
|
269
269
|
for key, value in data.items():
|
270
270
|
if not is_given(value):
|
271
|
-
# we don't need to include
|
271
|
+
# we don't need to include omitted values here as they'll
|
272
272
|
# be stripped out before the request is sent anyway
|
273
273
|
continue
|
274
274
|
|
@@ -434,7 +434,7 @@ async def _async_transform_typeddict(
|
|
434
434
|
annotations = get_type_hints(expected_type, include_extras=True)
|
435
435
|
for key, value in data.items():
|
436
436
|
if not is_given(value):
|
437
|
-
# we don't need to include
|
437
|
+
# we don't need to include omitted values here as they'll
|
438
438
|
# be stripped out before the request is sent anyway
|
439
439
|
continue
|
440
440
|
|
agentex/_utils/_utils.py
CHANGED
@@ -21,7 +21,7 @@ from typing_extensions import TypeGuard
|
|
21
21
|
|
22
22
|
import sniffio
|
23
23
|
|
24
|
-
from .._types import NotGiven, FileTypes,
|
24
|
+
from .._types import Omit, NotGiven, FileTypes, HeadersLike
|
25
25
|
|
26
26
|
_T = TypeVar("_T")
|
27
27
|
_TupleT = TypeVar("_TupleT", bound=Tuple[object, ...])
|
@@ -63,7 +63,7 @@ def _extract_items(
|
|
63
63
|
try:
|
64
64
|
key = path[index]
|
65
65
|
except IndexError:
|
66
|
-
if
|
66
|
+
if not is_given(obj):
|
67
67
|
# no value was provided - we can safely ignore
|
68
68
|
return []
|
69
69
|
|
@@ -126,8 +126,8 @@ def _extract_items(
|
|
126
126
|
return []
|
127
127
|
|
128
128
|
|
129
|
-
def is_given(obj:
|
130
|
-
return not isinstance(obj, NotGiven)
|
129
|
+
def is_given(obj: _T | NotGiven | Omit) -> TypeGuard[_T]:
|
130
|
+
return not isinstance(obj, NotGiven) and not isinstance(obj, Omit)
|
131
131
|
|
132
132
|
|
133
133
|
# Type safe methods for narrowing types with TypeVars.
|
agentex/_version.py
CHANGED
@@ -112,7 +112,7 @@ class AgentexWorker:
|
|
112
112
|
task_queue,
|
113
113
|
max_workers: int = 10,
|
114
114
|
max_concurrent_activities: int = 10,
|
115
|
-
health_check_port: int =
|
115
|
+
health_check_port: int | None = None,
|
116
116
|
plugins: list = [],
|
117
117
|
):
|
118
118
|
self.task_queue = task_queue
|
@@ -121,7 +121,7 @@ class AgentexWorker:
|
|
121
121
|
self.max_concurrent_activities = max_concurrent_activities
|
122
122
|
self.health_check_server_running = False
|
123
123
|
self.healthy = False
|
124
|
-
self.health_check_port = health_check_port
|
124
|
+
self.health_check_port = health_check_port if health_check_port is not None else EnvironmentVariables.refresh().HEALTH_CHECK_PORT
|
125
125
|
self.plugins = plugins
|
126
126
|
|
127
127
|
@overload
|
agentex/resources/agents.py
CHANGED
@@ -10,7 +10,7 @@ import httpx
|
|
10
10
|
from pydantic import ValidationError
|
11
11
|
|
12
12
|
from ..types import agent_rpc_params, agent_list_params, agent_rpc_by_name_params
|
13
|
-
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
13
|
+
from .._types import NOT_GIVEN, Body, Omit, Query, Headers, NotGiven, omit, not_given
|
14
14
|
from .._utils import maybe_transform, async_maybe_transform
|
15
15
|
from .._compat import cached_property
|
16
16
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
@@ -65,7 +65,7 @@ class AgentsResource(SyncAPIResource):
|
|
65
65
|
extra_headers: Headers | None = None,
|
66
66
|
extra_query: Query | None = None,
|
67
67
|
extra_body: Body | None = None,
|
68
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
68
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
69
69
|
) -> Agent:
|
70
70
|
"""
|
71
71
|
Get an agent by its unique ID.
|
@@ -92,13 +92,13 @@ class AgentsResource(SyncAPIResource):
|
|
92
92
|
def list(
|
93
93
|
self,
|
94
94
|
*,
|
95
|
-
task_id: Optional[str] |
|
95
|
+
task_id: Optional[str] | Omit = omit,
|
96
96
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
97
97
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
98
98
|
extra_headers: Headers | None = None,
|
99
99
|
extra_query: Query | None = None,
|
100
100
|
extra_body: Body | None = None,
|
101
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
101
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
102
102
|
) -> AgentListResponse:
|
103
103
|
"""
|
104
104
|
List all registered agents, optionally filtered by query parameters.
|
@@ -135,7 +135,7 @@ class AgentsResource(SyncAPIResource):
|
|
135
135
|
extra_headers: Headers | None = None,
|
136
136
|
extra_query: Query | None = None,
|
137
137
|
extra_body: Body | None = None,
|
138
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
138
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
139
139
|
) -> DeleteResponse:
|
140
140
|
"""
|
141
141
|
Delete an agent by its unique ID.
|
@@ -168,7 +168,7 @@ class AgentsResource(SyncAPIResource):
|
|
168
168
|
extra_headers: Headers | None = None,
|
169
169
|
extra_query: Query | None = None,
|
170
170
|
extra_body: Body | None = None,
|
171
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
171
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
172
172
|
) -> DeleteResponse:
|
173
173
|
"""
|
174
174
|
Delete an agent by its unique name.
|
@@ -201,7 +201,7 @@ class AgentsResource(SyncAPIResource):
|
|
201
201
|
extra_headers: Headers | None = None,
|
202
202
|
extra_query: Query | None = None,
|
203
203
|
extra_body: Body | None = None,
|
204
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
204
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
205
205
|
) -> Agent:
|
206
206
|
"""
|
207
207
|
Get an agent by its unique name.
|
@@ -231,14 +231,14 @@ class AgentsResource(SyncAPIResource):
|
|
231
231
|
*,
|
232
232
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
233
233
|
params: agent_rpc_params.Params,
|
234
|
-
id: Union[int, str, None] |
|
235
|
-
jsonrpc: Literal["2.0"] |
|
234
|
+
id: Union[int, str, None] | Omit = omit,
|
235
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
236
236
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
237
237
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
238
238
|
extra_headers: Headers | None = None,
|
239
239
|
extra_query: Query | None = None,
|
240
240
|
extra_body: Body | None = None,
|
241
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
241
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
242
242
|
) -> AgentRpcResponse:
|
243
243
|
"""
|
244
244
|
Handle JSON-RPC requests for an agent by its unique ID.
|
@@ -279,14 +279,14 @@ class AgentsResource(SyncAPIResource):
|
|
279
279
|
*,
|
280
280
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
281
281
|
params: agent_rpc_by_name_params.Params,
|
282
|
-
id: Union[int, str, None] |
|
283
|
-
jsonrpc: Literal["2.0"] |
|
282
|
+
id: Union[int, str, None] | Omit = omit,
|
283
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
284
284
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
285
285
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
286
286
|
extra_headers: Headers | None = None,
|
287
287
|
extra_query: Query | None = None,
|
288
288
|
extra_body: Body | None = None,
|
289
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
290
290
|
) -> AgentRpcResponse:
|
291
291
|
"""
|
292
292
|
Handle JSON-RPC requests for an agent by its unique name.
|
@@ -612,7 +612,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
612
612
|
extra_headers: Headers | None = None,
|
613
613
|
extra_query: Query | None = None,
|
614
614
|
extra_body: Body | None = None,
|
615
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
615
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
616
616
|
) -> Agent:
|
617
617
|
"""
|
618
618
|
Get an agent by its unique ID.
|
@@ -639,13 +639,13 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
639
639
|
async def list(
|
640
640
|
self,
|
641
641
|
*,
|
642
|
-
task_id: Optional[str] |
|
642
|
+
task_id: Optional[str] | Omit = omit,
|
643
643
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
644
644
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
645
645
|
extra_headers: Headers | None = None,
|
646
646
|
extra_query: Query | None = None,
|
647
647
|
extra_body: Body | None = None,
|
648
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
648
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
649
649
|
) -> AgentListResponse:
|
650
650
|
"""
|
651
651
|
List all registered agents, optionally filtered by query parameters.
|
@@ -682,7 +682,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
682
682
|
extra_headers: Headers | None = None,
|
683
683
|
extra_query: Query | None = None,
|
684
684
|
extra_body: Body | None = None,
|
685
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
685
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
686
686
|
) -> DeleteResponse:
|
687
687
|
"""
|
688
688
|
Delete an agent by its unique ID.
|
@@ -715,7 +715,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
715
715
|
extra_headers: Headers | None = None,
|
716
716
|
extra_query: Query | None = None,
|
717
717
|
extra_body: Body | None = None,
|
718
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
718
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
719
719
|
) -> DeleteResponse:
|
720
720
|
"""
|
721
721
|
Delete an agent by its unique name.
|
@@ -748,7 +748,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
748
748
|
extra_headers: Headers | None = None,
|
749
749
|
extra_query: Query | None = None,
|
750
750
|
extra_body: Body | None = None,
|
751
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
751
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
752
752
|
) -> Agent:
|
753
753
|
"""
|
754
754
|
Get an agent by its unique name.
|
@@ -778,14 +778,14 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
778
778
|
*,
|
779
779
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
780
780
|
params: agent_rpc_params.Params,
|
781
|
-
id: Union[int, str, None] |
|
782
|
-
jsonrpc: Literal["2.0"] |
|
781
|
+
id: Union[int, str, None] | Omit = omit,
|
782
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
783
783
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
784
784
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
785
785
|
extra_headers: Headers | None = None,
|
786
786
|
extra_query: Query | None = None,
|
787
787
|
extra_body: Body | None = None,
|
788
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
788
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
789
789
|
) -> AgentRpcResponse:
|
790
790
|
"""
|
791
791
|
Handle JSON-RPC requests for an agent by its unique ID.
|
@@ -826,14 +826,14 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
826
826
|
*,
|
827
827
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
828
828
|
params: agent_rpc_by_name_params.Params,
|
829
|
-
id: Union[int, str, None] |
|
830
|
-
jsonrpc: Literal["2.0"] |
|
829
|
+
id: Union[int, str, None] | Omit = omit,
|
830
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
831
831
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
832
832
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
833
833
|
extra_headers: Headers | None = None,
|
834
834
|
extra_query: Query | None = None,
|
835
835
|
extra_body: Body | None = None,
|
836
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
836
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
837
837
|
) -> AgentRpcResponse:
|
838
838
|
"""
|
839
839
|
Handle JSON-RPC requests for an agent by its unique name.
|
agentex/resources/events.py
CHANGED
@@ -7,7 +7,7 @@ from typing import Optional
|
|
7
7
|
import httpx
|
8
8
|
|
9
9
|
from ..types import event_list_params
|
10
|
-
from .._types import
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
12
12
|
from .._compat import cached_property
|
13
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
@@ -53,7 +53,7 @@ class EventsResource(SyncAPIResource):
|
|
53
53
|
extra_headers: Headers | None = None,
|
54
54
|
extra_query: Query | None = None,
|
55
55
|
extra_body: Body | None = None,
|
56
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
56
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
57
57
|
) -> Event:
|
58
58
|
"""
|
59
59
|
Get Event
|
@@ -82,14 +82,14 @@ class EventsResource(SyncAPIResource):
|
|
82
82
|
*,
|
83
83
|
agent_id: str,
|
84
84
|
task_id: str,
|
85
|
-
last_processed_event_id: Optional[str] |
|
86
|
-
limit: Optional[int] |
|
85
|
+
last_processed_event_id: Optional[str] | Omit = omit,
|
86
|
+
limit: Optional[int] | Omit = omit,
|
87
87
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
88
88
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
89
89
|
extra_headers: Headers | None = None,
|
90
90
|
extra_query: Query | None = None,
|
91
91
|
extra_body: Body | None = None,
|
92
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
92
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
93
93
|
) -> EventListResponse:
|
94
94
|
"""
|
95
95
|
List events for a specific task and agent.
|
@@ -164,7 +164,7 @@ class AsyncEventsResource(AsyncAPIResource):
|
|
164
164
|
extra_headers: Headers | None = None,
|
165
165
|
extra_query: Query | None = None,
|
166
166
|
extra_body: Body | None = None,
|
167
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
167
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
168
168
|
) -> Event:
|
169
169
|
"""
|
170
170
|
Get Event
|
@@ -193,14 +193,14 @@ class AsyncEventsResource(AsyncAPIResource):
|
|
193
193
|
*,
|
194
194
|
agent_id: str,
|
195
195
|
task_id: str,
|
196
|
-
last_processed_event_id: Optional[str] |
|
197
|
-
limit: Optional[int] |
|
196
|
+
last_processed_event_id: Optional[str] | Omit = omit,
|
197
|
+
limit: Optional[int] | Omit = omit,
|
198
198
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
199
199
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
200
200
|
extra_headers: Headers | None = None,
|
201
201
|
extra_query: Query | None = None,
|
202
202
|
extra_body: Body | None = None,
|
203
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
203
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
204
204
|
) -> EventListResponse:
|
205
205
|
"""
|
206
206
|
List events for a specific task and agent.
|