diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f701c8396e..b58729ff4e 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.59.3" + ".": "1.59.4" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 75d144cca6..78a1f2a1cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 1.59.4 (2025-01-07) + +Full Changelog: [v1.59.3...v1.59.4](https://github.com/openai/openai-python/compare/v1.59.3...v1.59.4) + +### Chores + +* add missing isclass check ([#1988](https://github.com/openai/openai-python/issues/1988)) ([61d9072](https://github.com/openai/openai-python/commit/61d9072fbace58d64910ec7378c3686ac555972e)) +* add missing isclass check for structured outputs ([bcbf013](https://github.com/openai/openai-python/commit/bcbf013e8d825b8b5f88172313dfb6e0313ca34c)) +* **internal:** bump httpx dependency ([#1990](https://github.com/openai/openai-python/issues/1990)) ([288c2c3](https://github.com/openai/openai-python/commit/288c2c30dc405cbaa89924f9243442300e95e100)) + + +### Documentation + +* **realtime:** fix event reference link ([9b6885d](https://github.com/openai/openai-python/commit/9b6885d50f8d65ba5009642046727d291e0f14fa)) + ## 1.59.3 (2025-01-03) Full Changelog: [v1.59.2...v1.59.3](https://github.com/openai/openai-python/compare/v1.59.2...v1.59.3) diff --git a/README.md b/README.md index 87837db175..cc1eb1a4f7 100644 --- a/README.md +++ b/README.md @@ -264,7 +264,7 @@ The Realtime API enables you to build low-latency, multi-modal conversational ex Under the hood the SDK uses the [`websockets`](https://websockets.readthedocs.io/en/stable/) library to manage connections. -The Realtime API works through a combination of client-sent events and server-sent events. Clients can send events to do things like update session configuration or send text and audio inputs. Server events confirm when audio responses have completed, or when a text response from the model has been received. A full event reference can be found [here](platform.openai.com/docs/api-reference/realtime-client-events) and a guide can be found [here](https://platform.openai.com/docs/guides/realtime). +The Realtime API works through a combination of client-sent events and server-sent events. Clients can send events to do things like update session configuration or send text and audio inputs. Server events confirm when audio responses have completed, or when a text response from the model has been received. A full event reference can be found [here](https://platform.openai.com/docs/api-reference/realtime-client-events) and a guide can be found [here](https://platform.openai.com/docs/guides/realtime). Basic text based example: diff --git a/pyproject.toml b/pyproject.toml index b9d4abf59a..f5309b299a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "1.59.3" +version = "1.59.4" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" @@ -66,8 +66,7 @@ dev-dependencies = [ "types-tqdm > 4", "types-pyaudio > 0", "trio >=0.22.2", - "nest_asyncio==1.6.0" - + "nest_asyncio==1.6.0", ] [tool.rye.scripts] diff --git a/requirements-dev.lock b/requirements-dev.lock index 94cf6aca07..15ecbf081a 100644 --- a/requirements-dev.lock +++ b/requirements-dev.lock @@ -60,7 +60,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via openai # via respx idna==3.4 @@ -137,7 +137,7 @@ pytz==2023.3.post1 requests==2.31.0 # via azure-core # via msal -respx==0.20.2 +respx==0.22.0 rich==13.7.1 # via inline-snapshot ruff==0.6.9 @@ -149,7 +149,6 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via httpx # via openai # via trio sortedcontainers==2.4.0 diff --git a/requirements.lock b/requirements.lock index c10449ac20..a3e3602abe 100644 --- a/requirements.lock +++ b/requirements.lock @@ -25,7 +25,7 @@ h11==0.14.0 # via httpcore httpcore==1.0.2 # via httpx -httpx==0.25.2 +httpx==0.28.1 # via openai idna==3.4 # via anyio @@ -52,7 +52,6 @@ six==1.16.0 # via python-dateutil sniffio==1.3.0 # via anyio - # via httpx # via openai tqdm==4.66.5 # via openai diff --git a/src/openai/_models.py b/src/openai/_models.py index 2f67e5eb4d..1bbc5fa4cc 100644 --- a/src/openai/_models.py +++ b/src/openai/_models.py @@ -513,7 +513,11 @@ def construct_type(*, value: object, type_: object) -> object: _, items_type = get_args(type_) # Dict[_, items_type] return {key: construct_type(value=item, type_=items_type) for key, item in value.items()} - if not is_literal_type(type_) and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)): + if ( + not is_literal_type(type_) + and inspect.isclass(origin) + and (issubclass(origin, BaseModel) or issubclass(origin, GenericModel)) + ): if is_list(value): return [cast(Any, type_).construct(**entry) if is_mapping(entry) else entry for entry in value] diff --git a/src/openai/_version.py b/src/openai/_version.py index 342d208d2b..86545ed82a 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "1.59.3" # x-release-please-version +__version__ = "1.59.4" # x-release-please-version diff --git a/src/openai/lib/_pydantic.py b/src/openai/lib/_pydantic.py index 22c7a1f3cd..4e8bc772be 100644 --- a/src/openai/lib/_pydantic.py +++ b/src/openai/lib/_pydantic.py @@ -127,6 +127,8 @@ def resolve_ref(*, root: dict[str, object], ref: str) -> object: def is_basemodel_type(typ: type) -> TypeGuard[type[pydantic.BaseModel]]: + if not inspect.isclass(typ): + return False return issubclass(typ, pydantic.BaseModel)