Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
c51f9ea
codegen metadata
stainless-app[bot] Jan 2, 2026
58c6ea0
codegen metadata
stainless-app[bot] Jan 2, 2026
33ade28
feat(api): api update
stainless-app[bot] Jan 2, 2026
07e2881
feat(client): add support for binary request streaming
stainless-app[bot] Jan 13, 2026
3779b42
codegen metadata
stainless-app[bot] Jan 15, 2026
c6b22dc
codegen metadata
stainless-app[bot] Jan 15, 2026
5ead7a7
codegen metadata
stainless-app[bot] Jan 15, 2026
ea84689
codegen metadata
stainless-app[bot] Jan 15, 2026
875c25d
codegen metadata
stainless-app[bot] Jan 15, 2026
b12c524
codegen metadata
stainless-app[bot] Jan 15, 2026
d645ccd
codegen metadata
stainless-app[bot] Jan 15, 2026
1137f64
codegen metadata
stainless-app[bot] Jan 15, 2026
d895bb4
codegen metadata
stainless-app[bot] Jan 15, 2026
3422fcb
codegen metadata
stainless-app[bot] Jan 15, 2026
0a059be
codegen metadata
stainless-app[bot] Jan 15, 2026
269a983
codegen metadata
stainless-app[bot] Jan 16, 2026
e50d2c9
codegen metadata
stainless-app[bot] Jan 16, 2026
b679539
codegen metadata
stainless-app[bot] Jan 16, 2026
64416da
codegen metadata
stainless-app[bot] Jan 16, 2026
d7e7eac
codegen metadata
stainless-app[bot] Jan 16, 2026
ab14172
codegen metadata
stainless-app[bot] Jan 16, 2026
b853828
codegen metadata
stainless-app[bot] Jan 16, 2026
b5828d8
codegen metadata
stainless-app[bot] Jan 16, 2026
53c97c7
codegen metadata
stainless-app[bot] Jan 16, 2026
6fb16db
codegen metadata
stainless-app[bot] Jan 16, 2026
64d91f6
chore(internal): update `actions/checkout` version
stainless-app[bot] Jan 16, 2026
aebaa7d
codegen metadata
stainless-app[bot] Jan 16, 2026
35b9f7c
codegen metadata
stainless-app[bot] Jan 16, 2026
fc8d8b2
codegen metadata
stainless-app[bot] Jan 16, 2026
8465986
codegen metadata
stainless-app[bot] Jan 17, 2026
8237453
codegen metadata
stainless-app[bot] Jan 17, 2026
8a1a866
codegen metadata
stainless-app[bot] Jan 17, 2026
38a5bd4
codegen metadata
stainless-app[bot] Jan 17, 2026
49563f9
codegen metadata
stainless-app[bot] Jan 17, 2026
6f1cae2
codegen metadata
stainless-app[bot] Jan 17, 2026
3682992
codegen metadata
stainless-app[bot] Jan 17, 2026
b5be760
codegen metadata
stainless-app[bot] Jan 17, 2026
e7aeae5
codegen metadata
stainless-app[bot] Jan 17, 2026
779ad6a
codegen metadata
stainless-app[bot] Jan 17, 2026
bcc73fa
codegen metadata
stainless-app[bot] Jan 17, 2026
6a868a7
codegen metadata
stainless-app[bot] Jan 17, 2026
9019c40
codegen metadata
stainless-app[bot] Jan 17, 2026
618cebf
codegen metadata
stainless-app[bot] Jan 17, 2026
c05de60
codegen metadata
stainless-app[bot] Jan 18, 2026
8d64529
codegen metadata
stainless-app[bot] Jan 18, 2026
00eafb5
codegen metadata
stainless-app[bot] Jan 18, 2026
a66c05f
codegen metadata
stainless-app[bot] Jan 18, 2026
10de533
codegen metadata
stainless-app[bot] Jan 18, 2026
7bbd5a0
codegen metadata
stainless-app[bot] Jan 18, 2026
61ad722
codegen metadata
stainless-app[bot] Jan 18, 2026
dc93722
codegen metadata
stainless-app[bot] Jan 18, 2026
b2aba05
codegen metadata
stainless-app[bot] Jan 18, 2026
a962acb
codegen metadata
stainless-app[bot] Jan 18, 2026
1bc1694
codegen metadata
stainless-app[bot] Jan 18, 2026
268c7a6
codegen metadata
stainless-app[bot] Jan 19, 2026
30b331e
codegen metadata
stainless-app[bot] Jan 19, 2026
b459a5c
codegen metadata
stainless-app[bot] Jan 19, 2026
0430307
codegen metadata
stainless-app[bot] Jan 19, 2026
2414267
codegen metadata
stainless-app[bot] Jan 19, 2026
0193f6b
codegen metadata
stainless-app[bot] Jan 19, 2026
c2f243a
codegen metadata
stainless-app[bot] Jan 19, 2026
612aca9
codegen metadata
stainless-app[bot] Jan 19, 2026
8b294aa
codegen metadata
stainless-app[bot] Jan 19, 2026
959dc35
codegen metadata
stainless-app[bot] Jan 19, 2026
8a9427f
codegen metadata
stainless-app[bot] Jan 19, 2026
9c95796
codegen metadata
stainless-app[bot] Jan 19, 2026
7628be9
codegen metadata
stainless-app[bot] Jan 20, 2026
085dcef
codegen metadata
stainless-app[bot] Jan 20, 2026
01a3da0
codegen metadata
stainless-app[bot] Jan 20, 2026
c3e9d75
codegen metadata
stainless-app[bot] Jan 20, 2026
eff0aed
codegen metadata
stainless-app[bot] Jan 20, 2026
19c551c
codegen metadata
stainless-app[bot] Jan 20, 2026
70607fc
codegen metadata
stainless-app[bot] Jan 20, 2026
713c5f0
codegen metadata
stainless-app[bot] Jan 20, 2026
dab31a4
codegen metadata
stainless-app[bot] Jan 20, 2026
8034a64
codegen metadata
stainless-app[bot] Jan 20, 2026
3902364
codegen metadata
stainless-app[bot] Jan 20, 2026
5daeb63
codegen metadata
stainless-app[bot] Jan 21, 2026
974c854
codegen metadata
stainless-app[bot] Jan 21, 2026
5895dcf
codegen metadata
stainless-app[bot] Jan 21, 2026
e225c64
codegen metadata
stainless-app[bot] Jan 21, 2026
7091da6
codegen metadata
stainless-app[bot] Jan 21, 2026
e5b1833
codegen metadata
stainless-app[bot] Jan 21, 2026
793cb8a
release: 0.9.0
stainless-app[bot] Jan 21, 2026
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/agentex-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/agentex-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down Expand Up @@ -81,7 +81,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/agentex-sdk-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install Rye
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: github.repository == 'scaleapi/scale-agentex-python' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Check release environment
run: |
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.8.2"
".": "0.9.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 35
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-43921054bad3c6969dc10f5899faa5924f3c029ccffb55965bbb6e7c9a0f22c6.yml
openapi_spec_hash: 17b74748a86bc159767dbb66ba46f54d
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-c9b5ca9e03141b62fa981944af1c880cd4562f0b697ed5f110c0e0e754f455ba.yml
openapi_spec_hash: 9ed347fceac28248d2a0acb49c4eb356
config_hash: 32eb65911c08ac84d117cecdf2759869
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 0.9.0 (2026-01-21)

Full Changelog: [v0.8.2...v0.9.0](https://github.com/scaleapi/scale-agentex-python/compare/v0.8.2...v0.9.0)

### Features

* **api:** api update ([33ade28](https://github.com/scaleapi/scale-agentex-python/commit/33ade2859c35413ecb4972a68a85cc0ef426e864))
* **client:** add support for binary request streaming ([07e2881](https://github.com/scaleapi/scale-agentex-python/commit/07e2881a23ad2c624306c8d10ab661ddef42deec))


### Chores

* **internal:** update `actions/checkout` version ([64d91f6](https://github.com/scaleapi/scale-agentex-python/commit/64d91f6984c577e0a8a1546bc0f96f944d343a7d))

## 0.8.2 (2026-01-02)

Full Changelog: [v0.8.1...v0.8.2](https://github.com/scaleapi/scale-agentex-python/compare/v0.8.1...v0.8.2)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "agentex-sdk"
version = "0.8.2"
version = "0.9.0"
description = "The official Python library for the agentex API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
145 changes: 134 additions & 11 deletions src/agentex/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import inspect
import logging
import platform
import warnings
import email.utils
from types import TracebackType
from random import random
Expand Down Expand Up @@ -51,9 +52,11 @@
ResponseT,
AnyMapping,
PostParser,
BinaryTypes,
RequestFiles,
HttpxSendArgs,
RequestOptions,
AsyncBinaryTypes,
HttpxRequestFiles,
ModelBuilderProtocol,
not_given,
Expand Down Expand Up @@ -477,8 +480,19 @@ def _build_request(
retries_taken: int = 0,
) -> httpx.Request:
if log.isEnabledFor(logging.DEBUG):
log.debug("Request options: %s", model_dump(options, exclude_unset=True))

log.debug(
"Request options: %s",
model_dump(
options,
exclude_unset=True,
# Pydantic v1 can't dump every type we support in content, so we exclude it for now.
exclude={
"content",
}
if PYDANTIC_V1
else {},
),
)
kwargs: dict[str, Any] = {}

json_data = options.json_data
Expand Down Expand Up @@ -532,7 +546,13 @@ def _build_request(
is_body_allowed = options.method.lower() != "get"

if is_body_allowed:
if isinstance(json_data, bytes):
if options.content is not None and json_data is not None:
raise TypeError("Passing both `content` and `json_data` is not supported")
if options.content is not None and files is not None:
raise TypeError("Passing both `content` and `files` is not supported")
if options.content is not None:
kwargs["content"] = options.content
elif isinstance(json_data, bytes):
kwargs["content"] = json_data
else:
kwargs["json"] = json_data if is_given(json_data) else None
Expand Down Expand Up @@ -1194,6 +1214,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: Literal[False] = False,
Expand All @@ -1206,6 +1227,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: Literal[True],
Expand All @@ -1219,6 +1241,7 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: bool,
Expand All @@ -1231,13 +1254,25 @@ def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
options: RequestOptions = {},
files: RequestFiles | None = None,
stream: bool = False,
stream_cls: type[_StreamT] | None = None,
) -> ResponseT | _StreamT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="post", url=path, json_data=body, files=to_httpx_files(files), **options
method="post", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))

Expand All @@ -1247,11 +1282,23 @@ def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=to_httpx_files(files), **options
method="patch", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)

Expand All @@ -1261,11 +1308,23 @@ def put(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="put", url=path, json_data=body, files=to_httpx_files(files), **options
method="put", url=path, json_data=body, content=content, files=to_httpx_files(files), **options
)
return self.request(cast_to, opts)

Expand All @@ -1275,9 +1334,19 @@ def delete(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: BinaryTypes | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
return self.request(cast_to, opts)

def get_api_list(
Expand Down Expand Up @@ -1717,6 +1786,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: Literal[False] = False,
Expand All @@ -1729,6 +1799,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: Literal[True],
Expand All @@ -1742,6 +1813,7 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: bool,
Expand All @@ -1754,13 +1826,25 @@ async def post(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
stream: bool = False,
stream_cls: type[_AsyncStreamT] | None = None,
) -> ResponseT | _AsyncStreamT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="post", url=path, json_data=body, files=await async_to_httpx_files(files), **options
method="post", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts, stream=stream, stream_cls=stream_cls)

Expand All @@ -1770,11 +1854,28 @@ async def patch(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="patch", url=path, json_data=body, files=await async_to_httpx_files(files), **options
method="patch",
url=path,
json_data=body,
content=content,
files=await async_to_httpx_files(files),
**options,
)
return await self.request(cast_to, opts)

Expand All @@ -1784,11 +1885,23 @@ async def put(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
files: RequestFiles | None = None,
options: RequestOptions = {},
) -> ResponseT:
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if files is not None and content is not None:
raise TypeError("Passing both `files` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(
method="put", url=path, json_data=body, files=await async_to_httpx_files(files), **options
method="put", url=path, json_data=body, content=content, files=await async_to_httpx_files(files), **options
)
return await self.request(cast_to, opts)

Expand All @@ -1798,9 +1911,19 @@ async def delete(
*,
cast_to: Type[ResponseT],
body: Body | None = None,
content: AsyncBinaryTypes | None = None,
options: RequestOptions = {},
) -> ResponseT:
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, **options)
if body is not None and content is not None:
raise TypeError("Passing both `body` and `content` is not supported")
if isinstance(body, bytes):
warnings.warn(
"Passing raw bytes as `body` is deprecated and will be removed in a future version. "
"Please pass raw bytes via the `content` parameter instead.",
DeprecationWarning,
stacklevel=2,
)
opts = FinalRequestOptions.construct(method="delete", url=path, json_data=body, content=content, **options)
return await self.request(cast_to, opts)

def get_api_list(
Expand Down
Loading