Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
345 commits
Select commit Hold shift + click to select a range
514b012
codegen metadata
stainless-app[bot] Jan 10, 2026
467bfc6
codegen metadata
stainless-app[bot] Jan 10, 2026
d2582de
codegen metadata
stainless-app[bot] Jan 10, 2026
62bcffb
codegen metadata
stainless-app[bot] Jan 10, 2026
7e6d9da
codegen metadata
stainless-app[bot] Jan 10, 2026
9579729
codegen metadata
stainless-app[bot] Jan 10, 2026
121024e
codegen metadata
stainless-app[bot] Jan 10, 2026
2d8210f
codegen metadata
stainless-app[bot] Jan 10, 2026
1482264
codegen metadata
stainless-app[bot] Jan 10, 2026
e7037be
codegen metadata
stainless-app[bot] Jan 10, 2026
ce3a1a6
codegen metadata
stainless-app[bot] Jan 10, 2026
380dd48
codegen metadata
stainless-app[bot] Jan 10, 2026
ed52274
codegen metadata
stainless-app[bot] Jan 10, 2026
526739d
codegen metadata
stainless-app[bot] Jan 11, 2026
77b5634
codegen metadata
stainless-app[bot] Jan 11, 2026
180e691
codegen metadata
stainless-app[bot] Jan 11, 2026
6867f09
codegen metadata
stainless-app[bot] Jan 11, 2026
3a7b418
codegen metadata
stainless-app[bot] Jan 11, 2026
79d35de
codegen metadata
stainless-app[bot] Jan 11, 2026
66c9427
codegen metadata
stainless-app[bot] Jan 11, 2026
1d063f8
codegen metadata
stainless-app[bot] Jan 11, 2026
5a8e4f9
codegen metadata
stainless-app[bot] Jan 11, 2026
a978829
codegen metadata
stainless-app[bot] Jan 11, 2026
48f4026
codegen metadata
stainless-app[bot] Jan 11, 2026
26d425f
codegen metadata
stainless-app[bot] Jan 11, 2026
cc03156
codegen metadata
stainless-app[bot] Jan 11, 2026
3f9ca5a
codegen metadata
stainless-app[bot] Jan 11, 2026
bbf19ad
codegen metadata
stainless-app[bot] Jan 11, 2026
15ffa1d
codegen metadata
stainless-app[bot] Jan 11, 2026
fe2f594
codegen metadata
stainless-app[bot] Jan 11, 2026
c6a815c
codegen metadata
stainless-app[bot] Jan 12, 2026
f462d75
codegen metadata
stainless-app[bot] Jan 12, 2026
c4e948a
codegen metadata
stainless-app[bot] Jan 12, 2026
727dc00
codegen metadata
stainless-app[bot] Jan 12, 2026
e837ed4
codegen metadata
stainless-app[bot] Jan 12, 2026
a852ca1
codegen metadata
stainless-app[bot] Jan 12, 2026
2d77cc2
codegen metadata
stainless-app[bot] Jan 12, 2026
beadfa3
codegen metadata
stainless-app[bot] Jan 12, 2026
f155e68
codegen metadata
stainless-app[bot] Jan 12, 2026
7cc223a
codegen metadata
stainless-app[bot] Jan 12, 2026
ac7433e
codegen metadata
stainless-app[bot] Jan 12, 2026
a91c3c3
codegen metadata
stainless-app[bot] Jan 12, 2026
c3d42e4
codegen metadata
stainless-app[bot] Jan 12, 2026
41ad636
codegen metadata
stainless-app[bot] Jan 12, 2026
061f366
codegen metadata
stainless-app[bot] Jan 12, 2026
8aa98fc
codegen metadata
stainless-app[bot] Jan 12, 2026
a28d96e
codegen metadata
stainless-app[bot] Jan 12, 2026
0b16f6f
codegen metadata
stainless-app[bot] Jan 12, 2026
2c0f5a3
codegen metadata
stainless-app[bot] Jan 12, 2026
a6a51b0
codegen metadata
stainless-app[bot] Jan 12, 2026
12bf5e9
codegen metadata
stainless-app[bot] Jan 13, 2026
b65bbad
codegen metadata
stainless-app[bot] Jan 13, 2026
803888b
codegen metadata
stainless-app[bot] Jan 13, 2026
4955ce9
codegen metadata
stainless-app[bot] Jan 13, 2026
5bf69d2
codegen metadata
stainless-app[bot] Jan 13, 2026
2b9aafe
codegen metadata
stainless-app[bot] Jan 13, 2026
734068b
codegen metadata
stainless-app[bot] Jan 13, 2026
cb692bf
codegen metadata
stainless-app[bot] Jan 13, 2026
b5f783f
codegen metadata
stainless-app[bot] Jan 13, 2026
f8567c5
codegen metadata
stainless-app[bot] Jan 13, 2026
6f64352
codegen metadata
stainless-app[bot] Jan 13, 2026
4a5476c
codegen metadata
stainless-app[bot] Jan 13, 2026
a4b6dc0
codegen metadata
stainless-app[bot] Jan 13, 2026
435aa0b
codegen metadata
stainless-app[bot] Jan 13, 2026
8136dbd
codegen metadata
stainless-app[bot] Jan 13, 2026
f738f64
codegen metadata
stainless-app[bot] Jan 13, 2026
c03f781
codegen metadata
stainless-app[bot] Jan 13, 2026
7b12968
codegen metadata
stainless-app[bot] Jan 13, 2026
c6da96d
codegen metadata
stainless-app[bot] Jan 13, 2026
ba2df0e
codegen metadata
stainless-app[bot] Jan 14, 2026
11e06c5
codegen metadata
stainless-app[bot] Jan 14, 2026
97ec6ff
feat(client): add support for binary request streaming
stainless-app[bot] Jan 14, 2026
a18a83f
codegen metadata
stainless-app[bot] Jan 14, 2026
f13829b
codegen metadata
stainless-app[bot] Jan 14, 2026
2c75ad2
codegen metadata
stainless-app[bot] Jan 14, 2026
f2f5199
codegen metadata
stainless-app[bot] Jan 14, 2026
3b9ba24
codegen metadata
stainless-app[bot] Jan 14, 2026
94be73b
codegen metadata
stainless-app[bot] Jan 14, 2026
29457b8
codegen metadata
stainless-app[bot] Jan 14, 2026
863a5ea
codegen metadata
stainless-app[bot] Jan 14, 2026
9062055
codegen metadata
stainless-app[bot] Jan 14, 2026
73d0439
codegen metadata
stainless-app[bot] Jan 14, 2026
3c5a225
codegen metadata
stainless-app[bot] Jan 14, 2026
f496c92
codegen metadata
stainless-app[bot] Jan 14, 2026
62d4346
codegen metadata
stainless-app[bot] Jan 14, 2026
6d6308d
codegen metadata
stainless-app[bot] Jan 14, 2026
334cc33
codegen metadata
stainless-app[bot] Jan 14, 2026
9be212c
codegen metadata
stainless-app[bot] Jan 15, 2026
51e4399
codegen metadata
stainless-app[bot] Jan 15, 2026
d92398f
codegen metadata
stainless-app[bot] Jan 15, 2026
5269bb4
codegen metadata
stainless-app[bot] Jan 15, 2026
5e641ec
codegen metadata
stainless-app[bot] Jan 15, 2026
f3612bc
codegen metadata
stainless-app[bot] Jan 15, 2026
8fcfb0e
codegen metadata
stainless-app[bot] Jan 15, 2026
90df7fe
codegen metadata
stainless-app[bot] Jan 15, 2026
39cdf64
codegen metadata
stainless-app[bot] Jan 15, 2026
e9b9afc
codegen metadata
stainless-app[bot] Jan 15, 2026
e01de54
codegen metadata
stainless-app[bot] Jan 15, 2026
92475bc
codegen metadata
stainless-app[bot] Jan 15, 2026
9fe2c4f
codegen metadata
stainless-app[bot] Jan 15, 2026
889a965
codegen metadata
stainless-app[bot] Jan 15, 2026
564eb3e
codegen metadata
stainless-app[bot] Jan 15, 2026
6a073bb
codegen metadata
stainless-app[bot] Jan 15, 2026
22bbc8c
codegen metadata
stainless-app[bot] Jan 15, 2026
0455dbf
codegen metadata
stainless-app[bot] Jan 15, 2026
336174f
codegen metadata
stainless-app[bot] Jan 15, 2026
1c9fe0c
codegen metadata
stainless-app[bot] Jan 16, 2026
095f6fc
codegen metadata
stainless-app[bot] Jan 16, 2026
fac0ac7
codegen metadata
stainless-app[bot] Jan 16, 2026
35b1e40
codegen metadata
stainless-app[bot] Jan 16, 2026
1790df4
codegen metadata
stainless-app[bot] Jan 16, 2026
52812d8
codegen metadata
stainless-app[bot] Jan 16, 2026
e425f85
codegen metadata
stainless-app[bot] Jan 16, 2026
4001156
codegen metadata
stainless-app[bot] Jan 16, 2026
126dff0
codegen metadata
stainless-app[bot] Jan 16, 2026
39da5b8
codegen metadata
stainless-app[bot] Jan 16, 2026
764e25d
codegen metadata
stainless-app[bot] Jan 16, 2026
14f330f
codegen metadata
stainless-app[bot] Jan 16, 2026
e258107
codegen metadata
stainless-app[bot] Jan 16, 2026
f831738
codegen metadata
stainless-app[bot] Jan 16, 2026
2163202
codegen metadata
stainless-app[bot] Jan 16, 2026
f6f64c3
codegen metadata
stainless-app[bot] Jan 16, 2026
a6c852c
codegen metadata
stainless-app[bot] Jan 16, 2026
35c9947
codegen metadata
stainless-app[bot] Jan 16, 2026
6e09ad6
codegen metadata
stainless-app[bot] Jan 16, 2026
9da9f16
codegen metadata
stainless-app[bot] Jan 16, 2026
7085a7d
codegen metadata
stainless-app[bot] Jan 17, 2026
ed731c7
codegen metadata
stainless-app[bot] Jan 17, 2026
b53f1ac
codegen metadata
stainless-app[bot] Jan 17, 2026
96165f1
chore(internal): update `actions/checkout` version
stainless-app[bot] Jan 17, 2026
4cf8634
codegen metadata
stainless-app[bot] Jan 17, 2026
a0aa98b
codegen metadata
stainless-app[bot] Jan 17, 2026
2f69919
codegen metadata
stainless-app[bot] Jan 17, 2026
fa59629
codegen metadata
stainless-app[bot] Jan 17, 2026
0a9f3a2
codegen metadata
stainless-app[bot] Jan 17, 2026
d1b0344
codegen metadata
stainless-app[bot] Jan 17, 2026
84af374
codegen metadata
stainless-app[bot] Jan 17, 2026
7f8dd3e
codegen metadata
stainless-app[bot] Jan 17, 2026
4dc07eb
codegen metadata
stainless-app[bot] Jan 17, 2026
685b832
codegen metadata
stainless-app[bot] Jan 17, 2026
3a1f7db
codegen metadata
stainless-app[bot] Jan 17, 2026
1e5534c
codegen metadata
stainless-app[bot] Jan 17, 2026
f7d4668
codegen metadata
stainless-app[bot] Jan 17, 2026
e4ada53
codegen metadata
stainless-app[bot] Jan 18, 2026
a78bdeb
codegen metadata
stainless-app[bot] Jan 18, 2026
f3f8852
codegen metadata
stainless-app[bot] Jan 18, 2026
6fc1e55
codegen metadata
stainless-app[bot] Jan 18, 2026
62c733e
codegen metadata
stainless-app[bot] Jan 18, 2026
b3bdde5
codegen metadata
stainless-app[bot] Jan 18, 2026
68f44ae
codegen metadata
stainless-app[bot] Jan 18, 2026
0f0c7b5
codegen metadata
stainless-app[bot] Jan 18, 2026
5d09394
codegen metadata
stainless-app[bot] Jan 18, 2026
b3cd144
codegen metadata
stainless-app[bot] Jan 18, 2026
1a1e461
codegen metadata
stainless-app[bot] Jan 18, 2026
c79eae8
codegen metadata
stainless-app[bot] Jan 18, 2026
b5e3f71
codegen metadata
stainless-app[bot] Jan 18, 2026
bb59f75
codegen metadata
stainless-app[bot] Jan 18, 2026
9cdcc7a
codegen metadata
stainless-app[bot] Jan 18, 2026
83aa033
codegen metadata
stainless-app[bot] Jan 18, 2026
f91bf8d
codegen metadata
stainless-app[bot] Jan 18, 2026
622971f
codegen metadata
stainless-app[bot] Jan 18, 2026
270c94c
codegen metadata
stainless-app[bot] Jan 18, 2026
7e1f0ff
codegen metadata
stainless-app[bot] Jan 18, 2026
6878a06
codegen metadata
stainless-app[bot] Jan 19, 2026
9b26b9d
codegen metadata
stainless-app[bot] Jan 19, 2026
11a8e1f
codegen metadata
stainless-app[bot] Jan 19, 2026
ab9da28
codegen metadata
stainless-app[bot] Jan 19, 2026
3b32b76
codegen metadata
stainless-app[bot] Jan 19, 2026
f17abb2
codegen metadata
stainless-app[bot] Jan 19, 2026
6e32fc1
codegen metadata
stainless-app[bot] Jan 19, 2026
8bd5e3d
codegen metadata
stainless-app[bot] Jan 19, 2026
b926151
codegen metadata
stainless-app[bot] Jan 19, 2026
e93ff80
codegen metadata
stainless-app[bot] Jan 19, 2026
fb2ac15
codegen metadata
stainless-app[bot] Jan 19, 2026
6769c5a
codegen metadata
stainless-app[bot] Jan 19, 2026
bab678a
codegen metadata
stainless-app[bot] Jan 19, 2026
c6128aa
codegen metadata
stainless-app[bot] Jan 19, 2026
403624e
codegen metadata
stainless-app[bot] Jan 19, 2026
0f7e48c
codegen metadata
stainless-app[bot] Jan 19, 2026
d559004
codegen metadata
stainless-app[bot] Jan 19, 2026
23ceb16
codegen metadata
stainless-app[bot] Jan 19, 2026
cf6e2f8
codegen metadata
stainless-app[bot] Jan 20, 2026
f1cd24d
codegen metadata
stainless-app[bot] Jan 20, 2026
080d773
codegen metadata
stainless-app[bot] Jan 20, 2026
1f4af65
codegen metadata
stainless-app[bot] Jan 20, 2026
df4299d
codegen metadata
stainless-app[bot] Jan 20, 2026
a0d6006
codegen metadata
stainless-app[bot] Jan 20, 2026
2999717
codegen metadata
stainless-app[bot] Jan 20, 2026
2e1c52b
codegen metadata
stainless-app[bot] Jan 20, 2026
0595c68
codegen metadata
stainless-app[bot] Jan 20, 2026
58d82d8
codegen metadata
stainless-app[bot] Jan 20, 2026
666aea1
codegen metadata
stainless-app[bot] Jan 20, 2026
454e083
codegen metadata
stainless-app[bot] Jan 20, 2026
f87f089
codegen metadata
stainless-app[bot] Jan 20, 2026
3e7d801
codegen metadata
stainless-app[bot] Jan 20, 2026
86cbdd9
codegen metadata
stainless-app[bot] Jan 20, 2026
36cc515
codegen metadata
stainless-app[bot] Jan 20, 2026
ebd0f02
codegen metadata
stainless-app[bot] Jan 20, 2026
238f2f9
codegen metadata
stainless-app[bot] Jan 20, 2026
06ed02f
codegen metadata
stainless-app[bot] Jan 20, 2026
4025da5
codegen metadata
stainless-app[bot] Jan 20, 2026
70b9c33
codegen metadata
stainless-app[bot] Jan 21, 2026
dcfdfd2
codegen metadata
stainless-app[bot] Jan 21, 2026
493fb93
codegen metadata
stainless-app[bot] Jan 21, 2026
39ea443
codegen metadata
stainless-app[bot] Jan 21, 2026
1c9e60d
codegen metadata
stainless-app[bot] Jan 21, 2026
a2e588d
codegen metadata
stainless-app[bot] Jan 21, 2026
514e04e
codegen metadata
stainless-app[bot] Jan 21, 2026
e9364ad
codegen metadata
stainless-app[bot] Jan 21, 2026
fdc868c
codegen metadata
stainless-app[bot] Jan 21, 2026
db2e4db
codegen metadata
stainless-app[bot] Jan 21, 2026
788c09c
codegen metadata
stainless-app[bot] Jan 21, 2026
8bbde74
codegen metadata
stainless-app[bot] Jan 21, 2026
61a2572
codegen metadata
stainless-app[bot] Jan 21, 2026
29269b9
codegen metadata
stainless-app[bot] Jan 21, 2026
fcba873
codegen metadata
stainless-app[bot] Jan 21, 2026
109b053
codegen metadata
stainless-app[bot] Jan 21, 2026
0bd3f89
codegen metadata
stainless-app[bot] Jan 21, 2026
a5ceb22
codegen metadata
stainless-app[bot] Jan 21, 2026
1ffad25
codegen metadata
stainless-app[bot] Jan 21, 2026
c958b9c
codegen metadata
stainless-app[bot] Jan 21, 2026
0f8cb43
codegen metadata
stainless-app[bot] Jan 21, 2026
2d48507
codegen metadata
stainless-app[bot] Jan 22, 2026
358ab97
codegen metadata
stainless-app[bot] Jan 22, 2026
2193ea4
codegen metadata
stainless-app[bot] Jan 22, 2026
ae6e867
codegen metadata
stainless-app[bot] Jan 22, 2026
9822375
codegen metadata
stainless-app[bot] Jan 22, 2026
dda97ca
codegen metadata
stainless-app[bot] Jan 22, 2026
e2749bc
codegen metadata
stainless-app[bot] Jan 22, 2026
cba5653
codegen metadata
stainless-app[bot] Jan 22, 2026
91f773b
codegen metadata
stainless-app[bot] Jan 22, 2026
2aee3c3
codegen metadata
stainless-app[bot] Jan 22, 2026
1929ac7
codegen metadata
stainless-app[bot] Jan 22, 2026
6ea8ee5
codegen metadata
stainless-app[bot] Jan 22, 2026
faaa773
codegen metadata
stainless-app[bot] Jan 22, 2026
2fa66a0
codegen metadata
stainless-app[bot] Jan 22, 2026
a560d1f
codegen metadata
stainless-app[bot] Jan 22, 2026
2912d14
codegen metadata
stainless-app[bot] Jan 22, 2026
9faef8a
codegen metadata
stainless-app[bot] Jan 22, 2026
8b43cf6
codegen metadata
stainless-app[bot] Jan 22, 2026
6518cc9
codegen metadata
stainless-app[bot] Jan 23, 2026
1474e6d
codegen metadata
stainless-app[bot] Jan 23, 2026
340f387
codegen metadata
stainless-app[bot] Jan 23, 2026
f75d5de
codegen metadata
stainless-app[bot] Jan 23, 2026
496d4d6
codegen metadata
stainless-app[bot] Jan 23, 2026
ff7edf0
codegen metadata
stainless-app[bot] Jan 23, 2026
b840a27
codegen metadata
stainless-app[bot] Jan 23, 2026
aea7be8
codegen metadata
stainless-app[bot] Jan 23, 2026
3060f5f
codegen metadata
stainless-app[bot] Jan 23, 2026
705a972
release: 0.3.0
stainless-app[bot] Jan 23, 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/tembo-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 uv
uses: astral-sh/setup-uv@v5
Expand All @@ -41,7 +41,7 @@ jobs:
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/tembo-python' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v5
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ${{ github.repository == 'stainless-sdks/tembo-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 uv
uses: astral-sh/setup-uv@v5
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 uv
uses: astral-sh/setup-uv@v5
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 == 'tembo/sdk-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.2.0"
".": "0.3.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: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/tembo%2Ftembo-5fe090391ca60fa921541fe6f752600aa007cc5792e11f72d9ddd826d3fa1c6d.yml
openapi_spec_hash: 6ed695478549a2d1ef66fa823ab7b827
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/tembo%2Ftembo-7a9f588eda3fb5a5b907f0c746e91e91c9b28d8f4e8e43122eb0547c8dff31ec.yml
openapi_spec_hash: f893892afa8f9fbbcbb2c87c16be8a91
config_hash: 8fba1d45a848bce88e9564ab8a960838
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 0.3.0 (2026-01-23)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/tembo/sdk-python/compare/v0.2.0...v0.3.0)

### Features

* **client:** add support for binary request streaming ([97ec6ff](https://github.com/tembo/sdk-python/commit/97ec6ffe558fcb1613868eeb5a1cc9c64512bc1e))


### Chores

* **internal:** update `actions/checkout` version ([96165f1](https://github.com/tembo/sdk-python/commit/96165f105b776eee8766902718f977055eccf2be))

## 0.2.0 (2026-01-05)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/tembo/sdk-python/compare/v0.1.0...v0.2.0)
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 = "tembo-sdk-python"
version = "0.2.0"
version = "0.3.0"
description = "The official Python library for the tembo API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
145 changes: 134 additions & 11 deletions src/tembo/_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