Skip to content

Commit 641082e

Browse files
committed
Merge remote-tracking branch 'stainless/main' into update
2 parents 373e2d2 + 561ed46 commit 641082e

Some content is hidden

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

60 files changed

+1334
-1148
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
name: CI
22
on:
33
push:
4-
branches:
5-
- main
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
610
pull_request:
7-
branches:
8-
- main
9-
- next
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
1014

1115
jobs:
1216
lint:
17+
timeout-minutes: 10
1318
name: lint
14-
runs-on: ubuntu-latest
19+
runs-on: ${{ github.repository == 'stainless-sdks/agility-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
1521
steps:
1622
- uses: actions/checkout@v4
1723

@@ -29,9 +35,49 @@ jobs:
2935
- name: Run lints
3036
run: ./scripts/lint
3137

38+
build:
39+
if: github.repository == 'stainless-sdks/agility-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
40+
timeout-minutes: 10
41+
name: build
42+
permissions:
43+
contents: read
44+
id-token: write
45+
runs-on: depot-ubuntu-24.04
46+
steps:
47+
- uses: actions/checkout@v4
48+
49+
- name: Install Rye
50+
run: |
51+
curl -sSf https://rye.astral.sh/get | bash
52+
echo "$HOME/.rye/shims" >> $GITHUB_PATH
53+
env:
54+
RYE_VERSION: '0.44.0'
55+
RYE_INSTALL_OPTION: '--yes'
56+
57+
- name: Install dependencies
58+
run: rye sync --all-features
59+
60+
- name: Run build
61+
run: rye build
62+
63+
- name: Get GitHub OIDC Token
64+
id: github-oidc
65+
uses: actions/github-script@v6
66+
with:
67+
script: core.setOutput('github_token', await core.getIDToken());
68+
69+
- name: Upload tarball
70+
env:
71+
URL: https://pkg.stainless.com/s
72+
AUTH: ${{ steps.github-oidc.outputs.github_token }}
73+
SHA: ${{ github.sha }}
74+
run: ./scripts/utils/upload-artifact.sh
75+
3276
test:
77+
timeout-minutes: 10
3378
name: test
34-
runs-on: ubuntu-latest
79+
runs-on: ${{ github.repository == 'stainless-sdks/agility-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
80+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
3581
steps:
3682
- uses: actions/checkout@v4
3783

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.prism.log
2-
.vscode
32
_dev
43

54
__pycache__

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 42
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-bb543bebe38d4cc889a3fa1ebc212458cd4321233d904357be98f8b22db82960.yml
3-
openapi_spec_hash: 7a30a005e382a8db9fafa55903c3a977
4-
config_hash: 6d2156cfe279456cf3c35ba5c66be1c1
1+
configured_endpoints: 43
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-9e6009a931b636947a7410707ffb4db68f9a00d6f7e3ec6e55c365f883c50223.yml
3+
openapi_spec_hash: 264626d871113465d14672d73e910c03
4+
config_hash: 58f3e6b15392ca51b942e41597d56e7f

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"python.analysis.importFormat": "relative",
3+
}

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ $ rye sync --all-features
1717
You can then run scripts using `rye run python script.py` or by activating the virtual environment:
1818

1919
```sh
20-
$ rye shell
21-
# or manually activate - https://docs.python.org/3/library/venv.html#how-venvs-work
20+
# Activate the virtual environment - https://docs.python.org/3/library/venv.html#how-venvs-work
2221
$ source .venv/bin/activate
2322

2423
# now you can omit the `rye run` prefix

SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ before making any information public.
1616
## Reporting Non-SDK Related Security Issues
1717

1818
If you encounter security issues that are not directly related to SDKs but pertain to the services
19-
or products provided by Agility please follow the respective company's security reporting guidelines.
19+
or products provided by Agility, please follow the respective company's security reporting guidelines.
2020

2121
### Agility Terms and Policies
2222

23-
Please contact [email protected] for any questions or concerns regarding security of our services.
23+
Please contact [email protected] for any questions or concerns regarding the security of our services.
2424

2525
---
2626

api.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
Types:
44

55
```python
6-
from agility.types import Assistant, AssistantWithConfig, AssistantListResponse
6+
from agility.types import (
7+
Assistant,
8+
AssistantWithConfig,
9+
AssistantListResponse,
10+
AssistantRetrieveRunMetadataResponse,
11+
)
712
```
813

914
Methods:
@@ -13,6 +18,7 @@ Methods:
1318
- <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>
1419
- <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>
1520
- <code title="delete /api/assistants/{assistant_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">delete</a>(assistant_id) -> None</code>
21+
- <code title="get /api/assistants/{assistant_id}/historical_run_metadata/{run_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">retrieve_run_metadata</a>(run_id, \*, assistant_id) -> <a href="./src/agility/types/assistant_retrieve_run_metadata_response.py">AssistantRetrieveRunMetadataResponse</a></code>
1622

1723
## AccessKeys
1824

@@ -48,7 +54,7 @@ Methods:
4854
Types:
4955

5056
```python
51-
from agility.types.knowledge_bases import Source, SourceStatusResponse, SourceSyncResponse
57+
from agility.types.knowledge_bases import Source, SourceStatusResponse
5258
```
5359

5460
Methods:
@@ -59,7 +65,7 @@ Methods:
5965
- <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>
6066
- <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>
6167
- <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>
62-
- <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>
68+
- <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) -> object</code>
6369

6470
### Documents
6571

@@ -134,15 +140,15 @@ Methods:
134140
Types:
135141

136142
```python
137-
from agility.types.threads import Run, RunStreamResponse
143+
from agility.types.threads import Run
138144
```
139145

140146
Methods:
141147

142148
- <code title="post /api/threads/{thread_id}/runs/">client.threads.runs.<a href="./src/agility/resources/threads/runs.py">create</a>(thread_id, \*\*<a href="src/agility/types/threads/run_create_params.py">params</a>) -> <a href="./src/agility/types/threads/run.py">Run</a></code>
143149
- <code title="get /api/threads/{thread_id}/runs/{run_id}">client.threads.runs.<a href="./src/agility/resources/threads/runs.py">retrieve</a>(run_id, \*, thread_id) -> <a href="./src/agility/types/threads/run.py">Run</a></code>
144150
- <code title="delete /api/threads/{thread_id}/runs/{run_id}">client.threads.runs.<a href="./src/agility/resources/threads/runs.py">delete</a>(run_id, \*, thread_id) -> None</code>
145-
- <code title="post /api/threads/{thread_id}/runs/stream">client.threads.runs.<a href="./src/agility/resources/threads/runs.py">stream</a>(thread_id, \*\*<a href="src/agility/types/threads/run_stream_params.py">params</a>) -> <a href="./src/agility/types/threads/run_stream_response.py">object</a></code>
151+
- <code title="post /api/threads/{thread_id}/runs/stream">client.threads.runs.<a href="./src/agility/resources/threads/runs.py">stream</a>(thread_id, \*\*<a href="src/agility/types/threads/run_stream_params.py">params</a>) -> object</code>
146152

147153
# Integrations
148154

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ classifiers = [
2424
"Programming Language :: Python :: 3.10",
2525
"Programming Language :: Python :: 3.11",
2626
"Programming Language :: Python :: 3.12",
27+
"Programming Language :: Python :: 3.13",
2728
"Operating System :: OS Independent",
2829
"Operating System :: POSIX",
2930
"Operating System :: MacOS",
@@ -37,12 +38,14 @@ classifiers = [
3738
Homepage = "https://github.com/stainless-sdks/agility-python"
3839
Repository = "https://github.com/stainless-sdks/agility-python"
3940

41+
[project.optional-dependencies]
42+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
4043

4144
[tool.rye]
4245
managed = true
4346
# version pins are in requirements-dev.lock
4447
dev-dependencies = [
45-
"pyright>=1.1.359",
48+
"pyright==1.1.399",
4649
"mypy",
4750
"respx",
4851
"pytest",
@@ -54,6 +57,7 @@ dev-dependencies = [
5457
"importlib-metadata>=6.7.0",
5558
"rich>=13.7.1",
5659
"nest_asyncio==1.6.0",
60+
"pytest-xdist>=3.6.1",
5761
]
5862

5963
[tool.rye.scripts]
@@ -125,7 +129,7 @@ replacement = '[\1](https://github.com/stainless-sdks/agility-python/tree/main/\
125129

126130
[tool.pytest.ini_options]
127131
testpaths = ["tests"]
128-
addopts = "--tb=short"
132+
addopts = "--tb=short -n auto"
129133
xfail_strict = true
130134
asyncio_mode = "auto"
131135
asyncio_default_fixture_loop_scope = "session"

requirements-dev.lock

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@
1010
# universal: false
1111

1212
-e file:.
13+
aiohappyeyeballs==2.6.1
14+
# via aiohttp
15+
aiohttp==3.12.8
16+
# via agility
17+
# via httpx-aiohttp
18+
aiosignal==1.3.2
19+
# via aiohttp
1320
annotated-types==0.6.0
1421
# via pydantic
1522
anyio==4.4.0
1623
# via agility
1724
# via httpx
1825
argcomplete==3.1.2
1926
# via nox
27+
async-timeout==5.0.1
28+
# via aiohttp
29+
attrs==25.3.0
30+
# via aiohttp
2031
certifi==2023.7.22
2132
# via httpcore
2233
# via httpx
@@ -30,25 +41,37 @@ distro==1.8.0
3041
exceptiongroup==1.2.2
3142
# via anyio
3243
# via pytest
44+
execnet==2.1.1
45+
# via pytest-xdist
3346
filelock==3.12.4
3447
# via virtualenv
35-
h11==0.14.0
48+
frozenlist==1.6.2
49+
# via aiohttp
50+
# via aiosignal
51+
h11==0.16.0
3652
# via httpcore
37-
httpcore==1.0.2
53+
httpcore==1.0.9
3854
# via httpx
3955
httpx==0.28.1
4056
# via agility
57+
# via httpx-aiohttp
4158
# via respx
59+
httpx-aiohttp==0.1.8
60+
# via agility
4261
idna==3.4
4362
# via anyio
4463
# via httpx
64+
# via yarl
4565
importlib-metadata==7.0.0
4666
iniconfig==2.0.0
4767
# via pytest
4868
markdown-it-py==3.0.0
4969
# via rich
5070
mdurl==0.1.2
5171
# via markdown-it-py
72+
multidict==6.4.4
73+
# via aiohttp
74+
# via yarl
5275
mypy==1.14.1
5376
mypy-extensions==1.0.0
5477
# via mypy
@@ -63,16 +86,21 @@ platformdirs==3.11.0
6386
# via virtualenv
6487
pluggy==1.5.0
6588
# via pytest
89+
propcache==0.3.1
90+
# via aiohttp
91+
# via yarl
6692
pydantic==2.10.3
6793
# via agility
6894
pydantic-core==2.27.1
6995
# via pydantic
7096
pygments==2.18.0
7197
# via rich
72-
pyright==1.1.392.post0
98+
pyright==1.1.399
7399
pytest==8.3.3
74100
# via pytest-asyncio
101+
# via pytest-xdist
75102
pytest-asyncio==0.24.0
103+
pytest-xdist==3.7.0
76104
python-dateutil==2.8.2
77105
# via time-machine
78106
pytz==2023.3.post1
@@ -94,11 +122,14 @@ tomli==2.0.2
94122
typing-extensions==4.12.2
95123
# via agility
96124
# via anyio
125+
# via multidict
97126
# via mypy
98127
# via pydantic
99128
# via pydantic-core
100129
# via pyright
101130
virtualenv==20.24.5
102131
# via nox
132+
yarl==1.20.0
133+
# via aiohttp
103134
zipp==3.17.0
104135
# via importlib-metadata

requirements.lock

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,51 @@
1010
# universal: false
1111

1212
-e file:.
13+
aiohappyeyeballs==2.6.1
14+
# via aiohttp
15+
aiohttp==3.12.8
16+
# via agility
17+
# via httpx-aiohttp
18+
aiosignal==1.3.2
19+
# via aiohttp
1320
annotated-types==0.6.0
1421
# via pydantic
1522
anyio==4.4.0
1623
# via agility
1724
# via httpx
25+
async-timeout==5.0.1
26+
# via aiohttp
27+
attrs==25.3.0
28+
# via aiohttp
1829
certifi==2023.7.22
1930
# via httpcore
2031
# via httpx
2132
distro==1.8.0
2233
# via agility
2334
exceptiongroup==1.2.2
2435
# via anyio
25-
h11==0.14.0
36+
frozenlist==1.6.2
37+
# via aiohttp
38+
# via aiosignal
39+
h11==0.16.0
2640
# via httpcore
27-
httpcore==1.0.2
41+
httpcore==1.0.9
2842
# via httpx
2943
httpx==0.28.1
3044
# via agility
45+
# via httpx-aiohttp
46+
httpx-aiohttp==0.1.8
47+
# via agility
3148
idna==3.4
3249
# via anyio
3350
# via httpx
51+
# via yarl
52+
multidict==6.4.4
53+
# via aiohttp
54+
# via yarl
55+
propcache==0.3.1
56+
# via aiohttp
57+
# via yarl
3458
pydantic==2.10.3
3559
# via agility
3660
pydantic-core==2.27.1
@@ -41,5 +65,8 @@ sniffio==1.3.0
4165
typing-extensions==4.12.2
4266
# via agility
4367
# via anyio
68+
# via multidict
4469
# via pydantic
4570
# via pydantic-core
71+
yarl==1.20.0
72+
# via aiohttp

0 commit comments

Comments
 (0)