Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: openai/openai-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.68.0
Choose a base ref
...
head repository: openai/openai-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.68.1
Choose a head ref
  • 6 commits
  • 13 files changed
  • 2 contributors

Commits on Mar 21, 2025

  1. Copy the full SHA
    916641e View commit details
  2. codegen metadata

    stainless-app[bot] committed Mar 21, 2025
    Copy the full SHA
    35e0e11 View commit details
  3. Copy the full SHA
    dbf975c View commit details
  4. Copy the full SHA
    751d739 View commit details
  5. Copy the full SHA
    044f192 View commit details
  6. release: 1.68.1

    stainless-app[bot] committed Mar 21, 2025
    Copy the full SHA
    d55062a View commit details
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ on:
pull_request:
branches:
- main
- next

jobs:
lint:
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.68.0"
".": "1.68.1"
}
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 82
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-c22f59c66aec7914b6ee653d3098d1c1c8c16c180d2a158e819c8ddbf476f74b.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-5ad6884898c07591750dde560118baf7074a59aecd1f367f930c5e42b04e848a.yml
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.68.1 (2025-03-21)

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

### Bug Fixes

* **client:** remove duplicate types ([#2235](https://github.com/openai/openai-python/issues/2235)) ([063f7d0](https://github.com/openai/openai-python/commit/063f7d0684c350ca9d766e2cb150233a22a623c8))
* **helpers/audio:** remove duplicative module ([f253d04](https://github.com/openai/openai-python/commit/f253d0415145f2c4904ea2e7b389d31d94e45a54))
* **package:** make sounddevice and numpy optional dependencies ([8b04453](https://github.com/openai/openai-python/commit/8b04453f0483736c13f0209a9f8f3618bc0e86c9))


### Chores

* **ci:** run workflows on next too ([67f89d4](https://github.com/openai/openai-python/commit/67f89d478aab780d1481c9bf6682c6633e431137))

## 1.68.0 (2025-03-20)

Full Changelog: [v1.67.0...v1.68.0](https://github.com/openai/openai-python/compare/v1.67.0...v1.68.0)
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "openai"
version = "1.68.0"
version = "1.68.1"
description = "The official Python library for the openai API"
dynamic = ["readme"]
license = "Apache-2.0"
@@ -16,8 +16,6 @@ dependencies = [
"sniffio",
"tqdm > 4",
"jiter>=0.4.0, <1",
"sounddevice>=0.5.1",
"numpy>=2.0.2",
]
requires-python = ">= 3.8"
classifiers = [
@@ -47,6 +45,7 @@ openai = "openai.cli:main"
[project.optional-dependencies]
realtime = ["websockets >= 13, < 15"]
datalib = ["numpy >= 1", "pandas >= 1.2.3", "pandas-stubs >= 1.1.0.11"]
audio = ["sounddevice>=0.5.1", "numpy>=2.0.2"]

[tool.rye]
managed = true
1 change: 1 addition & 0 deletions src/openai/_extras/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
from .numpy_proxy import numpy as numpy, has_numpy as has_numpy
from .pandas_proxy import pandas as pandas
from .sounddevice_proxy import sounddevice as sounddevice
2 changes: 1 addition & 1 deletion src/openai/_extras/numpy_proxy.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
import numpy as numpy


NUMPY_INSTRUCTIONS = format_instructions(library="numpy", extra="datalib")
NUMPY_INSTRUCTIONS = format_instructions(library="numpy", extra="audio")


class NumpyProxy(LazyProxy[Any]):
28 changes: 28 additions & 0 deletions src/openai/_extras/sounddevice_proxy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Any
from typing_extensions import override

from .._utils import LazyProxy
from ._common import MissingDependencyError, format_instructions

if TYPE_CHECKING:
import sounddevice as sounddevice # type: ignore


SOUNDDEVICE_INSTRUCTIONS = format_instructions(library="sounddevice", extra="audio")


class SounddeviceProxy(LazyProxy[Any]):
@override
def __load__(self) -> Any:
try:
import sounddevice # type: ignore
except ImportError as err:
raise MissingDependencyError(SOUNDDEVICE_INSTRUCTIONS) from err

return sounddevice


if not TYPE_CHECKING:
sounddevice = SounddeviceProxy()
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.68.0" # x-release-please-version
__version__ = "1.68.1" # x-release-please-version
4 changes: 0 additions & 4 deletions src/openai/helpers.py

This file was deleted.

13 changes: 8 additions & 5 deletions src/openai/helpers/local_audio_player.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# mypy: ignore-errors
from __future__ import annotations

import queue
import asyncio
from typing import Any, Union, Callable, AsyncGenerator, cast

import numpy as np
import sounddevice as sd # type: ignore
import numpy.typing as npt
from typing_extensions import TYPE_CHECKING

from .. import _legacy_response
from .._extras import numpy as np, sounddevice as sd
from .._response import StreamedBinaryAPIResponse, AsyncStreamedBinaryAPIResponse

if TYPE_CHECKING:
import numpy.typing as npt

SAMPLE_RATE = 24000


@@ -62,7 +65,7 @@ async def play(
if input.dtype == np.int16 and self.dtype == np.float32:
audio_content = (input.astype(np.float32) / 32767.0).reshape(-1, self.channels)
elif input.dtype == np.float32:
audio_content = cast(npt.NDArray[np.float32], input)
audio_content = cast('npt.NDArray[np.float32]', input)
else:
raise ValueError(f"Unsupported dtype: {input.dtype}")
else:
12 changes: 7 additions & 5 deletions src/openai/helpers/microphone.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# mypy: ignore-errors
from __future__ import annotations

import io
import time
import wave
import asyncio
from typing import Any, Type, Union, Generic, TypeVar, Callable, overload
from typing_extensions import Literal
from typing_extensions import TYPE_CHECKING, Literal

import numpy as np
import sounddevice as sd # type: ignore
import numpy.typing as npt
from .._types import FileTypes, FileContent
from .._extras import numpy as np, sounddevice as sd

from openai._types import FileTypes, FileContent
if TYPE_CHECKING:
import numpy.typing as npt

SAMPLE_RATE = 24000

6 changes: 1 addition & 5 deletions src/openai/types/shared/all_models.py
Original file line number Diff line number Diff line change
@@ -8,9 +8,5 @@
__all__ = ["AllModels"]

AllModels: TypeAlias = Union[
str,
ChatModel,
str,
ChatModel,
Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"],
str, ChatModel, Literal["o1-pro", "o1-pro-2025-03-19", "computer-use-preview", "computer-use-preview-2025-03-11"]
]