Skip to content
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 @@
{
".": "2.4.0"
".": "2.5.0"
}
8 changes: 4 additions & 4 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 136
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-104cced8f4c7436a76eea02e26307828166405ccfb296faffb008b72772c11a7.yml
openapi_spec_hash: fdc03ed84a65a31b80da909255e53924
config_hash: 03b48e9b8c7231a902403210dbd7dfa0
configured_endpoints: 135
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-f59befea071ed7729cbb7bce219e7f837eccfdb57e01698514e6a0bd6052ff60.yml
openapi_spec_hash: 49da48619d37932b2e257c532078b2bb
config_hash: 1af83449a09a3b4f276444dbcdd3eb67
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 2.5.0 (2025-10-17)

Full Changelog: [v2.4.0...v2.5.0](https://github.com/openai/openai-python/compare/v2.4.0...v2.5.0)

### Features

* **api:** api update ([8b280d5](https://github.com/openai/openai-python/commit/8b280d57d6d361bc3a032e030158f6859c445291))


### Chores

* bump `httpx-aiohttp` version to 0.1.9 ([67f2f0a](https://github.com/openai/openai-python/commit/67f2f0afe51dab9d5899fe18b1a4e86b2c774d10))

## 2.4.0 (2025-10-16)

Full Changelog: [v2.3.0...v2.4.0](https://github.com/openai/openai-python/compare/v2.3.0...v2.4.0)
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "2.4.0"
version = "2.5.0"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -44,7 +44,7 @@ Repository = "https://github.com/openai/openai-python"
openai = "openai.cli:main"

[project.optional-dependencies]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.8"]
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
realtime = ["websockets >= 13, < 16"]
datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
voice_helpers = ["sounddevice>=0.5.1", "numpy>=2.0.2"]
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ httpx==0.28.1
# via httpx-aiohttp
# via openai
# via respx
httpx-aiohttp==0.1.8
httpx-aiohttp==0.1.9
# via openai
idna==3.4
# via anyio
Expand Down
2 changes: 1 addition & 1 deletion requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ httpcore==1.0.9
httpx==0.28.1
# via httpx-aiohttp
# via openai
httpx-aiohttp==0.1.8
httpx-aiohttp==0.1.9
# via openai
idna==3.4
# via anyio
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__ = "2.4.0" # x-release-please-version
__version__ = "2.5.0" # x-release-please-version
125 changes: 0 additions & 125 deletions src/openai/resources/beta/chatkit/chatkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

from __future__ import annotations

from typing import Any, Mapping, cast

import httpx

from .... import _legacy_response
from .threads import (
Threads,
AsyncThreads,
Expand All @@ -23,14 +18,8 @@
SessionsWithStreamingResponse,
AsyncSessionsWithStreamingResponse,
)
from ...._types import Body, Query, Headers, NotGiven, FileTypes, not_given
from ...._utils import extract_files, maybe_transform, deepcopy_minimal, async_maybe_transform
from ...._compat import cached_property
from ...._resource import SyncAPIResource, AsyncAPIResource
from ...._response import to_streamed_response_wrapper, async_to_streamed_response_wrapper
from ....types.beta import chatkit_upload_file_params
from ...._base_client import make_request_options
from ....types.beta.chatkit_upload_file_response import ChatKitUploadFileResponse

__all__ = ["ChatKit", "AsyncChatKit"]

Expand Down Expand Up @@ -63,55 +52,6 @@ def with_streaming_response(self) -> ChatKitWithStreamingResponse:
"""
return ChatKitWithStreamingResponse(self)

def upload_file(
self,
*,
file: FileTypes,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ChatKitUploadFileResponse:
"""
Upload a ChatKit file

Args:
file: Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
JPG, JPEG, GIF, or WEBP images.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {"OpenAI-Beta": "chatkit_beta=v1", **(extra_headers or {})}
body = deepcopy_minimal({"file": file})
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
if files:
# It should be noted that the actual Content-Type header that will be
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers["Content-Type"] = "multipart/form-data"
return cast(
ChatKitUploadFileResponse,
self._post(
"/chatkit/files",
body=maybe_transform(body, chatkit_upload_file_params.ChatKitUploadFileParams),
files=files,
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(
Any, ChatKitUploadFileResponse
), # Union types cannot be passed in as arguments in the type system
),
)


class AsyncChatKit(AsyncAPIResource):
@cached_property
Expand Down Expand Up @@ -141,64 +81,11 @@ def with_streaming_response(self) -> AsyncChatKitWithStreamingResponse:
"""
return AsyncChatKitWithStreamingResponse(self)

async def upload_file(
self,
*,
file: FileTypes,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> ChatKitUploadFileResponse:
"""
Upload a ChatKit file

Args:
file: Binary file contents to store with the ChatKit session. Supports PDFs and PNG,
JPG, JPEG, GIF, or WEBP images.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
extra_headers = {"OpenAI-Beta": "chatkit_beta=v1", **(extra_headers or {})}
body = deepcopy_minimal({"file": file})
files = extract_files(cast(Mapping[str, object], body), paths=[["file"]])
if files:
# It should be noted that the actual Content-Type header that will be
# sent to the server will contain a `boundary` parameter, e.g.
# multipart/form-data; boundary=---abc--
extra_headers["Content-Type"] = "multipart/form-data"
return cast(
ChatKitUploadFileResponse,
await self._post(
"/chatkit/files",
body=await async_maybe_transform(body, chatkit_upload_file_params.ChatKitUploadFileParams),
files=files,
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=cast(
Any, ChatKitUploadFileResponse
), # Union types cannot be passed in as arguments in the type system
),
)


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

self.upload_file = _legacy_response.to_raw_response_wrapper(
chatkit.upload_file,
)

@cached_property
def sessions(self) -> SessionsWithRawResponse:
return SessionsWithRawResponse(self._chatkit.sessions)
Expand All @@ -212,10 +99,6 @@ class AsyncChatKitWithRawResponse:
def __init__(self, chatkit: AsyncChatKit) -> None:
self._chatkit = chatkit

self.upload_file = _legacy_response.async_to_raw_response_wrapper(
chatkit.upload_file,
)

@cached_property
def sessions(self) -> AsyncSessionsWithRawResponse:
return AsyncSessionsWithRawResponse(self._chatkit.sessions)
Expand All @@ -229,10 +112,6 @@ class ChatKitWithStreamingResponse:
def __init__(self, chatkit: ChatKit) -> None:
self._chatkit = chatkit

self.upload_file = to_streamed_response_wrapper(
chatkit.upload_file,
)

@cached_property
def sessions(self) -> SessionsWithStreamingResponse:
return SessionsWithStreamingResponse(self._chatkit.sessions)
Expand All @@ -246,10 +125,6 @@ class AsyncChatKitWithStreamingResponse:
def __init__(self, chatkit: AsyncChatKit) -> None:
self._chatkit = chatkit

self.upload_file = async_to_streamed_response_wrapper(
chatkit.upload_file,
)

@cached_property
def sessions(self) -> AsyncSessionsWithStreamingResponse:
return AsyncSessionsWithStreamingResponse(self._chatkit.sessions)
Expand Down
4 changes: 0 additions & 4 deletions src/openai/types/beta/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

from .thread import Thread as Thread
from .assistant import Assistant as Assistant
from .file_part import FilePart as FilePart
from .image_part import ImagePart as ImagePart
from .function_tool import FunctionTool as FunctionTool
from .assistant_tool import AssistantTool as AssistantTool
from .thread_deleted import ThreadDeleted as ThreadDeleted
Expand All @@ -23,11 +21,9 @@
from .file_search_tool_param import FileSearchToolParam as FileSearchToolParam
from .assistant_create_params import AssistantCreateParams as AssistantCreateParams
from .assistant_update_params import AssistantUpdateParams as AssistantUpdateParams
from .chatkit_upload_file_params import ChatKitUploadFileParams as ChatKitUploadFileParams
from .assistant_tool_choice_param import AssistantToolChoiceParam as AssistantToolChoiceParam
from .code_interpreter_tool_param import CodeInterpreterToolParam as CodeInterpreterToolParam
from .assistant_tool_choice_option import AssistantToolChoiceOption as AssistantToolChoiceOption
from .chatkit_upload_file_response import ChatKitUploadFileResponse as ChatKitUploadFileResponse
from .thread_create_and_run_params import ThreadCreateAndRunParams as ThreadCreateAndRunParams
from .assistant_tool_choice_function import AssistantToolChoiceFunction as AssistantToolChoiceFunction
from .assistant_response_format_option import AssistantResponseFormatOption as AssistantResponseFormatOption
Expand Down
17 changes: 0 additions & 17 deletions src/openai/types/beta/chatkit_upload_file_params.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/openai/types/beta/chatkit_upload_file_response.py

This file was deleted.

28 changes: 0 additions & 28 deletions src/openai/types/beta/file_part.py

This file was deleted.

31 changes: 0 additions & 31 deletions src/openai/types/beta/image_part.py

This file was deleted.

Loading
Loading