Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
783cc66
chore(internal): bump pyright version
stainless-app[bot] Apr 17, 2025
f2a8f20
chore(internal): base client updates
stainless-app[bot] Apr 17, 2025
2323a23
chore(internal): update models test
stainless-app[bot] Apr 19, 2025
0d7d519
chore(ci): add timeout thresholds for CI jobs
stainless-app[bot] Apr 23, 2025
b801c78
chore(internal): import reformatting
stainless-app[bot] Apr 23, 2025
e94a0e5
chore(internal): fix list file params
stainless-app[bot] Apr 23, 2025
6ab66d1
chore(internal): refactor retries to not use recursion
stainless-app[bot] Apr 23, 2025
bfbb2fd
fix(pydantic v1): more robust ModelField.annotation check
stainless-app[bot] Apr 23, 2025
7f1729b
chore(internal): codegen related update
stainless-app[bot] Apr 24, 2025
f256cb9
chore(ci): only use depot for staging repos
stainless-app[bot] Apr 24, 2025
871ab41
chore: broadly detect json family of content-type headers
stainless-app[bot] Apr 24, 2025
ef52679
feat(api): api update
stainless-app[bot] May 8, 2025
3282a36
chore(internal): avoid errors for isinstance checks on proxies
stainless-app[bot] May 9, 2025
145581d
fix(package): support direct resource imports
stainless-app[bot] May 10, 2025
81ef208
chore(ci): upload sdks to package manager
stainless-app[bot] May 15, 2025
4baeb33
feat(api): api update
stainless-app[bot] May 15, 2025
a1156ab
chore(ci): fix installation instructions
stainless-app[bot] May 16, 2025
8cac43f
chore(internal): codegen related update
stainless-app[bot] May 17, 2025
80169b1
chore(docs): grammar improvements
stainless-app[bot] May 22, 2025
aa736a5
chore(internal): codegen related update
stainless-app[bot] May 28, 2025
5e03dcf
fix(docs/api): remove references to nonexistent types
stainless-app[bot] May 28, 2025
f839d18
chore(docs): remove reference to rye shell
stainless-app[bot] Jun 3, 2025
a007eca
chore(docs): remove unnecessary param examples
stainless-app[bot] Jun 3, 2025
8b6e232
feat(client): add follow_redirects request option
stainless-app[bot] Jun 3, 2025
ff1a52e
chore(tests): run tests in parallel
stainless-app[bot] Jun 13, 2025
6be6f59
fix(client): correctly parse binary response | stream
stainless-app[bot] Jun 13, 2025
c9bde31
feat(api): api update
stainless-app[bot] Jun 18, 2025
cea0006
feat(api): manual updates
stainless-app[bot] Jun 19, 2025
0d63906
chore: change publish docs url
stainless-app[bot] Jun 21, 2025
f21d471
feat(client): add support for aiohttp
stainless-app[bot] Jun 21, 2025
aa78bfb
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 24, 2025
376dead
feat(api): api update
stainless-app[bot] Jun 24, 2025
2cf77fe
feat(api): api update
stainless-app[bot] Jun 24, 2025
fa28a62
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 28, 2025
0da8bbe
fix(ci): correct conditional
stainless-app[bot] Jun 30, 2025
8a0a0a9
chore(ci): change upload type
stainless-app[bot] Jul 2, 2025
14c6bd3
feat(api): api update
stainless-app[bot] Jul 7, 2025
11e35d7
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 9, 2025
d3ab167
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 9, 2025
f5ba0a7
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 10, 2025
4178569
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 11, 2025
29ac2d4
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 12, 2025
08f1e35
feat(api): api update
stainless-app[bot] Jul 14, 2025
ff1fe4c
feat: clean up environment call outs
stainless-app[bot] Jul 15, 2025
eed76f3
feat(api): api update
stainless-app[bot] Jul 16, 2025
049f361
fix(parsing): ignore empty metadata
stainless-app[bot] Jul 22, 2025
5a6980c
fix(parsing): parse extra field types
stainless-app[bot] Jul 23, 2025
816b98a
chore(project): add settings file for vscode
stainless-app[bot] Jul 25, 2025
561ed46
feat(client): support file upload requests
stainless-app[bot] Jul 31, 2025
641082e
Merge remote-tracking branch 'stainless/main' into update
axl1313 Aug 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 53 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
name: CI
on:
push:
branches:
- main
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches:
- main
- next
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/agility-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand All @@ -29,9 +35,49 @@ jobs:
- name: Run lints
run: ./scripts/lint

build:
if: github.repository == 'stainless-sdks/agility-python' && (github.event_name == 'push' || github.event.pull_request.head.repo.fork)
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: depot-ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Install Rye
run: |
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: '0.44.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
run: rye sync --all-features

- name: Run build
run: rye build

- name: Get GitHub OIDC Token
id: github-oidc
uses: actions/github-script@v6
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Upload tarball
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
run: ./scripts/utils/upload-artifact.sh

test:
timeout-minutes: 10
name: test
runs-on: ubuntu-latest
runs-on: ${{ github.repository == 'stainless-sdks/agility-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.prism.log
.vscode
_dev

__pycache__
Expand Down
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 42
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-bb543bebe38d4cc889a3fa1ebc212458cd4321233d904357be98f8b22db82960.yml
openapi_spec_hash: 7a30a005e382a8db9fafa55903c3a977
config_hash: 6d2156cfe279456cf3c35ba5c66be1c1
configured_endpoints: 43
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cleanlab%2Fagility-9e6009a931b636947a7410707ffb4db68f9a00d6f7e3ec6e55c365f883c50223.yml
openapi_spec_hash: 264626d871113465d14672d73e910c03
config_hash: 58f3e6b15392ca51b942e41597d56e7f
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"python.analysis.importFormat": "relative",
}
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ $ rye sync --all-features
You can then run scripts using `rye run python script.py` or by activating the virtual environment:

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

# now you can omit the `rye run` prefix
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ before making any information public.
## Reporting Non-SDK Related Security Issues

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

### Agility Terms and Policies

Please contact dev-feedback@agility.com for any questions or concerns regarding security of our services.
Please contact dev-feedback@agility.com for any questions or concerns regarding the security of our services.

---

Expand Down
16 changes: 11 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
Types:

```python
from agility.types import Assistant, AssistantWithConfig, AssistantListResponse
from agility.types import (
Assistant,
AssistantWithConfig,
AssistantListResponse,
AssistantRetrieveRunMetadataResponse,
)
```

Methods:
Expand All @@ -13,6 +18,7 @@ Methods:
- <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>
- <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>
- <code title="delete /api/assistants/{assistant_id}">client.assistants.<a href="./src/agility/resources/assistants/assistants.py">delete</a>(assistant_id) -> None</code>
- <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>

## AccessKeys

Expand Down Expand Up @@ -48,7 +54,7 @@ Methods:
Types:

```python
from agility.types.knowledge_bases import Source, SourceStatusResponse, SourceSyncResponse
from agility.types.knowledge_bases import Source, SourceStatusResponse
```

Methods:
Expand All @@ -59,7 +65,7 @@ Methods:
- <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>
- <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>
- <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>
- <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>
- <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>

### Documents

Expand Down Expand Up @@ -134,15 +140,15 @@ Methods:
Types:

```python
from agility.types.threads import Run, RunStreamResponse
from agility.types.threads import Run
```

Methods:

- <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>
- <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>
- <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>
- <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>
- <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>

# Integrations

Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Operating System :: POSIX",
"Operating System :: MacOS",
Expand All @@ -37,12 +38,14 @@ classifiers = [
Homepage = "https://github.com/stainless-sdks/agility-python"
Repository = "https://github.com/stainless-sdks/agility-python"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]

[tool.rye]
managed = true
# version pins are in requirements-dev.lock
dev-dependencies = [
"pyright>=1.1.359",
"pyright==1.1.399",
"mypy",
"respx",
"pytest",
Expand All @@ -54,6 +57,7 @@ dev-dependencies = [
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"nest_asyncio==1.6.0",
"pytest-xdist>=3.6.1",
]

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

[tool.pytest.ini_options]
testpaths = ["tests"]
addopts = "--tb=short"
addopts = "--tb=short -n auto"
xfail_strict = true
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"
Expand Down
37 changes: 34 additions & 3 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,24 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via agility
# via httpx-aiohttp
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via agility
# via httpx
argcomplete==3.1.2
# via nox
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
Expand All @@ -30,25 +41,37 @@ distro==1.8.0
exceptiongroup==1.2.2
# via anyio
# via pytest
execnet==2.1.1
# via pytest-xdist
filelock==3.12.4
# via virtualenv
h11==0.14.0
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via agility
# via httpx-aiohttp
# via respx
httpx-aiohttp==0.1.8
# via agility
idna==3.4
# via anyio
# via httpx
# via yarl
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
markdown-it-py==3.0.0
# via rich
mdurl==0.1.2
# via markdown-it-py
multidict==6.4.4
# via aiohttp
# via yarl
mypy==1.14.1
mypy-extensions==1.0.0
# via mypy
Expand All @@ -63,16 +86,21 @@ platformdirs==3.11.0
# via virtualenv
pluggy==1.5.0
# via pytest
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via agility
pydantic-core==2.27.1
# via pydantic
pygments==2.18.0
# via rich
pyright==1.1.392.post0
pyright==1.1.399
pytest==8.3.3
# via pytest-asyncio
# via pytest-xdist
pytest-asyncio==0.24.0
pytest-xdist==3.7.0
python-dateutil==2.8.2
# via time-machine
pytz==2023.3.post1
Expand All @@ -94,11 +122,14 @@ tomli==2.0.2
typing-extensions==4.12.2
# via agility
# via anyio
# via multidict
# via mypy
# via pydantic
# via pydantic-core
# via pyright
virtualenv==20.24.5
# via nox
yarl==1.20.0
# via aiohttp
zipp==3.17.0
# via importlib-metadata
31 changes: 29 additions & 2 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,51 @@
# universal: false

-e file:.
aiohappyeyeballs==2.6.1
# via aiohttp
aiohttp==3.12.8
# via agility
# via httpx-aiohttp
aiosignal==1.3.2
# via aiohttp
annotated-types==0.6.0
# via pydantic
anyio==4.4.0
# via agility
# via httpx
async-timeout==5.0.1
# via aiohttp
attrs==25.3.0
# via aiohttp
certifi==2023.7.22
# via httpcore
# via httpx
distro==1.8.0
# via agility
exceptiongroup==1.2.2
# via anyio
h11==0.14.0
frozenlist==1.6.2
# via aiohttp
# via aiosignal
h11==0.16.0
# via httpcore
httpcore==1.0.2
httpcore==1.0.9
# via httpx
httpx==0.28.1
# via agility
# via httpx-aiohttp
httpx-aiohttp==0.1.8
# via agility
idna==3.4
# via anyio
# via httpx
# via yarl
multidict==6.4.4
# via aiohttp
# via yarl
propcache==0.3.1
# via aiohttp
# via yarl
pydantic==2.10.3
# via agility
pydantic-core==2.27.1
Expand All @@ -41,5 +65,8 @@ sniffio==1.3.0
typing-extensions==4.12.2
# via agility
# via anyio
# via multidict
# via pydantic
# via pydantic-core
yarl==1.20.0
# via aiohttp
Loading