Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 513ae76

Browse files
release: 2.5.0 (#2694)
* chore: bump `httpx-aiohttp` version to 0.1.9 * feat(api): api update * codegen metadata * codegen metadata * release: 2.5.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent ebf3221 commit 513ae76

File tree

14 files changed

+23
-313
lines changed

14 files changed

+23
-313
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-
".": "2.4.0"
2+
".": "2.5.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 136
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-104cced8f4c7436a76eea02e26307828166405ccfb296faffb008b72772c11a7.yml
3-
openapi_spec_hash: fdc03ed84a65a31b80da909255e53924
4-
config_hash: 03b48e9b8c7231a902403210dbd7dfa0
1+
configured_endpoints: 135
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f59befea071ed7729cbb7bce219e7f837eccfdb57e01698514e6a0bd6052ff60.yml
3+
openapi_spec_hash: 49da48619d37932b2e257c532078b2bb
4+
config_hash: 1af83449a09a3b4f276444dbcdd3eb67

CHANGELOG.md

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

3+
## 2.5.0 (2025-10-17)
4+
5+
Full Changelog: [v2.4.0...v2.5.0](https://github.com/openai/openai-python/compare/v2.4.0...v2.5.0)
6+
7+
### Features
8+
9+
* **api:** api update ([8b280d5](https://github.com/openai/openai-python/commit/8b280d57d6d361bc3a032e030158f6859c445291))
10+
11+
12+
### Chores
13+
14+
* bump `httpx-aiohttp` version to 0.1.9 ([67f2f0a](https://github.com/openai/openai-python/commit/67f2f0afe51dab9d5899fe18b1a4e86b2c774d10))
15+
316
## 2.4.0 (2025-10-16)
417

518
Full Changelog: [v2.3.0...v2.4.0](https://github.com/openai/openai-python/compare/v2.3.0...v2.4.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 = "2.4.0"
3+
version = "2.5.0"
44
description = "The official Python library for the openai API"
55
dynamic = ["readme"]
66
license = "Apache-2.0"
@@ -44,7 +44,7 @@ Repository = "https://github.com/openai/openai-python"
4444
openai = "openai.cli:main"
4545

4646
[project.optional-dependencies]
47-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
47+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
4848
realtime = ["websockets >= 13, < 16"]
4949
datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
5050
voice_helpers = ["sounddevice>=0.5.1", "numpy>=2.0.2"]

requirements-dev.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ httpx==0.28.1
7979
# via httpx-aiohttp
8080
# via openai
8181
# via respx
82-
httpx-aiohttp==0.1.8
82+
httpx-aiohttp==0.1.9
8383
# via openai
8484
idna==3.4
8585
# via anyio

requirements.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ httpcore==1.0.9
4545
httpx==0.28.1
4646
# via httpx-aiohttp
4747
# via openai
48-
httpx-aiohttp==0.1.8
48+
httpx-aiohttp==0.1.9
4949
# via openai
5050
idna==3.4
5151
# via anyio

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__ = "2.4.0" # x-release-please-version
4+
__version__ = "2.5.0" # x-release-please-version

src/openai/resources/beta/chatkit/chatkit.py

Lines changed: 0 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22

33
from __future__ import annotations
44

5-
from typing import Any, Mapping, cast
6-
7-
import httpx
8-
9-
from .... import _legacy_response
105
from .threads import (
116
Threads,
127
AsyncThreads,
@@ -23,14 +18,8 @@
2318
SessionsWithStreamingResponse,
2419
AsyncSessionsWithStreamingResponse,
2520
)
26-
from ...._types import Body, Query, Headers, NotGiven, FileTypes, not_given
27-
from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
2821
from ...._compat import cached_property
2922
from ...._resource import SyncAPIResource, AsyncAPIResource
30-
from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
31-
from ....types.beta import chatkit_upload_file_params
32-
from ...._base_client import make_request_options
33-
from ....types.beta.chatkit_upload_file_response import ChatKitUploadFileResponse
3423

3524
__all__ = ["ChatKit", "AsyncChatKit"]
3625

@@ -63,55 +52,6 @@ def with_streaming_response(self) -> ChatKitWithStreamingResponse:
6352
"""
6453
return ChatKitWithStreamingResponse(self)
6554

66-
def upload_file(
67-
self,
68-
*,
69-
file: FileTypes,
70-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
71-
# The extra values given here take precedence over values defined on the client or passed to this method.
72-
extra_headers: Headers | None = None,
73-
extra_query: Query | None = None,
74-
extra_body: Body | None = None,
75-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
76-
) -> ChatKitUploadFileResponse:
77-
"""
78-
Upload a ChatKit file
79-
80-
Args:
81-
file: Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
82-
JPG, JPEG, GIF, or WEBP images.
83-
84-
extra_headers: Send extra headers
85-
86-
extra_query: Add additional query parameters to the request
87-
88-
extra_body: Add additional JSON properties to the request
89-
90-
timeout: Override the client-level default timeout for this request, in seconds
91-
"""
92-
extra_headers = {"OpenAI-Beta": "chatkit_beta=v1", **(extra_headers or {})}
93-
body = deepcopy_minimal({"file": file})
94-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
95-
if files:
96-
# It should be noted that the actual Content-Type header that will be
97-
# sent to the server will contain a `boundary` parameter, e.g.
98-
# multipart/form-data; boundary=---abc--
99-
extra_headers["Content-Type"] = "multipart/form-data"
100-
return cast(
101-
ChatKitUploadFileResponse,
102-
self._post(
103-
"/chatkit/files",
104-
body=maybe_transform(body, chatkit_upload_file_params.ChatKitUploadFileParams),
105-
files=files,
106-
options=make_request_options(
107-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
108-
),
109-
cast_to=cast(
110-
Any, ChatKitUploadFileResponse
111-
), # Union types cannot be passed in as arguments in the type system
112-
),
113-
)
114-
11555

11656
class AsyncChatKit(AsyncAPIResource):
11757
@cached_property
@@ -141,64 +81,11 @@ def with_streaming_response(self) -> AsyncChatKitWithStreamingResponse:
14181
"""
14282
return AsyncChatKitWithStreamingResponse(self)
14383

144-
async def upload_file(
145-
self,
146-
*,
147-
file: FileTypes,
148-
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
149-
# The extra values given here take precedence over values defined on the client or passed to this method.
150-
extra_headers: Headers | None = None,
151-
extra_query: Query | None = None,
152-
extra_body: Body | None = None,
153-
timeout: float | httpx.Timeout | None | NotGiven = not_given,
154-
) -> ChatKitUploadFileResponse:
155-
"""
156-
Upload a ChatKit file
157-
158-
Args:
159-
file: Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
160-
JPG, JPEG, GIF, or WEBP images.
161-
162-
extra_headers: Send extra headers
163-
164-
extra_query: Add additional query parameters to the request
165-
166-
extra_body: Add additional JSON properties to the request
167-
168-
timeout: Override the client-level default timeout for this request, in seconds
169-
"""
170-
extra_headers = {"OpenAI-Beta": "chatkit_beta=v1", **(extra_headers or {})}
171-
body = deepcopy_minimal({"file": file})
172-
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
173-
if files:
174-
# It should be noted that the actual Content-Type header that will be
175-
# sent to the server will contain a `boundary` parameter, e.g.
176-
# multipart/form-data; boundary=---abc--
177-
extra_headers["Content-Type"] = "multipart/form-data"
178-
return cast(
179-
ChatKitUploadFileResponse,
180-
await self._post(
181-
"/chatkit/files",
182-
body=await async_maybe_transform(body, chatkit_upload_file_params.ChatKitUploadFileParams),
183-
files=files,
184-
options=make_request_options(
185-
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
186-
),
187-
cast_to=cast(
188-
Any, ChatKitUploadFileResponse
189-
), # Union types cannot be passed in as arguments in the type system
190-
),
191-
)
192-
19384

19485
class ChatKitWithRawResponse:
19586
def __init__(self, chatkit: ChatKit) -> None:
19687
self._chatkit = chatkit
19788

198-
self.upload_file = _legacy_response.to_raw_response_wrapper(
199-
chatkit.upload_file,
200-
)
201-
20289
@cached_property
20390
def sessions(self) -> SessionsWithRawResponse:
20491
return SessionsWithRawResponse(self._chatkit.sessions)
@@ -212,10 +99,6 @@ class AsyncChatKitWithRawResponse:
21299
def __init__(self, chatkit: AsyncChatKit) -> None:
213100
self._chatkit = chatkit
214101

215-
self.upload_file = _legacy_response.async_to_raw_response_wrapper(
216-
chatkit.upload_file,
217-
)
218-
219102
@cached_property
220103
def sessions(self) -> AsyncSessionsWithRawResponse:
221104
return AsyncSessionsWithRawResponse(self._chatkit.sessions)
@@ -229,10 +112,6 @@ class ChatKitWithStreamingResponse:
229112
def __init__(self, chatkit: ChatKit) -> None:
230113
self._chatkit = chatkit
231114

232-
self.upload_file = to_streamed_response_wrapper(
233-
chatkit.upload_file,
234-
)
235-
236115
@cached_property
237116
def sessions(self) -> SessionsWithStreamingResponse:
238117
return SessionsWithStreamingResponse(self._chatkit.sessions)
@@ -246,10 +125,6 @@ class AsyncChatKitWithStreamingResponse:
246125
def __init__(self, chatkit: AsyncChatKit) -> None:
247126
self._chatkit = chatkit
248127

249-
self.upload_file = async_to_streamed_response_wrapper(
250-
chatkit.upload_file,
251-
)
252-
253128
@cached_property
254129
def sessions(self) -> AsyncSessionsWithStreamingResponse:
255130
return AsyncSessionsWithStreamingResponse(self._chatkit.sessions)

src/openai/types/beta/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
from .thread import Thread as Thread
66
from .assistant import Assistant as Assistant
7-
from .file_part import FilePart as FilePart
8-
from .image_part import ImagePart as ImagePart
97
from .function_tool import FunctionTool as FunctionTool
108
from .assistant_tool import AssistantTool as AssistantTool
119
from .thread_deleted import ThreadDeleted as ThreadDeleted
@@ -23,11 +21,9 @@
2321
from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam
2422
from .assistant_create_params import AssistantCreateParams as AssistantCreateParams
2523
from .assistant_update_params import AssistantUpdateParams as AssistantUpdateParams
26-
from .chatkit_upload_file_params import ChatKitUploadFileParams as ChatKitUploadFileParams
2724
from .assistant_tool_choice_param import AssistantToolChoiceParam as AssistantToolChoiceParam
2825
from .code_interpreter_tool_param import CodeInterpreterToolParam as CodeInterpreterToolParam
2926
from .assistant_tool_choice_option import AssistantToolChoiceOption as AssistantToolChoiceOption
30-
from .chatkit_upload_file_response import ChatKitUploadFileResponse as ChatKitUploadFileResponse
3127
from .thread_create_and_run_params import ThreadCreateAndRunParams as ThreadCreateAndRunParams
3228
from .assistant_tool_choice_function import AssistantToolChoiceFunction as AssistantToolChoiceFunction
3329
from .assistant_response_format_option import AssistantResponseFormatOption as AssistantResponseFormatOption

src/openai/types/beta/chatkit_upload_file_params.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)