Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
555 commits
Select commit Hold shift + click to select a range
972df43
chore(internal): minor formatting
stainless-app[bot] Jun 16, 2025
7055941
chore(ci): enable for pull requests
stainless-app[bot] Jun 17, 2025
415d96b
chore(internal): version bump
stainless-app[bot] Jun 17, 2025
9bf3b76
chore(readme): update badges
stainless-app[bot] Jun 17, 2025
efdb595
chore(types): remove incorrect __test__ annotation
stainless-app[bot] Jun 17, 2025
b575834
fix(tests): fix: tests which call HTTP endpoints directly with the ex…
stainless-app[bot] Jun 17, 2025
7b9e914
docs(client): fix httpx.Timeout documentation reference
stainless-app[bot] Jun 18, 2025
d7700af
feat(client): add support for aiohttp
stainless-app[bot] Jun 20, 2025
27c0929
chore(internal): version bump
stainless-app[bot] Jun 20, 2025
e541f8f
feat(api): make model and inputs not required to create response
stainless-app[bot] Jun 20, 2025
f7eb41d
chore(internal): version bump
stainless-app[bot] Jun 20, 2025
8707913
feat(api): update api shapes for usage and code interpreter
stainless-app[bot] Jun 23, 2025
b533e91
chore(internal): version bump
stainless-app[bot] Jun 23, 2025
2cbcb85
chore(tests): skip some failing tests on the latest python versions
stainless-app[bot] Jun 23, 2025
0855d73
chore(internal): add tests for breaking change detection
stainless-app[bot] Jun 24, 2025
f43c7b5
fix(ci): release-doctor — report correct token name
stainless-app[bot] Jun 26, 2025
2c404fc
feat(api): webhook and deep research support
stainless-app[bot] Jun 26, 2025
49679a4
chore(internal): version bump
stainless-app[bot] Jun 26, 2025
1d38a00
chore(internal): version bump
stainless-app[bot] Jun 26, 2025
43890e1
chore(api): remove unsupported property
stainless-app[bot] Jun 26, 2025
0077877
chore(internal): version bump
stainless-app[bot] Jun 26, 2025
fb0a397
codegen metadata
stainless-app[bot] Jun 27, 2025
d5e7027
chore(internal): version bump
stainless-app[bot] Jun 27, 2025
3cf7aca
codegen metadata
stainless-app[bot] Jun 27, 2025
82ec59c
chore(internal): codegen related update
stainless-app[bot] Jun 27, 2025
b5d50c7
chore(ci): only run for pushes and fork pull requests
stainless-app[bot] Jun 27, 2025
9e54b45
fix(ci): correct conditional
stainless-app[bot] Jun 29, 2025
da8817d
chore(ci): change upload type
stainless-app[bot] Jul 1, 2025
c96d9f0
chore(internal): codegen related update
stainless-app[bot] Jul 7, 2025
e9650c3
chore(internal): version bump
stainless-app[bot] Jul 7, 2025
2b92213
chore(internal): bump pinned h11 dep
stainless-app[bot] Jul 8, 2025
bcc7ed6
chore(package): mark python 3.13 as supported
stainless-app[bot] Jul 8, 2025
8d399bc
chore(internal): version bump
stainless-app[bot] Jul 8, 2025
7716e41
fix(parsing): correctly handle nested discriminated unions
stainless-app[bot] Jul 9, 2025
04e67a3
chore(internal): version bump
stainless-app[bot] Jul 9, 2025
b037335
chore(internal): version bump
stainless-app[bot] Jul 10, 2025
7ea31f4
chore(readme): fix version rendering on pypi
stainless-app[bot] Jul 10, 2025
49d4987
feat(api): add file_url, fix event ID
stainless-app[bot] Jul 10, 2025
4649363
chore(internal): version bump
stainless-app[bot] Jul 10, 2025
322f791
fix(client): don't send Content-Type header on GET requests
stainless-app[bot] Jul 11, 2025
8f3d181
codegen metadata
stainless-app[bot] Jul 11, 2025
770827f
codegen metadata
stainless-app[bot] Jul 11, 2025
a9fa5a7
codegen metadata
stainless-app[bot] Jul 11, 2025
1fe6bb6
chore(internal): version bump
stainless-app[bot] Jul 11, 2025
6654122
feat: clean up environment call outs
stainless-app[bot] Jul 14, 2025
b5cbf54
codegen metadata
stainless-app[bot] Jul 15, 2025
a2deead
chore(api): update realtime specs, build config
stainless-app[bot] Jul 15, 2025
cdb000d
chore(internal): version bump
stainless-app[bot] Jul 15, 2025
05f91a3
codegen metadata
stainless-app[bot] Jul 15, 2025
2cd5f11
chore(api): update realtime specs
stainless-app[bot] Jul 15, 2025
ff824d2
chore(internal): version bump
stainless-app[bot] Jul 15, 2025
0455cef
feat(api): manual updates
stainless-app[bot] Jul 16, 2025
97f7a26
chore(internal): version bump
stainless-app[bot] Jul 16, 2025
c0cb707
codegen metadata
stainless-app[bot] Jul 16, 2025
44c4305
fix(parsing): ignore empty metadata
stainless-app[bot] Jul 21, 2025
e150dc4
chore(api): event shapes more accurate
stainless-app[bot] Jul 21, 2025
b1124a6
fix(parsing): parse extra field types
stainless-app[bot] Jul 22, 2025
0a056ae
chore(internal): version bump
stainless-app[bot] Jul 22, 2025
6f3da58
chore(project): add settings file for vscode
stainless-app[bot] Jul 24, 2025
f8b3c7a
chore(internal): version bump
stainless-app[bot] Jul 30, 2025
d51d5ec
feat(api): manual updates
stainless-app[bot] Jul 30, 2025
d08b027
chore(internal): version bump
stainless-app[bot] Jul 30, 2025
f3a89aa
feat(client): support file upload requests
stainless-app[bot] Jul 30, 2025
e01d394
chore(internal): fix ruff target version
stainless-app[bot] Aug 5, 2025
8ff7a62
feat(api): manual updates
stainless-app[bot] Aug 5, 2025
d642c6a
chore(internal): version bump
stainless-app[bot] Aug 5, 2025
7b9099d
chore(internal): version bump
stainless-app[bot] Aug 5, 2025
228a715
feat(api): adds GPT-5 and new API features: platform.openai.com/docs/…
stainless-app[bot] Aug 7, 2025
43b6f02
chore(internal): version bump
stainless-app[bot] Aug 7, 2025
55a2d4c
codegen metadata
stainless-app[bot] Aug 7, 2025
797c90c
chore(internal): version bump
stainless-app[bot] Aug 7, 2025
dbabb5f
codegen metadata
stainless-app[bot] Aug 7, 2025
fb78251
codegen metadata
stainless-app[bot] Aug 7, 2025
55b8103
fix(types): rename chat completion tool
stainless-app[bot] Aug 8, 2025
c7bd838
chore(internal): version bump
stainless-app[bot] Aug 8, 2025
0203151
fix(client): fix verbosity parameter location in Responses
stainless-app[bot] Aug 8, 2025
b3b1a35
chore(internal): version bump
stainless-app[bot] Aug 8, 2025
4938eed
chore: update @stainless-api/prism-cli to v5.15.0
stainless-app[bot] Aug 8, 2025
09d2c78
chore(internal): update comment in script
stainless-app[bot] Aug 8, 2025
2ec816c
chore(internal): version bump
stainless-app[bot] Aug 9, 2025
7b26f6e
fix(types): rename ChatCompletionMessageToolCallParam
stainless-app[bot] Aug 11, 2025
54c6ddc
chore(internal): version bump
stainless-app[bot] Aug 11, 2025
aa7ac3f
chore(internal): version bump
stainless-app[bot] Aug 11, 2025
54ba661
chore(internal): version bump
stainless-app[bot] Aug 12, 2025
f761290
feat(api): add new text parameters, expiration options
stainless-app[bot] Aug 15, 2025
1a6571d
chore(internal): version bump
stainless-app[bot] Aug 18, 2025
bcb895c
chore(internal): version bump
stainless-app[bot] Aug 18, 2025
5dfbb4a
chore(api): accurately represent shape for verbosity on Chat Completions
stainless-app[bot] Aug 19, 2025
ff18bfe
chore(internal): version bump
stainless-app[bot] Aug 19, 2025
efaf87f
chore: no-op
stainless-app[bot] Aug 19, 2025
de59e31
chore(internal/ci): setup breaking change detection
stainless-app[bot] Aug 19, 2025
bf5c699
chore(internal): version bump
stainless-app[bot] Aug 20, 2025
5741416
feat(api): adding support for /v1/conversations to the API
stainless-app[bot] Aug 21, 2025
b57196a
chore: update github action
stainless-app[bot] Aug 21, 2025
e306e52
feat(api): Add connectors support for MCP tool
stainless-app[bot] Aug 21, 2025
f43cda8
chore(internal): version bump
stainless-app[bot] Aug 21, 2025
8b05902
chore(internal): change ci workflow machines
stainless-app[bot] Aug 25, 2025
ff3ffbb
chore(internal): codegen related update
stainless-app[bot] Aug 26, 2025
3a0337b
fix: avoid newer type syntax
stainless-app[bot] Aug 26, 2025
a1d0afa
feat(api): add web search filters
stainless-app[bot] Aug 26, 2025
afdc410
chore(internal): version bump
stainless-app[bot] Aug 26, 2025
4cca524
chore(internal): update pyright exclude list
stainless-app[bot] Aug 26, 2025
dc6a791
chore(internal): minor formatting change
stainless-app[bot] Aug 27, 2025
4e45031
chore(internal): add Sequence related utils
stainless-app[bot] Aug 29, 2025
49e9a08
feat(api): realtime API updates
stainless-app[bot] Sep 2, 2025
ef6cea1
chore(internal): version bump
stainless-app[bot] Sep 2, 2025
a6536d6
feat(types): replace List[str] with SequenceNotStr in params
stainless-app[bot] Sep 2, 2025
52fd627
chore(internal): version bump
stainless-app[bot] Sep 2, 2025
2493824
chore(api): manual updates for ResponseInputAudio
stainless-app[bot] Sep 2, 2025
f1eadae
chore(internal): version bump
stainless-app[bot] Sep 2, 2025
75354f3
chore(internal): version bump
stainless-app[bot] Sep 2, 2025
56e5a30
feat(api): Add gpt-realtime models
stainless-app[bot] Sep 3, 2025
1d2180c
chore(internal): version bump
stainless-app[bot] Sep 3, 2025
aabe856
feat: improve future compat with pydantic v3
stainless-app[bot] Sep 3, 2025
e965504
chore(internal): version bump
stainless-app[bot] Sep 4, 2025
e6e5e59
chore(internal): move mypy configurations to `pyproject.toml` file
stainless-app[bot] Sep 4, 2025
84c23ec
chore(internal): version bump
stainless-app[bot] Sep 4, 2025
94b3989
chore(internal): codegen related update
stainless-app[bot] Sep 5, 2025
b78a873
feat(api): ship the RealtimeGA API shape
stainless-app[bot] Sep 8, 2025
9b66a34
chore(internal): version bump
stainless-app[bot] Sep 8, 2025
639a9f5
chore(api): fix realtime GA types
stainless-app[bot] Sep 10, 2025
077155d
chore(internal): version bump
stainless-app[bot] Sep 10, 2025
63a01ff
chore(api): Minor docs and type updates for realtime
stainless-app[bot] Sep 11, 2025
cea5862
codegen metadata
stainless-app[bot] Sep 11, 2025
7edfc9e
chore(tests): simplify `get_platform` test
stainless-app[bot] Sep 11, 2025
6ef83c6
chore(internal): version bump
stainless-app[bot] Sep 12, 2025
273b0dd
chore(api): docs and spec refactoring
stainless-app[bot] Sep 15, 2025
bb540d7
chore(internal): version bump
stainless-app[bot] Sep 15, 2025
8d0818c
chore(internal): update pydantic dependency
stainless-app[bot] Sep 16, 2025
56c0e10
feat(api): type updates for conversations, reasoning_effort and resul…
stainless-app[bot] Sep 17, 2025
a760553
chore(internal): version bump
stainless-app[bot] Sep 17, 2025
3dabfac
chore(types): change optional parameter type from NotGiven to Omit
stainless-app[bot] Sep 18, 2025
5824606
feat(api): add reasoning_text
stainless-app[bot] Sep 19, 2025
7d3158a
chore(internal): version bump
stainless-app[bot] Sep 19, 2025
e70ae11
chore: do not install brew dependencies in ./scripts/bootstrap by def…
stainless-app[bot] Sep 19, 2025
19a9d83
fix(api): fix mcp tool name
stainless-app[bot] Sep 21, 2025
36dfd11
chore: improve example values
stainless-app[bot] Sep 22, 2025
a267f9e
chore(api): openapi updates for conversations
stainless-app[bot] Sep 22, 2025
d22082a
chore(internal): version bump
stainless-app[bot] Sep 22, 2025
65e9b58
feat(api): gpt-5-codex
stainless-app[bot] Sep 23, 2025
95dd13e
chore(internal): version bump
stainless-app[bot] Sep 23, 2025
4cb8bcb
fix(compat): compat with `pydantic<2.8.0` when using additional fields
stainless-app[bot] Sep 24, 2025
b2a4ea9
chore(internal): version bump
stainless-app[bot] Sep 24, 2025
ad807bd
feat(api): Support images and files for function call outputs in resp…
stainless-app[bot] Sep 30, 2025
091860e
chore(internal): version bump
stainless-app[bot] Sep 30, 2025
d9b14f1
fix(api): add status, approval_request_id to MCP tool call
stainless-app[bot] Oct 1, 2025
5dcf1b1
chore(internal): version bump
stainless-app[bot] Oct 1, 2025
fd5d95a
feat(api): add support for realtime calls
stainless-app[bot] Oct 2, 2025
33a8ae2
chore(internal): version bump
stainless-app[bot] Oct 2, 2025
359d715
feat(api): dev day 2025 launches
stainless-app[bot] Oct 6, 2025
ebcc6cc
chore(internal): version bump
stainless-app[bot] Oct 6, 2025
6a0cbb9
feat(api): comparison filter in/not in
stainless-app[bot] Oct 10, 2025
77a9112
chore(internal): version bump
stainless-app[bot] Oct 10, 2025
fc8bce9
chore(internal): detect missing future annotations with ruff
stainless-app[bot] Oct 10, 2025
99eeef0
codegen metadata
stainless-app[bot] Oct 15, 2025
a374bab
codegen metadata
stainless-app[bot] Oct 16, 2025
70001dc
feat(api): Add support for gpt-4o-transcribe-diarize on audio/transcr…
stainless-app[bot] Oct 16, 2025
7efc38c
chore(internal): version bump
stainless-app[bot] Oct 16, 2025
e346f1d
chore: bump `httpx-aiohttp` version to 0.1.9
stainless-app[bot] Oct 17, 2025
7d5b73e
feat(api): api update
stainless-app[bot] Oct 17, 2025
3014099
codegen metadata
stainless-app[bot] Oct 17, 2025
e8c792e
codegen metadata
stainless-app[bot] Oct 17, 2025
1dee3ab
chore(internal): version bump
stainless-app[bot] Oct 17, 2025
5e7a7a3
fix(api): internal openapi updates
stainless-app[bot] Oct 17, 2025
6d1cda4
feat(api): Add responses.input_tokens.count
stainless-app[bot] Oct 20, 2025
0027fba
chore(internal): version bump
stainless-app[bot] Oct 20, 2025
9ef2186
codegen metadata
stainless-app[bot] Oct 20, 2025
02536f6
fix(api): docs updates
stainless-app[bot] Oct 21, 2025
f25f664
chore(internal): version bump
stainless-app[bot] Oct 24, 2025
46721c6
feat(api): remove InputAudio from ResponseInputContent
stainless-app[bot] Oct 28, 2025
f9f9511
fix(client): close streams without requiring full consumption
stainless-app[bot] Oct 29, 2025
d63c8bb
chore(internal/tests): avoid race condition with implicit client cleanup
stainless-app[bot] Oct 30, 2025
85c0124
chore(internal): grammar fix (it's -> its)
stainless-app[bot] Nov 3, 2025
1ef300f
feat(api): Realtime API token_limits, Hybrid searching ranking options
stainless-app[bot] Nov 3, 2025
eb5c843
chore(internal): version bump
stainless-app[bot] Nov 3, 2025
0af7065
fix(api): fix nullability of logprobs
stainless-app[bot] Nov 4, 2025
83a089a
chore(internal): version bump
stainless-app[bot] Nov 4, 2025
44d0859
chore(package): drop Python 3.8 support
stainless-app[bot] Nov 10, 2025
05dd7cc
fix: compat with Python 3.14
stainless-app[bot] Nov 10, 2025
e96e3b0
chore(internal): version bump
stainless-app[bot] Nov 10, 2025
d113481
fix(compat): update signatures of `model_dump` and `model_dump_json` …
stainless-app[bot] Nov 11, 2025
0be5e12
codegen metadata
stainless-app[bot] Nov 12, 2025
c5481ef
feat(api): gpt 5.1
stainless-app[bot] Nov 13, 2025
29e821e
chore(internal): version bump
stainless-app[bot] Nov 13, 2025
2197000
fix(api): align types of input items / output items for typescript
stainless-app[bot] Nov 17, 2025
5ed04b2
chore(internal): version bump
stainless-app[bot] Nov 17, 2025
959ad1d
chore(internal): codegen related update
stainless-app[bot] Nov 21, 2025
2c1655b
fix: ensure streams are always closed
stainless-app[bot] Nov 27, 2025
6ef7498
chore(deps): mypy 1.18.1 has a regression, pin to 1.17
stainless-app[bot] Nov 27, 2025
76668d9
chore: update lockfile
stainless-app[bot] Dec 2, 2025
5277a33
chore(docs): use environment variables for authentication in code sni…
stainless-app[bot] Dec 2, 2025
75d18fe
feat(api): gpt-5.1-codex-max and responses/compact
stainless-app[bot] Dec 4, 2025
b647ca1
chore(internal): version bump
stainless-app[bot] Dec 4, 2025
e1d04fd
chore(internal): update docstring
stainless-app[bot] Dec 5, 2025
33a9a6b
fix(types): allow pyright to infer TypedDict types within SequenceNotStr
stainless-app[bot] Dec 8, 2025
eba4c1a
chore: add missing docstrings
stainless-app[bot] Dec 8, 2025
f190bd1
feat(api): make model required for the responses/compact endpoint
stainless-app[bot] Dec 8, 2025
2d08eca
chore(internal): version bump
stainless-app[bot] Dec 10, 2025
ec3a39a
feat(api): gpt 5.2
stainless-app[bot] Dec 11, 2025
27a90a2
chore(internal): version bump
stainless-app[bot] Dec 11, 2025
a18b354
feat(api): api update
stainless-app[bot] Dec 13, 2025
6549e08
feat(api): fix grader input list, add dated slugs for sora-2
stainless-app[bot] Dec 13, 2025
bc6458b
chore(internal): version bump
stainless-app[bot] Dec 15, 2025
1cccb17
codegen metadata
stainless-app[bot] Dec 15, 2025
bedaecd
chore(internal): add missing files argument to base client
stainless-app[bot] Dec 15, 2025
3553b29
feat(api): gpt-image-1.5
stainless-app[bot] Dec 16, 2025
07ee89e
chore(internal): version bump
stainless-app[bot] Dec 16, 2025
50ab444
codegen metadata
stainless-app[bot] Dec 16, 2025
b019927
fix: use async_to_httpx_files in patch method
stainless-app[bot] Dec 17, 2025
90f98a8
feat(api): slugs for new audio models; make all `model` params accept…
stainless-app[bot] Dec 18, 2025
94a13ef
chore(internal): add `--fix` argument to lint script
stainless-app[bot] Dec 18, 2025
82e226e
codegen metadata
stainless-app[bot] Dec 19, 2025
c87b876
chore(internal): version bump
stainless-app[bot] Dec 19, 2025
aecd5a9
chore(internal): codegen related update
stainless-app[bot] Jan 5, 2026
6295144
feat(api): add new Response completed_at prop
stainless-app[bot] Jan 9, 2026
58741b2
chore(internal): version bump
stainless-app[bot] Jan 9, 2026
afc1a6c
feat(client): add support for binary request streaming
stainless-app[bot] Jan 13, 2026
5af94ba
chore(internal): update `actions/checkout` version
stainless-app[bot] Jan 16, 2026
3c93894
feat(api): api update
stainless-app[bot] Jan 19, 2026
a092d58
codegen metadata
stainless-app[bot] Jan 22, 2026
12b496a
chore(ci): upgrade `actions/github-script`
stainless-app[bot] Jan 23, 2026
c4f76b2
fix(api): mark assistants as deprecated
stainless-app[bot] Jan 23, 2026
3694a46
feat(api): api updates
stainless-app[bot] Jan 27, 2026
9b20d7f
chore(internal): version bump
stainless-app[bot] Jan 27, 2026
7413485
feat(api): add shell_call_output status field
stainless-app[bot] Jan 28, 2026
986cf1a
codegen metadata
stainless-app[bot] Jan 28, 2026
43db42c
codegen metadata
stainless-app[bot] Jan 29, 2026
b270e90
feat(client): add custom JSON encoder for extended type support
stainless-app[bot] Jan 29, 2026
44bba8d
feat(api): image generation actions for responses; ResponseFunctionCa…
stainless-app[bot] Jan 30, 2026
67c58af
fix(client): update type for `find_in_page` action
stainless-app[bot] Feb 2, 2026
88c30be
codegen metadata
stainless-app[bot] Feb 3, 2026
1b3a161
chore(ci): add missing environment
stainless-app[bot] Feb 3, 2026
6cd1d0c
codegen metadata
stainless-app[bot] Feb 3, 2026
098a882
chore(internal): version bump
stainless-app[bot] Feb 5, 2026
ab8db4b
codegen metadata
stainless-app[bot] Feb 6, 2026
4d494ee
feat(api): add context_management to responses
stainless-app[bot] Feb 8, 2026
7cfdc8b
feat(api): responses context_management
stainless-app[bot] Feb 8, 2026
668a7f9
chore(internal): bump dependencies
stainless-app[bot] Feb 9, 2026
2ef5f59
chore(internal): version bump
stainless-app[bot] Feb 9, 2026
9c34094
feat(api): skills and hosted shell
stainless-app[bot] Feb 10, 2026
a524813
chore(internal): version bump
stainless-app[bot] Feb 10, 2026
1dce545
feat(api): support for images in batch api
stainless-app[bot] Feb 10, 2026
a4ece3b
chore(internal): version bump
stainless-app[bot] Feb 10, 2026
7b5ac0c
docs: update comment
stainless-app[bot] Feb 11, 2026
6b29cfb
chore(internal): fix lint error on Python 3.14
stainless-app[bot] Feb 11, 2026
731fdc1
codegen metadata
stainless-app[bot] Feb 11, 2026
d485c60
codegen metadata
stainless-app[bot] Feb 11, 2026
e08e049
docs: split `api.md` by standalone resources
stainless-app[bot] Feb 12, 2026
1c86048
feat(api): container network_policy and skills
stainless-app[bot] Feb 13, 2026
4304dbc
Checkpoint from VS Code for cloud agent session
ambervic2020-ux Feb 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 2 additions & 2 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye-up.com/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.44.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
RUN echo "[[ -d .venv ]] && source .venv/bin/activate || export PATH=\$PATH" >> /home/vscode/.bashrc
3 changes: 3 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
}
}
}
},
"features": {
"ghcr.io/devcontainers/features/node:1": {}
}

// Features to add to the dev container. More info: https://containers.dev/features.
Expand Down
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# This file is used to automatically assign reviewers to PRs
# For more information see: https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners

* @openai/sdks-team
64 changes: 0 additions & 64 deletions .github/ISSUE_TEMPLATE/bug_report.yml

This file was deleted.

7 changes: 0 additions & 7 deletions .github/ISSUE_TEMPLATE/config.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .github/ISSUE_TEMPLATE/feature_request.yml

This file was deleted.

147 changes: 147 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
# OpenAI Python SDK - AI Coding Agent Instructions

## Architecture Overview

This is the official OpenAI Python SDK, generated from OpenAPI specs via [Stainless](https://github.com/stainless-ai/sdk-generator). The codebase has three layers:

1. **Client Layer** (`_client.py`): `OpenAI` and `AsyncOpenAI` classes expose API resources and HTTP methods (`get`, `post`, etc.)
2. **Resource Layer** (`resources/`): Domain-specific classes (e.g., `Batches`, `Chat`, `Embeddings`) inherit from `SyncAPIResource` or `AsyncAPIResource`
3. **Type Layer** (`types/`): Generated Pydantic models for request/response schemas and per-resource params

### Key Insight: Generated vs Manual Code
- Most SDK files are **generated and will be overwritten** by the Stainless generator
- Safe-to-edit directories: `src/openai/lib/`, `examples/`, `tests/`
- Manual patches: Persist between generations but may cause merge conflicts
- See [CONTRIBUTING.md](../CONTRIBUTING.md) for generator details

## Critical Files & Patterns

### Resource Pattern
Every API endpoint follows this pattern:

```python
# src/openai/resources/batches.py
class Batches(SyncAPIResource):
def create(self, *, param1: str, extra_headers: Headers | None = None) -> Batch:
return self._post("/v1/batches", body=maybe_transform(...), cast_to=Batch)

class AsyncBatches(AsyncAPIResource):
async def create(self, ...) -> Batch:
return await self._post(...)
```

- Both sync and async versions required
- Use `self._post()`, `self._get()`, etc. (inherited from `SyncAPIResource`/`AsyncAPIResource`)
- Transform params via `maybe_transform()` / `async_maybe_transform()`
- Cast responses using `cast_to=` parameter

### Response Types
- Raw response: `APIResponse[T]` with `.parse()` method
- Streaming: `Stream[T]` / `AsyncStream[T]` for server-sent events
- Use `.with_raw_response` property to access raw HTTP data (headers, status)
- Use `.with_streaming_response` for non-eager body reads

### Type System
- Request params live in `types/*_params.py` files (e.g., `batch_create_params.py`)
- Response types in `types/*.py` (e.g., `batch.py` → `Batch` class)
- All models inherit from `BaseModel` (Pydantic v1/v2 compatible via `_models.py`)
- Use `Omit`, `NOT_GIVEN` for optional-but-not-provided distinction
- Type unions: `str | Literal["custom"]` for constrained values

## Development Workflow

### Setup Environment
```bash
# With Rye (preferred)
./scripts/bootstrap # Auto-provisions Python + venv
rye sync --all-features # Install dependencies

# Without Rye
pip install -r requirements-dev.lock
```

### Running Tests
```bash
# Requires Prism mock server
npx prism mock openapi.yml &
./scripts/test # Runs pytest with respx mocking
# Or test against custom endpoint
TEST_API_BASE_URL=https://api.example.com ./scripts/test
```

### Linting & Formatting
```bash
rye run format # Ruff + docs formatting
rye run lint # Type checking (Pyright/mypy) + lints
./scripts/lint --fix
```

### Adding Examples
Non-generated, always safe to edit:
```bash
chmod +x examples/my_example.py
./examples/my_example.py # Runs directly with rye shebang
```

## Testing Patterns

Located in `tests/` and `tests/api_resources/`:

- **Fixtures** (`conftest.py`): `client` (sync) and `async_client` (session-scoped)
- **Response Mocking**: Uses `respx_mock` to mock HTTP responses
- **Strict Validation**: `_strict_response_validation=True` flag validates responses match schemas
- **Test Organization**: Mirror resource structure (e.g., `test_api_resources/test_chat.py` tests `resources/chat/`)

Example test pattern:
```python
def test_create_batch(client: OpenAI) -> None:
batch = client.batches.create(
endpoint="/v1/chat/completions",
input_file_id="file_xyz",
completion_window="24h"
)
assert isinstance(batch, Batch)
```

## Common Development Tasks

### Adding a New Resource Endpoint
1. Create `resources/my_resource.py` with `MyResource(SyncAPIResource)` and `AsyncMyResource(AsyncAPIResource)`
2. Add type definitions in `types/my_resource.py` and `types/my_resource_params.py`
3. Update `_client.py` to expose resource: `self.my_resource = MyResource(self)`
4. Export in `__init__.py`
5. Add tests mirroring the structure

### Fixing Type Validation Issues
- Check `_strict_response_validation=False` in test fixtures to understand field mismatches
- Inspect response models in `types/` to match API responses
- Use `_utils._transform.py` for custom coercion logic

### Working with Optional Parameters
- Use `Omit` type for "don't send this field" vs `None` for "send null"
- Example: `metadata: Metadata | Omit = omit` means optional and not sent by default
- Compare with: `optional_field: str | None` which allows sending None

## Dependencies & Constraints

- **Min Python**: 3.9+ (see `pyproject.toml`)
- **Key Deps**: `httpx>=0.23.0`, `pydantic>=1.9.0`, `typing-extensions>=4.10`, `anyio>=3.5.0`
- **Optional**: `aiohttp` (for `DefaultAioHttpClient`), `websockets>=13` (for realtime)
- **Dev**: Rye, Ruff, Pyright, pytest, respx for mocking

## Conventions & Tips

1. **Import organization**: Absolute imports from package root (not relative)
2. **Error handling**: Use custom exception hierarchy in `_exceptions.py` (e.g., `APIStatusError`, `RateLimitError`)
3. **Streaming**: Check `types/completion.py` for streaming event unions; use `stream=True` param
4. **Pagination**: `SyncCursorPage` / `AsyncCursorPage` with `.auto_paginate_iter()` method
5. **Breaking Changes**: Detected via `scripts/detect-breaking-changes.py`
6. **Files/Uploads**: Use `_files.py` and `file_from_path()` helper for binary handling
7. **Async Context Managers**: Both clients support `async with AsyncOpenAI(...) as client:`

## Debugging & Inspection

- Enable debug logging: `openai.set_debug_logging(True)` or `logging.getLogger("openai").setLevel(logging.DEBUG)`
- Inspect raw responses: Use `.with_raw_response` property for headers, status codes
- Mock server issues: Test against real API with `TEST_API_BASE_URL=https://api.openai.com` (requires valid key)
- Type checking: Run `rye run pyright` to validate all type hints
10 changes: 0 additions & 10 deletions .github/pull_request_template.md

This file was deleted.

Loading