Repository navigation
[pull] main from openai:main - #172
Merged
Merged
Conversation
## Summary Adds GPT-Rosalind research to the known Responses model names. ## Changes - Include gpt-rosalind-research in Responses model type hints. Co-authored-by: jbeckwith-oai <269036200+jbeckwith-oai@users.noreply.github.com>
## Summary Fixes #3939. When older aiohttp is installed, importing the optional adapter currently raises `AttributeError` for `aiohttp.SocketTimeoutError`. The SDK catches `ImportError`, so this breaks `import openai` even for applications using only the default HTTPX2 clients. Import the required exception explicitly so the existing unavailable-adapter path handles its absence. No SDK version bounds or new minimum aiohttp version checks are introduced. The `openai[aiohttp]` dependency requirement remains unchanged, and the optional adapter remains unavailable on the older exception surface. This refreshes the minimal import change previously proposed by @marcuswood-oai in #3868, with sync/async regressions and vendor documentation. ## Validation - Reproduced the original bare-import failure using the unmodified v3.18.0 release and actual aiohttp 3.9.3. - Added absent-aiohttp and pre-3.10 subprocess cases. The legacy case failed with the original `AttributeError` before the fix and passed afterward. - Each subprocess exercises synchronous and asynchronous SDK requests through HTTPX2 mock transports, checks the explicit unsupported-adapter error, and verifies legacy HTTPX was not imported. - The regression preserves `aiohttp.client` and earlier exception imports so an unrelated `ModuleNotFoundError` cannot make the old code pass. - Targeted transport suites: 39 passed, one skipped because optional `botocore` is not installed. This includes a real local HTTP request through the supported aiohttp adapter. - Real aiohttp 3.8.6, 3.9.3, 3.10.0, and 3.14.3 fixtures passed default sync/async request probes against this patch. Old versions are test fixtures, not recommended installations or supported aiohttp transports. - Changed tests passed Ruff lint and formatting. Existing repository exclusions for vendored code remain unchanged. ```shell python -m pytest -o addopts= tests/test_httpx2.py tests/test_httpx2_base.py tests/test_httpx2_respx.py tests/test_httpx2_workload.py -q -rs ``` No dependency, generated-baseline, custom-code budget, or workflow changes. Full CI and maintainer review remain required. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: Marcus Wood <marcuswood@openai.com> Copilot-Session: 0857d4b0-2459-4f7b-af29-366e05d08090
…_recursive (#3324) ## Summary The sync `_transform_recursive` path (line 221 of `_utils/_transform.py`) correctly passes `exclude=getattr(data, "__api_exclude__", None)` to `model_dump()` when it encounters a pydantic `BaseModel` value. The async counterpart `_async_transform_recursive` (line 387) was missing this argument. ## Bug ```python # sync — correct if isinstance(data, pydantic.BaseModel): return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, "__api_exclude__", None)) # async — missing exclude= kwarg (before this fix) if isinstance(data, pydantic.BaseModel): return model_dump(data, exclude_unset=True, mode="json") ``` ## Impact `ParsedResponse` (in `openai/types/responses/parsed_response.py`) declares: ```python __api_exclude__ = {"parsed_arguments"} ``` This is specifically to prevent the client-side computed `parsed_arguments` field from being sent back to the API server in multi-turn conversations. With the async client that exclusion had no effect: `parsed_arguments` leaked into every request body that included a `ParsedResponse` in the message history. ## Fix One-line change — add the missing `exclude` kwarg to match the sync path: ```python return model_dump(data, exclude_unset=True, mode="json", exclude=getattr(data, "__api_exclude__", None)) ``` ## Tests Added `tests/test_async_transform_api_exclude.py` with three tests (no live API calls): 1. `test_async_transform_excludes_api_excluded_fields` — asserts `__api_exclude__` fields are absent from the async output (this test **fails before the fix, passes after**) 2. `test_sync_transform_excludes_api_excluded_fields` — sanity-check that the sync path behaves the same 3. `test_async_transform_pydantic_model_without_api_exclude` — models without `__api_exclude__` are unaffected Run with `PYTHONPATH=src pytest tests/test_async_transform_api_exclude.py`. --------- Co-authored-by: Marcus Wood <marcuswood@openai.com>
) ### What Three `async` methods in `src/openai/helpers/` call `asyncio.get_event_loop()` from inside a running coroutine: - `LocalAudioPlayer.play` (`local_audio_player.py`) - `LocalAudioPlayer.play_stream` (`local_audio_player.py`) - `Microphone.record` (`microphone.py`) ### Why it matters Since Python 3.10, calling `asyncio.get_event_loop()` when there is no current event loop is deprecated, and calling it from within a coroutine to obtain the running loop emits a `DeprecationWarning`. The documented replacement for code that runs inside a coroutine is `asyncio.get_running_loop()`. ### Fix ```python # Before loop = asyncio.get_event_loop() # After loop = asyncio.get_running_loop() ``` In all three cases the loop is obtained inside an `async def` and only used for `run_in_executor` / `call_soon_threadsafe`, so there is always a running loop and behavior is unchanged. This just removes the deprecation and makes the intent explicit. ### Scope Three one-line changes in `src/openai/helpers/` (a hand-maintained, non-generated path). Files still parse and import. Happy to adjust if you would prefer a different approach. Co-authored-by: Marcus Wood <marcuswood@openai.com>
## Summary Add typed GCP provider support for organization external storage. Expose retry headers on video creation errors when available. ## Changes - Export the new GcpExternalStorageProvider response model with bucket, region, audience, workload identity, and provider type fields. - Allow GCP providers in external storage creation parameters, configurations, and audit log registration events. - Add optional headers to VideoCreateError as a string mapping for Retry-After and Retry-After-Ms values. Co-authored-by: jbeckwith-oai <269036200+jbeckwith-oai@users.noreply.github.com>
## Summary Fixes serialization errors when WebSocket events containing `omit` or `not_given` are queued before the connection opens. ## Changes - Support omission markers in dictionary events queued by synchronous and asynchronous WebSocket connection managers. Co-authored-by: marcuswood-oai <323319819+marcuswood-oai@users.noreply.github.com>
Automated Release PR --- ## [3.19.0](v3.18.0...v3.19.0) (2026-09-22) ### Features * **api:** add GCP external storage support ([#3943](#3943)) ([d12d60f](d12d60f)) * **api:** add GPT-Rosalind research model ([#3940](#3940)) ([d041d73](d041d73)) ### Bug Fixes * **_utils/_transform:** propagate __api_exclude__ in _async_transform_recursive ([#3324](#3324)) ([161ae65](161ae65)) * **api:** handle omission markers in queued WebSocket events ([#3944](#3944)) ([63e4616](63e4616)) * **client:** retry only replayable request content ([#3771](#3771)) ([6e0c2be](6e0c2be)) * **client:** tolerate older optional aiohttp installations ([#3941](#3941)) ([0d91efb](0d91efb)) * **helpers:** use asyncio.get_running_loop() inside async methods ([#3289](#3289)) ([bac3545](bac3545)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: openai-sdks[bot] <284451331+openai-sdks[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )