Skip to content

release: 1.65.0 #2145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "1.64.0"
".": "1.65.0"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 74
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-4aa6ee65ba9efc789e05e6a5ef0883b2cadf06def8efd863dbf75e9e233067e1.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai-5d30684c3118d049682ea30cdb4dbef39b97d51667da484689193dc40162af32.yml
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.65.0 (2025-02-27)

Full Changelog: [v1.64.0...v1.65.0](https://github.com/openai/openai-python/compare/v1.64.0...v1.65.0)

### Features

* **api:** add gpt-4.5-preview ([#2149](https://github.com/openai/openai-python/issues/2149)) ([4cee52e](https://github.com/openai/openai-python/commit/4cee52e8d191b0532f28d86446da79b43a58b907))


### Chores

* **internal:** properly set __pydantic_private__ ([#2144](https://github.com/openai/openai-python/issues/2144)) ([2b1bd16](https://github.com/openai/openai-python/commit/2b1bd1604a038ded67367742a0b1c9d92e29dfc8))

## 1.64.0 (2025-02-22)

Full Changelog: [v1.63.2...v1.64.0](https://github.com/openai/openai-python/compare/v1.63.2...v1.64.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 = "openai"
version = "1.64.0"
version = "1.65.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion src/openai/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
ModelBuilderProtocol,
)
from ._utils import SensitiveHeadersFilter, is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
from ._compat import model_copy, model_dump
from ._compat import PYDANTIC_V2, model_copy, model_dump
from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
from ._response import (
APIResponse,
Expand Down Expand Up @@ -209,6 +209,9 @@ def _set_private_attributes(
model: Type[_T],
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
Expand Down Expand Up @@ -294,6 +297,9 @@ def _set_private_attributes(
client: AsyncAPIClient,
options: FinalRequestOptions,
) -> None:
if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
self.__pydantic_private__ = {}

self._model = model
self._client = client
self._options = options
Expand Down
2 changes: 1 addition & 1 deletion src/openai/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "openai"
__version__ = "1.64.0" # x-release-please-version
__version__ = "1.65.0" # x-release-please-version
4 changes: 4 additions & 0 deletions src/openai/resources/beta/assistants.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def update(
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
Expand Down Expand Up @@ -673,6 +675,8 @@ async def update(
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
Expand Down
36 changes: 21 additions & 15 deletions src/openai/resources/beta/realtime/realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,14 +561,17 @@ def __init__(self, connection: RealtimeConnection) -> None:

class RealtimeSessionResource(BaseRealtimeConnectionResource):
def update(self, *, session: session_update_event_param.Session, event_id: str | NotGiven = NOT_GIVEN) -> None:
"""Send this event to update the session’s default configuration.
"""
Send this event to update the session’s default configuration.
The client may send this event at any time to update any field,
except for `voice`. However, note that once a session has been
initialized with a particular `model`, it can’t be changed to
another model using `session.update`.

The client may
send this event at any time to update the session configuration, and any
field may be updated at any time, except for "voice". The server will respond
with a `session.updated` event that shows the full effective configuration.
Only fields that are present are updated, thus the correct way to clear a
field like "instructions" is to pass an empty string.
When the server receives a `session.update`, it will respond
with a `session.updated` event showing the full, effective configuration.
Only the fields that are present are updated. To clear a field like
`instructions`, pass an empty string.
"""
self._connection.send(
cast(
Expand Down Expand Up @@ -768,14 +771,17 @@ class AsyncRealtimeSessionResource(BaseAsyncRealtimeConnectionResource):
async def update(
self, *, session: session_update_event_param.Session, event_id: str | NotGiven = NOT_GIVEN
) -> None:
"""Send this event to update the session’s default configuration.

The client may
send this event at any time to update the session configuration, and any
field may be updated at any time, except for "voice". The server will respond
with a `session.updated` event that shows the full effective configuration.
Only fields that are present are updated, thus the correct way to clear a
field like "instructions" is to pass an empty string.
"""
Send this event to update the session’s default configuration.
The client may send this event at any time to update any field,
except for `voice`. However, note that once a session has been
initialized with a particular `model`, it can’t be changed to
another model using `session.update`.

When the server receives a `session.update`, it will respond
with a `session.updated` event showing the full, effective configuration.
Only the fields that are present are updated. To clear a field like
`instructions`, pass an empty string.
"""
await self._connection.send(
cast(
Expand Down
2 changes: 2 additions & 0 deletions src/openai/types/beta/assistant_update_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ class AssistantUpdateParams(TypedDict, total=False):
"gpt-4o-2024-05-13",
"gpt-4o-mini",
"gpt-4o-mini-2024-07-18",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4-turbo",
"gpt-4-turbo-2024-04-09",
"gpt-4-0125-preview",
Expand Down
14 changes: 14 additions & 0 deletions src/openai/types/beta/realtime/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,20 @@ class Tool(BaseModel):


class TurnDetection(BaseModel):
create_response: Optional[bool] = None
"""Whether or not to automatically generate a response when a VAD stop event
occurs.

`true` by default.
"""

interrupt_response: Optional[bool] = None
"""
Whether or not to automatically interrupt any ongoing response with output to
the default conversation (i.e. `conversation` of `auto`) when a VAD start event
occurs. `true` by default.
"""

prefix_padding_ms: Optional[int] = None
"""Amount of audio to include before the VAD detected speech (in milliseconds).

Expand Down
10 changes: 9 additions & 1 deletion src/openai/types/beta/realtime/session_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,19 @@ class Tool(TypedDict, total=False):

class TurnDetection(TypedDict, total=False):
create_response: bool
"""Whether or not to automatically generate a response when VAD is enabled.
"""Whether or not to automatically generate a response when a VAD stop event
occurs.

`true` by default.
"""

interrupt_response: bool
"""
Whether or not to automatically interrupt any ongoing response with output to
the default conversation (i.e. `conversation` of `auto`) when a VAD start event
occurs. `true` by default.
"""

prefix_padding_ms: int
"""Amount of audio to include before the VAD detected speech (in milliseconds).

Expand Down
10 changes: 9 additions & 1 deletion src/openai/types/beta/realtime/session_update_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,19 @@ class SessionTool(BaseModel):

class SessionTurnDetection(BaseModel):
create_response: Optional[bool] = None
"""Whether or not to automatically generate a response when VAD is enabled.
"""Whether or not to automatically generate a response when a VAD stop event
occurs.

`true` by default.
"""

interrupt_response: Optional[bool] = None
"""
Whether or not to automatically interrupt any ongoing response with output to
the default conversation (i.e. `conversation` of `auto`) when a VAD start event
occurs. `true` by default.
"""

prefix_padding_ms: Optional[int] = None
"""Amount of audio to include before the VAD detected speech (in milliseconds).

Expand Down
10 changes: 9 additions & 1 deletion src/openai/types/beta/realtime/session_update_event_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,19 @@ class SessionTool(TypedDict, total=False):

class SessionTurnDetection(TypedDict, total=False):
create_response: bool
"""Whether or not to automatically generate a response when VAD is enabled.
"""Whether or not to automatically generate a response when a VAD stop event
occurs.

`true` by default.
"""

interrupt_response: bool
"""
Whether or not to automatically interrupt any ongoing response with output to
the default conversation (i.e. `conversation` of `auto`) when a VAD start event
occurs. `true` by default.
"""

prefix_padding_ms: int
"""Amount of audio to include before the VAD detected speech (in milliseconds).

Expand Down
2 changes: 2 additions & 0 deletions src/openai/types/chat_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"o1-preview-2024-09-12",
"o1-mini",
"o1-mini-2024-09-12",
"gpt-4.5-preview",
"gpt-4.5-preview-2025-02-27",
"gpt-4o",
"gpt-4o-2024-11-20",
"gpt-4o-2024-08-06",
Expand Down
3 changes: 3 additions & 0 deletions src/openai/types/file_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ class FileObject(BaseModel):
`error`.
"""

expires_at: Optional[int] = None
"""The Unix timestamp (in seconds) for when the file will expire."""

status_details: Optional[str] = None
"""Deprecated.

Expand Down
2 changes: 1 addition & 1 deletion src/openai/types/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class Upload(BaseModel):
"""The Unix timestamp (in seconds) for when the Upload was created."""

expires_at: int
"""The Unix timestamp (in seconds) for when the Upload was created."""
"""The Unix timestamp (in seconds) for when the Upload will expire."""

filename: str
"""The name of the file to be uploaded."""
Expand Down
2 changes: 2 additions & 0 deletions tests/api_resources/beta/realtime/test_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def test_method_create_with_all_params(self, client: OpenAI) -> None:
],
turn_detection={
"create_response": True,
"interrupt_response": True,
"prefix_padding_ms": 0,
"silence_duration_ms": 0,
"threshold": 0,
Expand Down Expand Up @@ -112,6 +113,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncOpenAI) ->
],
turn_detection={
"create_response": True,
"interrupt_response": True,
"prefix_padding_ms": 0,
"silence_duration_ms": 0,
"threshold": 0,
Expand Down