Skip to content

Commit a6934f3

Browse files
authored
Merge branch 'main' into chore/client-comment-fix
2 parents f4141a2 + ed53107 commit a6934f3

26 files changed

+397
-79
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.74.0"
2+
".": "1.75.0"
33
}

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a555f81249cb084f463dcefa4aba069f9341fdaf3dd6ac27d7f237fc90e8f488.yml
3-
openapi_spec_hash: 8e590296cd1a54b9508510b0c7a2c45a
4-
config_hash: 5ea32de61ff42fcf5e66cff8d9e247ea
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5633633cc38734869cf7d993f7b549bb8e4d10e0ec45381ec2cd91507cd8eb8f.yml
3+
openapi_spec_hash: c855121b2b2324b99499c9244c21d24d
4+
config_hash: d20837393b73efdb19cd08e04c1cc9a1

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 1.75.0 (2025-04-16)
4+
5+
Full Changelog: [v1.74.1...v1.75.0](https://github.com/openai/openai-python/compare/v1.74.1...v1.75.0)
6+
7+
### Features
8+
9+
* **api:** add o3 and o4-mini model IDs ([4bacbd5](https://github.com/openai/openai-python/commit/4bacbd5503137e266c127dc643ebae496cb4f158))
10+
11+
## 1.74.1 (2025-04-16)
12+
13+
Full Changelog: [v1.74.0...v1.74.1](https://github.com/openai/openai-python/compare/v1.74.0...v1.74.1)
14+
15+
### Chores
16+
17+
* **internal:** base client updates ([06303b5](https://github.com/openai/openai-python/commit/06303b501f8c17040c495971a4ee79ae340f6f4a))
18+
* **internal:** bump pyright version ([9fd1c77](https://github.com/openai/openai-python/commit/9fd1c778c3231616bf1331cb1daa86fdfca4cb7f))
19+
320
## 1.74.0 (2025-04-14)
421

522
Full Changelog: [v1.73.0...v1.74.0](https://github.com/openai/openai-python/compare/v1.73.0...v1.74.0)

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "openai"
3-
version = "1.74.0"
3+
version = "1.75.0"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -51,7 +51,7 @@ voice_helpers = ["sounddevice>=0.5.1", "numpy>=2.0.2"]
5151
managed = true
5252
# version pins are in requirements-dev.lock
5353
dev-dependencies = [
54-
"pyright>=1.1.359",
54+
"pyright==1.1.399",
5555
"mypy",
5656
"respx",
5757
"pytest",

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ pygments==2.18.0
126126
# via rich
127127
pyjwt==2.8.0
128128
# via msal
129-
pyright==1.1.392.post0
129+
pyright==1.1.399
130130
pytest==8.3.3
131131
# via pytest-asyncio
132132
pytest-asyncio==0.24.0

src/openai/_base_client.py

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@
100100
_AsyncStreamT = TypeVar("_AsyncStreamT", bound=AsyncStream[Any])
101101

102102
if TYPE_CHECKING:
103-
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
103+
from httpx._config import (
104+
DEFAULT_TIMEOUT_CONFIG, # pyright: ignore[reportPrivateImportUsage]
105+
)
106+
107+
HTTPX_DEFAULT_TIMEOUT = DEFAULT_TIMEOUT_CONFIG
104108
else:
105109
try:
106110
from httpx._config import DEFAULT_TIMEOUT_CONFIG as HTTPX_DEFAULT_TIMEOUT
@@ -117,6 +121,7 @@ class PageInfo:
117121

118122
url: URL | NotGiven
119123
params: Query | NotGiven
124+
json: Body | NotGiven
120125

121126
@overload
122127
def __init__(
@@ -132,19 +137,30 @@ def __init__(
132137
params: Query,
133138
) -> None: ...
134139

140+
@overload
141+
def __init__(
142+
self,
143+
*,
144+
json: Body,
145+
) -> None: ...
146+
135147
def __init__(
136148
self,
137149
*,
138150
url: URL | NotGiven = NOT_GIVEN,
151+
json: Body | NotGiven = NOT_GIVEN,
139152
params: Query | NotGiven = NOT_GIVEN,
140153
) -> None:
141154
self.url = url
155+
self.json = json
142156
self.params = params
143157

144158
@override
145159
def __repr__(self) -> str:
146160
if self.url:
147161
return f"{self.__class__.__name__}(url={self.url})"
162+
if self.json:
163+
return f"{self.__class__.__name__}(json={self.json})"
148164
return f"{self.__class__.__name__}(params={self.params})"
149165

150166

@@ -193,6 +209,19 @@ def _info_to_options(self, info: PageInfo) -> FinalRequestOptions:
193209
options.url = str(url)
194210
return options
195211

212+
if not isinstance(info.json, NotGiven):
213+
if not is_mapping(info.json):
214+
raise TypeError("Pagination is only supported with mappings")
215+
216+
if not options.json_data:
217+
options.json_data = {**info.json}
218+
else:
219+
if not is_mapping(options.json_data):
220+
raise TypeError("Pagination is only supported with mappings")
221+
222+
options.json_data = {**options.json_data, **info.json}
223+
return options
224+
196225
raise ValueError("Unexpected PageInfo state")
197226

198227

src/openai/_models.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
)
2121

2222
import pydantic
23-
import pydantic.generics
2423
from pydantic.fields import FieldInfo
2524

2625
from ._types import (

src/openai/_utils/_typing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ class MyResponse(Foo[_T]):
110110
```
111111
"""
112112
cls = cast(object, get_origin(typ) or typ)
113-
if cls in generic_bases:
113+
if cls in generic_bases: # pyright: ignore[reportUnnecessaryContains]
114114
# we're given the class directly
115115
return extract_type_arg(typ, index)
116116

src/openai/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "openai"
4-
__version__ = "1.74.0" # x-release-please-version
4+
__version__ = "1.75.0" # x-release-please-version

0 commit comments

Comments
 (0)