Skip to content

Commit c456bb5

Browse files
committed
copy changes from stainless
1 parent 362234a commit c456bb5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1381
-349
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-4abd340ba528b5912ad6672a203de3c6904577d27b3397533d51d3ddc265339f.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-60c8c820f2cbc6b5b0b129ccf707ec246921b9e93cfb18f4ed47a96cc97c47f8.yml

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright 2024 Agility
189+
Copyright 2025 Agility
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
Types:
44

55
```python
6-
from agility.types import Assistant, AssistantWithConfig
6+
from agility.types import Assistant, AssistantWithConfig, AssistantListResponse
77
```
88

99
Methods:
1010

1111
- <code title="post /api/assistants/">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">create</a>(\*\*<a href="src/agility/types/assistant_create_params.py">params</a>) -> <a href="./src/agility/types/assistant.py">Assistant</a></code>
1212
- <code title="get /api/assistants/{assistant_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">retrieve</a>(assistant_id) -> <a href="./src/agility/types/assistant_with_config.py">AssistantWithConfig</a></code>
1313
- <code title="put /api/assistants/{assistant_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">update</a>(assistant_id, \*\*<a href="src/agility/types/assistant_update_params.py">params</a>) -> <a href="./src/agility/types/assistant_with_config.py">AssistantWithConfig</a></code>
14-
- <code title="get /api/assistants/">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">list</a>(\*\*<a href="src/agility/types/assistant_list_params.py">params</a>) -> <a href="./src/agility/types/assistant_with_config.py">SyncMyOffsetPage[AssistantWithConfig]</a></code>
14+
- <code title="get /api/assistants/">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">list</a>(\*\*<a href="src/agility/types/assistant_list_params.py">params</a>) -> <a href="./src/agility/types/assistant_list_response.py">SyncMyOffsetPage[AssistantListResponse]</a></code>
1515
- <code title="delete /api/assistants/{assistant_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">delete</a>(assistant_id) -> None</code>
1616

1717
## AccessKeys
@@ -32,15 +32,15 @@ Methods:
3232
Types:
3333

3434
```python
35-
from agility.types import KnowledgeBaseWithConfig
35+
from agility.types import KnowledgeBaseWithConfig, KnowledgeBaseListResponse
3636
```
3737

3838
Methods:
3939

4040
- <code title="post /api/knowledge_bases/">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">create</a>(\*\*<a href="src/agility/types/knowledge_base_create_params.py">params</a>) -> <a href="./src/agility/types/knowledge_base_with_config.py">KnowledgeBaseWithConfig</a></code>
4141
- <code title="get /api/knowledge_bases/{knowledge_base_id}">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">retrieve</a>(knowledge_base_id) -> <a href="./src/agility/types/knowledge_base_with_config.py">KnowledgeBaseWithConfig</a></code>
4242
- <code title="put /api/knowledge_bases/{knowledge_base_id}">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">update</a>(knowledge_base_id, \*\*<a href="src/agility/types/knowledge_base_update_params.py">params</a>) -> <a href="./src/agility/types/knowledge_base_with_config.py">KnowledgeBaseWithConfig</a></code>
43-
- <code title="get /api/knowledge_bases/">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">list</a>(\*\*<a href="src/agility/types/knowledge_base_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_base_with_config.py">SyncMyOffsetPage[KnowledgeBaseWithConfig]</a></code>
43+
- <code title="get /api/knowledge_bases/">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">list</a>(\*\*<a href="src/agility/types/knowledge_base_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_base_list_response.py">SyncMyOffsetPage[KnowledgeBaseListResponse]</a></code>
4444
- <code title="delete /api/knowledge_bases/{knowledge_base_id}">client.knowledge_bases.<a href="./src/agility/resources/knowledge_bases/knowledge_bases.py">delete</a>(knowledge_base_id) -> None</code>
4545

4646
## Sources

mypy.ini

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ show_error_codes = True
55
# Exclude _files.py because mypy isn't smart enough to apply
66
# the correct type narrowing and as this is an internal module
77
# it's fine to just use Pyright.
8-
exclude = ^(src/agility/_files\.py|_dev/.*\.py)$
8+
#
9+
# We also exclude our `tests` as mypy doesn't always infer
10+
# types correctly and Pyright will still catch any type errors.
11+
exclude = ^(src/agility/_files\.py|_dev/.*\.py|tests/.*)$
912

1013
strict_equality = True
1114
implicit_reexport = True

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ authors = [
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.7, <5",
13+
"typing-extensions>=4.10, <5",
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",
17-
"cached-property; python_version < '3.8'",
1817
]
1918
requires-python = ">= 3.8"
2019
classifiers = [
@@ -55,6 +54,7 @@ dev-dependencies = [
5554
"dirty-equals>=0.6.0",
5655
"importlib-metadata>=6.7.0",
5756
"rich>=13.7.1",
57+
"nest_asyncio==1.6.0",
5858
]
5959

6060
[tool.rye.scripts]

requirements-dev.lock

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ h11==0.14.0
3535
# via httpcore
3636
httpcore==1.0.2
3737
# via httpx
38-
httpx==0.25.2
38+
httpx==0.28.1
3939
# via agility
4040
# via respx
4141
idna==3.4
@@ -51,6 +51,7 @@ mdurl==0.1.2
5151
mypy==1.13.0
5252
mypy-extensions==1.0.0
5353
# via mypy
54+
nest-asyncio==1.6.0
5455
nodeenv==1.8.0
5556
# via pyright
5657
nox==2023.4.22
@@ -61,21 +62,21 @@ platformdirs==3.11.0
6162
# via virtualenv
6263
pluggy==1.5.0
6364
# via pytest
64-
pydantic==2.9.2
65+
pydantic==2.10.3
6566
# via agility
66-
pydantic-core==2.23.4
67+
pydantic-core==2.27.1
6768
# via pydantic
6869
pygments==2.18.0
6970
# via rich
70-
pyright==1.1.380
71+
pyright==1.1.390
7172
pytest==8.3.3
7273
# via pytest-asyncio
7374
pytest-asyncio==0.24.0
7475
python-dateutil==2.8.2
7576
# via time-machine
7677
pytz==2023.3.post1
7778
# via dirty-equals
78-
respx==0.20.2
79+
respx==0.22.0
7980
rich==13.7.1
8081
ruff==0.6.9
8182
setuptools==68.2.2
@@ -85,7 +86,6 @@ six==1.16.0
8586
sniffio==1.3.0
8687
# via agility
8788
# via anyio
88-
# via httpx
8989
time-machine==2.9.0
9090
tomli==2.0.2
9191
# via mypy
@@ -96,6 +96,7 @@ typing-extensions==4.12.2
9696
# via mypy
9797
# via pydantic
9898
# via pydantic-core
99+
# via pyright
99100
virtualenv==20.24.5
100101
# via nox
101102
zipp==3.17.0

requirements.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@ h11==0.14.0
2525
# via httpcore
2626
httpcore==1.0.2
2727
# via httpx
28-
httpx==0.25.2
28+
httpx==0.28.1
2929
# via agility
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.9.2
33+
pydantic==2.10.3
3434
# via agility
35-
pydantic-core==2.23.4
35+
pydantic-core==2.27.1
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via agility
3939
# via anyio
40-
# via httpx
4140
typing-extensions==4.12.2
4241
# via agility
4342
# via anyio

src/agility/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from . import types
4-
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
4+
from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
55
from ._utils import file_from_path
66
from ._client import (
77
ENVIRONMENTS,
@@ -47,6 +47,7 @@
4747
"ProxiesTypes",
4848
"NotGiven",
4949
"NOT_GIVEN",
50+
"Omit",
5051
"AgilityError",
5152
"APIError",
5253
"APIStatusError",

src/agility/_base_client.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None:
767767

768768
class SyncHttpxClientWrapper(DefaultHttpxClient):
769769
def __del__(self) -> None:
770+
if self.is_closed:
771+
return
772+
770773
try:
771774
self.close()
772775
except Exception:
@@ -792,6 +795,7 @@ def __init__(
792795
custom_query: Mapping[str, object] | None = None,
793796
_strict_response_validation: bool,
794797
) -> None:
798+
kwargs: dict[str, Any] = {}
795799
if limits is not None:
796800
warnings.warn(
797801
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -804,6 +808,7 @@ def __init__(
804808
limits = DEFAULT_CONNECTION_LIMITS
805809

806810
if transport is not None:
811+
kwargs["transport"] = transport
807812
warnings.warn(
808813
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
809814
category=DeprecationWarning,
@@ -813,6 +818,7 @@ def __init__(
813818
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
814819

815820
if proxies is not None:
821+
kwargs["proxies"] = proxies
816822
warnings.warn(
817823
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
818824
category=DeprecationWarning,
@@ -856,10 +862,9 @@ def __init__(
856862
base_url=base_url,
857863
# cast to a valid type because mypy doesn't understand our type narrowing
858864
timeout=cast(Timeout, timeout),
859-
proxies=proxies,
860-
transport=transport,
861865
limits=limits,
862866
follow_redirects=True,
867+
**kwargs, # type: ignore
863868
)
864869

865870
def is_closed(self) -> bool:
@@ -1332,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None:
13321337

13331338
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
13341339
def __del__(self) -> None:
1340+
if self.is_closed:
1341+
return
1342+
13351343
try:
13361344
# TODO(someday): support non asyncio runtimes here
13371345
asyncio.get_running_loop().create_task(self.aclose())
@@ -1358,6 +1366,7 @@ def __init__(
13581366
custom_headers: Mapping[str, str] | None = None,
13591367
custom_query: Mapping[str, object] | None = None,
13601368
) -> None:
1369+
kwargs: dict[str, Any] = {}
13611370
if limits is not None:
13621371
warnings.warn(
13631372
"The `connection_pool_limits` argument is deprecated. The `http_client` argument should be passed instead",
@@ -1370,6 +1379,7 @@ def __init__(
13701379
limits = DEFAULT_CONNECTION_LIMITS
13711380

13721381
if transport is not None:
1382+
kwargs["transport"] = transport
13731383
warnings.warn(
13741384
"The `transport` argument is deprecated. The `http_client` argument should be passed instead",
13751385
category=DeprecationWarning,
@@ -1379,6 +1389,7 @@ def __init__(
13791389
raise ValueError("The `http_client` argument is mutually exclusive with `transport`")
13801390

13811391
if proxies is not None:
1392+
kwargs["proxies"] = proxies
13821393
warnings.warn(
13831394
"The `proxies` argument is deprecated. The `http_client` argument should be passed instead",
13841395
category=DeprecationWarning,
@@ -1422,10 +1433,9 @@ def __init__(
14221433
base_url=base_url,
14231434
# cast to a valid type because mypy doesn't understand our type narrowing
14241435
timeout=cast(Timeout, timeout),
1425-
proxies=proxies,
1426-
transport=transport,
14271436
limits=limits,
14281437
follow_redirects=True,
1438+
**kwargs, # type: ignore
14291439
)
14301440

14311441
def is_closed(self) -> bool:

0 commit comments

Comments
 (0)