Skip to content

Commit da13f51

Browse files
update internal repo to use latest stainless python sdk
1 parent 45c8bc5 commit da13f51

Some content is hidden

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

56 files changed

+779
-747
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 38
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-545a995322d24ba70cd2e52703fe1e6422a02fe73623439a2815f1d55142edff.yml
1+
configured_endpoints: 36
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-36e7c2cdfead9cc1628d9e75a9be97a5580130287e8610c5bceac14770743512.yml

api.md

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,66 +3,60 @@
33
Types:
44

55
```python
6-
from agility.types import Assistant, AssistantWithConfig, AssistantListResponse
6+
from agility.types import Assistant, AssistantWithConfig
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_list_response.py">AssistantListResponse</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>
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
1818

1919
Types:
2020

2121
```python
22-
from agility.types.assistants import AccessKey, AccessKeyListResponse
22+
from agility.types.assistants import AccessKey
2323
```
2424

2525
Methods:
2626

2727
- <code title="post /api/assistants/{assistant_id}/access_keys/">client.assistants.access_keys.<a href="./src/agility/resources/assistants/access_keys.py">create</a>(assistant_id, \*\*<a href="src/agility/types/assistants/access_key_create_params.py">params</a>) -> <a href="./src/agility/types/assistants/access_key.py">AccessKey</a></code>
28-
- <code title="get /api/assistants/{assistant_id}/access_keys/{access_key_id}">client.assistants.access_keys.<a href="./src/agility/resources/assistants/access_keys.py">retrieve</a>(access_key_id, \*, assistant_id) -> <a href="./src/agility/types/assistants/access_key.py">AccessKey</a></code>
29-
- <code title="get /api/assistants/{assistant_id}/access_keys/">client.assistants.access_keys.<a href="./src/agility/resources/assistants/access_keys.py">list</a>(assistant_id, \*\*<a href="src/agility/types/assistants/access_key_list_params.py">params</a>) -> <a href="./src/agility/types/assistants/access_key_list_response.py">AccessKeyListResponse</a></code>
28+
- <code title="get /api/assistants/{assistant_id}/access_keys/">client.assistants.access_keys.<a href="./src/agility/resources/assistants/access_keys.py">list</a>(assistant_id, \*\*<a href="src/agility/types/assistants/access_key_list_params.py">params</a>) -> <a href="./src/agility/types/assistants/access_key.py">SyncMyOffsetPage[AccessKey]</a></code>
3029

3130
# KnowledgeBases
3231

3332
Types:
3433

3534
```python
36-
from agility.types import KnowledgeBaseWithConfig, KnowledgeBaseListResponse
35+
from agility.types import KnowledgeBaseWithConfig
3736
```
3837

3938
Methods:
4039

4140
- <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>
4241
- <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>
4342
- <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>
44-
- <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">KnowledgeBaseListResponse</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>
4544
- <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>
4645

4746
## Sources
4847

4948
Types:
5049

5150
```python
52-
from agility.types.knowledge_bases import (
53-
Source,
54-
SourceStatusResponse,
55-
SourceListResponse,
56-
SourceSyncResponse,
57-
)
51+
from agility.types.knowledge_bases import Source, SourceStatusResponse, SourceSyncResponse
5852
```
5953

6054
Methods:
6155

6256
- <code title="post /api/knowledge_bases/{knowledge_base_id}/sources/">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">create</a>(knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/source_create_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/source.py">Source</a></code>
6357
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">retrieve</a>(source_id, \*, knowledge_base_id) -> <a href="./src/agility/types/knowledge_bases/source.py">Source</a></code>
6458
- <code title="put /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">update</a>(source_id, \*, knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/source_update_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/source.py">Source</a></code>
65-
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">list</a>(knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/source_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/source_list_response.py">SourceListResponse</a></code>
59+
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">list</a>(knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/source_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/source.py">SyncMyOffsetPage[Source]</a></code>
6660
- <code title="delete /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">delete</a>(source_id, \*, knowledge_base_id) -> None</code>
6761
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}/status">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">status</a>(source_id, \*, knowledge_base_id) -> <a href="./src/agility/types/knowledge_bases/source_status_response.py">SourceStatusResponse</a></code>
6862
- <code title="post /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}/sync">client.knowledge_bases.sources.<a href="./src/agility/resources/knowledge_bases/sources/sources.py">sync</a>(source_id, \*, knowledge_base_id) -> <a href="./src/agility/types/knowledge_bases/source_sync_response.py">object</a></code>
@@ -72,25 +66,13 @@ Methods:
7266
Types:
7367

7468
```python
75-
from agility.types.knowledge_bases.sources import Document, DocumentListResponse
69+
from agility.types.knowledge_bases.sources import Document
7670
```
7771

7872
Methods:
7973

8074
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}/documents/{document_id}">client.knowledge_bases.sources.documents.<a href="./src/agility/resources/knowledge_bases/sources/documents.py">retrieve</a>(document_id, \*, knowledge_base_id, source_id) -> <a href="./src/agility/types/knowledge_bases/sources/document.py">Document</a></code>
81-
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}/documents/">client.knowledge_bases.sources.documents.<a href="./src/agility/resources/knowledge_bases/sources/documents.py">list</a>(source_id, \*, knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/sources/document_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/sources/document_list_response.py">DocumentListResponse</a></code>
82-
83-
# Health
84-
85-
Types:
86-
87-
```python
88-
from agility.types import HealthCheckResponse
89-
```
90-
91-
Methods:
92-
93-
- <code title="get /api/health/">client.health.<a href="./src/agility/resources/health.py">check</a>() -> <a href="./src/agility/types/health_check_response.py">HealthCheckResponse</a></code>
75+
- <code title="get /api/knowledge_bases/{knowledge_base_id}/sources/{source_id}/documents/">client.knowledge_bases.sources.documents.<a href="./src/agility/resources/knowledge_bases/sources/documents.py">list</a>(source_id, \*, knowledge_base_id, \*\*<a href="src/agility/types/knowledge_bases/sources/document_list_params.py">params</a>) -> <a href="./src/agility/types/knowledge_bases/sources/document.py">SyncMyOffsetPage[Document]</a></code>
9476

9577
# Users
9678

@@ -122,29 +104,29 @@ Methods:
122104
Types:
123105

124106
```python
125-
from agility.types import Thread, ThreadListResponse
107+
from agility.types import Thread
126108
```
127109

128110
Methods:
129111

130112
- <code title="post /api/threads/">client.threads.<a href="./src/agility/resources/threads/threads.py">create</a>() -> <a href="./src/agility/types/thread.py">Thread</a></code>
131113
- <code title="get /api/threads/{thread_id}">client.threads.<a href="./src/agility/resources/threads/threads.py">retrieve</a>(thread_id) -> <a href="./src/agility/types/thread.py">Thread</a></code>
132-
- <code title="get /api/threads/">client.threads.<a href="./src/agility/resources/threads/threads.py">list</a>(\*\*<a href="src/agility/types/thread_list_params.py">params</a>) -> <a href="./src/agility/types/thread_list_response.py">ThreadListResponse</a></code>
114+
- <code title="get /api/threads/">client.threads.<a href="./src/agility/resources/threads/threads.py">list</a>(\*\*<a href="src/agility/types/thread_list_params.py">params</a>) -> <a href="./src/agility/types/thread.py">SyncMyOffsetPage[Thread]</a></code>
133115
- <code title="delete /api/threads/{thread_id}">client.threads.<a href="./src/agility/resources/threads/threads.py">delete</a>(thread_id) -> None</code>
134116

135117
## Messages
136118

137119
Types:
138120

139121
```python
140-
from agility.types.threads import Message, MessageListResponse
122+
from agility.types.threads import Message
141123
```
142124

143125
Methods:
144126

145127
- <code title="post /api/threads/{thread_id}/messages/">client.threads.messages.<a href="./src/agility/resources/threads/messages.py">create</a>(thread_id, \*\*<a href="src/agility/types/threads/message_create_params.py">params</a>) -> <a href="./src/agility/types/threads/message.py">Message</a></code>
146128
- <code title="get /api/threads/{thread_id}/messages/{message_id}">client.threads.messages.<a href="./src/agility/resources/threads/messages.py">retrieve</a>(message_id, \*, thread_id) -> <a href="./src/agility/types/threads/message.py">Message</a></code>
147-
- <code title="get /api/threads/{thread_id}/messages/">client.threads.messages.<a href="./src/agility/resources/threads/messages.py">list</a>(thread_id, \*\*<a href="src/agility/types/threads/message_list_params.py">params</a>) -> <a href="./src/agility/types/threads/message_list_response.py">MessageListResponse</a></code>
129+
- <code title="get /api/threads/{thread_id}/messages/">client.threads.messages.<a href="./src/agility/resources/threads/messages.py">list</a>(thread_id, \*\*<a href="src/agility/types/threads/message_list_params.py">params</a>) -> <a href="./src/agility/types/threads/message.py">SyncMyOffsetPage[Message]</a></code>
148130
- <code title="delete /api/threads/{thread_id}/messages/{message_id}">client.threads.messages.<a href="./src/agility/resources/threads/messages.py">delete</a>(message_id, \*, thread_id) -> None</code>
149131

150132
## Runs

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,11 @@ format = { chain = [
6363
"format:ruff",
6464
"format:docs",
6565
"fix:ruff",
66+
# run formatting again to fix any inconsistencies when imports are stripped
67+
"format:ruff",
6668
]}
67-
"format:black" = "black ."
6869
"format:docs" = "python scripts/utils/ruffen-docs.py README.md api.md"
6970
"format:ruff" = "ruff format"
70-
"format:isort" = "isort ."
7171

7272
"lint" = { chain = [
7373
"check:ruff",
@@ -125,10 +125,6 @@ path = "README.md"
125125
pattern = '\[(.+?)\]\(((?!https?://)\S+?)\)'
126126
replacement = '[\1](https://github.com/stainless-sdks/agility-python/tree/main/\g<2>)'
127127

128-
[tool.black]
129-
line-length = 120
130-
target-version = ["py37"]
131-
132128
[tool.pytest.ini_options]
133129
testpaths = ["tests"]
134130
addopts = "--tb=short"

requirements-dev.lock

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ anyio==4.4.0
1616
# via httpx
1717
argcomplete==3.1.2
1818
# via nox
19-
attrs==23.1.0
20-
# via pytest
2119
certifi==2023.7.22
2220
# via httpcore
2321
# via httpx
@@ -28,8 +26,9 @@ distlib==0.3.7
2826
# via virtualenv
2927
distro==1.8.0
3028
# via agility
31-
exceptiongroup==1.1.3
29+
exceptiongroup==1.2.2
3230
# via anyio
31+
# via pytest
3332
filelock==3.12.4
3433
# via virtualenv
3534
h11==0.14.0
@@ -49,7 +48,7 @@ markdown-it-py==3.0.0
4948
# via rich
5049
mdurl==0.1.2
5150
# via markdown-it-py
52-
mypy==1.11.2
51+
mypy==1.13.0
5352
mypy-extensions==1.0.0
5453
# via mypy
5554
nodeenv==1.8.0
@@ -60,27 +59,25 @@ packaging==23.2
6059
# via pytest
6160
platformdirs==3.11.0
6261
# via virtualenv
63-
pluggy==1.3.0
64-
# via pytest
65-
py==1.11.0
62+
pluggy==1.5.0
6663
# via pytest
67-
pydantic==2.7.1
64+
pydantic==2.9.2
6865
# via agility
69-
pydantic-core==2.18.2
66+
pydantic-core==2.23.4
7067
# via pydantic
7168
pygments==2.18.0
7269
# via rich
7370
pyright==1.1.380
74-
pytest==7.1.1
71+
pytest==8.3.3
7572
# via pytest-asyncio
76-
pytest-asyncio==0.21.1
73+
pytest-asyncio==0.24.0
7774
python-dateutil==2.8.2
7875
# via time-machine
7976
pytz==2023.3.post1
8077
# via dirty-equals
8178
respx==0.20.2
8279
rich==13.7.1
83-
ruff==0.6.5
80+
ruff==0.6.9
8481
setuptools==68.2.2
8582
# via nodeenv
8683
six==1.16.0
@@ -90,10 +87,10 @@ sniffio==1.3.0
9087
# via anyio
9188
# via httpx
9289
time-machine==2.9.0
93-
tomli==2.0.1
90+
tomli==2.0.2
9491
# via mypy
9592
# via pytest
96-
typing-extensions==4.8.0
93+
typing-extensions==4.12.2
9794
# via agility
9895
# via anyio
9996
# via mypy

requirements.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ certifi==2023.7.22
1919
# via httpx
2020
distro==1.8.0
2121
# via agility
22-
exceptiongroup==1.1.3
22+
exceptiongroup==1.2.2
2323
# via anyio
2424
h11==0.14.0
2525
# via httpcore
@@ -30,15 +30,15 @@ httpx==0.25.2
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.7.1
33+
pydantic==2.9.2
3434
# via agility
35-
pydantic-core==2.18.2
35+
pydantic-core==2.23.4
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via agility
3939
# via anyio
4040
# via httpx
41-
typing-extensions==4.8.0
41+
typing-extensions==4.12.2
4242
# via agility
4343
# via anyio
4444
# via pydantic

src/agility/__init__.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,18 @@
33
from . import types
44
from ._types import NOT_GIVEN, NoneType, NotGiven, Transport, ProxiesTypes
55
from ._utils import file_from_path
6-
from ._client import Client, Stream, Agility, Timeout, Transport, AsyncClient, AsyncStream, AsyncAgility, RequestOptions
6+
from ._client import (
7+
ENVIRONMENTS,
8+
Client,
9+
Stream,
10+
Agility,
11+
Timeout,
12+
Transport,
13+
AsyncClient,
14+
AsyncStream,
15+
AsyncAgility,
16+
RequestOptions,
17+
)
718
from ._models import BaseModel
819
from ._version import __title__, __version__
920
from ._response import APIResponse as APIResponse, AsyncAPIResponse as AsyncAPIResponse
@@ -58,6 +69,7 @@
5869
"AsyncStream",
5970
"Agility",
6071
"AsyncAgility",
72+
"ENVIRONMENTS",
6173
"file_from_path",
6274
"BaseModel",
6375
"DEFAULT_TIMEOUT",

src/agility/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1575,7 +1575,7 @@ async def _request(
15751575
except Exception as err:
15761576
log.debug("Encountered Exception", exc_info=True)
15771577

1578-
if retries_taken > 0:
1578+
if remaining_retries > 0:
15791579
return await self._retry_request(
15801580
input_options,
15811581
cast_to,

0 commit comments

Comments
 (0)