Skip to content
Open
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.102.0"
".": "1.102.1"
}
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 1.102.1 (2025-08-29)

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

### Bug Fixes

* **responses:** add missing params to stream() method ([bfc0673](https://github.com/openai/openai-python/commit/bfc06732ffe3764cb95cef9f23b4b5c0d312826a))


### Chores

* bump `inline-snapshot` version to 0.28.0 ([#2590](https://github.com/openai/openai-python/issues/2590)) ([a6b0872](https://github.com/openai/openai-python/commit/a6b087226587d4cc4f59f1f09a595921b2823ef2))
* **internal:** add Sequence related utils ([d3d72b9](https://github.com/openai/openai-python/commit/d3d72b9ce3c0885bf2b6934ac57d9e84f8653208))
* **internal:** fix formatting ([3ab273f](https://github.com/openai/openai-python/commit/3ab273f21e601f088be7502b7bb5d249fc386d6a))
* **internal:** minor formatting change ([478a348](https://github.com/openai/openai-python/commit/478a34881c968e9cab9d93ac2cf8da2fcb37c46c))
* **internal:** update pyright exclude list ([66e440f](https://github.com/openai/openai-python/commit/66e440fac3ca388400392c64211450dedc491c11))

## 1.102.0 (2025-08-26)

Full Changelog: [v1.101.0...v1.102.0](https://github.com/openai/openai-python/compare/v1.101.0...v1.102.0)
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "1.102.0"
version = "1.102.1"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down Expand Up @@ -64,7 +64,7 @@ dev-dependencies = [
"dirty-equals>=0.6.0",
"importlib-metadata>=6.7.0",
"rich>=13.7.1",
"inline-snapshot >=0.7.0",
"inline-snapshot>=0.28.0",
"azure-identity >=1.14.1",
"types-tqdm > 4",
"types-pyaudio > 0",
Expand Down Expand Up @@ -165,6 +165,7 @@ exclude = [
"_dev",
".venv",
".nox",
".git",

# uses inline `uv` script dependencies
# which means it can't be type checked
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ idna==3.4
importlib-metadata==7.0.0
iniconfig==2.0.0
# via pytest
inline-snapshot==0.27.0
inline-snapshot==0.28.0
jiter==0.5.0
# via openai
markdown-it-py==3.0.0
Expand Down
36 changes: 35 additions & 1 deletion src/openai/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@
Mapping,
TypeVar,
Callable,
Iterator,
Optional,
Sequence,
)
from typing_extensions import Set, Literal, Protocol, TypeAlias, TypedDict, override, runtime_checkable
from typing_extensions import (
Set,
Literal,
Protocol,
TypeAlias,
TypedDict,
SupportsIndex,
overload,
override,
runtime_checkable,
)

import httpx
import pydantic
Expand Down Expand Up @@ -219,3 +230,26 @@ class _GenericAlias(Protocol):
class HttpxSendArgs(TypedDict, total=False):
auth: httpx.Auth
follow_redirects: bool


_T_co = TypeVar("_T_co", covariant=True)


if TYPE_CHECKING:
# This works because str.__contains__ does not accept object (either in typeshed or at runtime)
# https://github.com/hauntsaninja/useful_types/blob/5e9710f3875107d068e7679fd7fec9cfab0eff3b/useful_types/__init__.py#L285
class SequenceNotStr(Protocol[_T_co]):
@overload
def __getitem__(self, index: SupportsIndex, /) -> _T_co: ...
@overload
def __getitem__(self, index: slice, /) -> Sequence[_T_co]: ...
def __contains__(self, value: object, /) -> bool: ...
def __len__(self) -> int: ...
def __iter__(self) -> Iterator[_T_co]: ...
def index(self, value: Any, start: int = 0, stop: int = ..., /) -> int: ...
def count(self, value: Any, /) -> int: ...
def __reversed__(self) -> Iterator[_T_co]: ...
else:
# just point this to a normal `Sequence` at runtime to avoid having to special case
# deserializing our custom sequence type
SequenceNotStr = Sequence
1 change: 1 addition & 0 deletions src/openai/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
extract_type_arg as extract_type_arg,
is_iterable_type as is_iterable_type,
is_required_type as is_required_type,
is_sequence_type as is_sequence_type,
is_annotated_type as is_annotated_type,
is_type_alias_type as is_type_alias_type,
strip_annotated_type as strip_annotated_type,
Expand Down
5 changes: 5 additions & 0 deletions src/openai/_utils/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@ def is_list_type(typ: type) -> bool:
return (get_origin(typ) or typ) == list


def is_sequence_type(typ: type) -> bool:
origin = get_origin(typ) or typ
return origin == typing_extensions.Sequence or origin == typing.Sequence or origin == _c_abc.Sequence


def is_iterable_type(typ: type) -> bool:
"""If the given type is `typing.Iterable[T]`"""
origin = get_origin(typ) or typ
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.102.0" # x-release-please-version
__version__ = "1.102.1" # x-release-please-version
40 changes: 20 additions & 20 deletions src/openai/resources/beta/threads/messages.py
Original file line number Diff line number Diff line change
Expand Up @@ -600,27 +600,27 @@ def __init__(self, messages: Messages) -> None:

self.create = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
messages.create # pyright: ignore[reportDeprecated],
messages.create, # pyright: ignore[reportDeprecated],
)
)
self.retrieve = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
messages.retrieve # pyright: ignore[reportDeprecated],
messages.retrieve, # pyright: ignore[reportDeprecated],
)
)
self.update = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
messages.update # pyright: ignore[reportDeprecated],
messages.update, # pyright: ignore[reportDeprecated],
)
)
self.list = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
messages.list # pyright: ignore[reportDeprecated],
messages.list, # pyright: ignore[reportDeprecated],
)
)
self.delete = ( # pyright: ignore[reportDeprecated]
_legacy_response.to_raw_response_wrapper(
messages.delete # pyright: ignore[reportDeprecated],
messages.delete, # pyright: ignore[reportDeprecated],
)
)

Expand All @@ -631,27 +631,27 @@ def __init__(self, messages: AsyncMessages) -> None:

self.create = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
messages.create # pyright: ignore[reportDeprecated],
messages.create, # pyright: ignore[reportDeprecated],
)
)
self.retrieve = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
messages.retrieve # pyright: ignore[reportDeprecated],
messages.retrieve, # pyright: ignore[reportDeprecated],
)
)
self.update = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
messages.update # pyright: ignore[reportDeprecated],
messages.update, # pyright: ignore[reportDeprecated],
)
)
self.list = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
messages.list # pyright: ignore[reportDeprecated],
messages.list, # pyright: ignore[reportDeprecated],
)
)
self.delete = ( # pyright: ignore[reportDeprecated]
_legacy_response.async_to_raw_response_wrapper(
messages.delete # pyright: ignore[reportDeprecated],
messages.delete, # pyright: ignore[reportDeprecated],
)
)

Expand All @@ -662,27 +662,27 @@ def __init__(self, messages: Messages) -> None:

self.create = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
messages.create # pyright: ignore[reportDeprecated],
messages.create, # pyright: ignore[reportDeprecated],
)
)
self.retrieve = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
messages.retrieve # pyright: ignore[reportDeprecated],
messages.retrieve, # pyright: ignore[reportDeprecated],
)
)
self.update = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
messages.update # pyright: ignore[reportDeprecated],
messages.update, # pyright: ignore[reportDeprecated],
)
)
self.list = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
messages.list # pyright: ignore[reportDeprecated],
messages.list, # pyright: ignore[reportDeprecated],
)
)
self.delete = ( # pyright: ignore[reportDeprecated]
to_streamed_response_wrapper(
messages.delete # pyright: ignore[reportDeprecated],
messages.delete, # pyright: ignore[reportDeprecated],
)
)

Expand All @@ -693,26 +693,26 @@ def __init__(self, messages: AsyncMessages) -> None:

self.create = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
messages.create # pyright: ignore[reportDeprecated],
messages.create, # pyright: ignore[reportDeprecated],
)
)
self.retrieve = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
messages.retrieve # pyright: ignore[reportDeprecated],
messages.retrieve, # pyright: ignore[reportDeprecated],
)
)
self.update = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
messages.update # pyright: ignore[reportDeprecated],
messages.update, # pyright: ignore[reportDeprecated],
)
)
self.list = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
messages.list # pyright: ignore[reportDeprecated],
messages.list, # pyright: ignore[reportDeprecated],
)
)
self.delete = ( # pyright: ignore[reportDeprecated]
async_to_streamed_response_wrapper(
messages.delete # pyright: ignore[reportDeprecated],
messages.delete, # pyright: ignore[reportDeprecated],
)
)
Loading
Loading