diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9e1cdeda32..e5c9603757 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.21.1" + ".": "1.21.2" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 20e8976936..889e26f7d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 1.21.2 (2024-04-17) + +Full Changelog: [v1.21.1...v1.21.2](https://github.com/openai/openai-python/compare/v1.21.1...v1.21.2) + +### Chores + +* **internal:** add lru_cache helper function ([#1329](https://github.com/openai/openai-python/issues/1329)) ([cbeebfc](https://github.com/openai/openai-python/commit/cbeebfcca8bf1a3feb4462a79e10099bda5bed84)) + ## 1.21.1 (2024-04-17) Full Changelog: [v1.21.0...v1.21.1](https://github.com/openai/openai-python/compare/v1.21.0...v1.21.1) diff --git a/pyproject.toml b/pyproject.toml index 0ab25048b1..b593179128 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "openai" -version = "1.21.1" +version = "1.21.2" description = "The official Python library for the openai API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/openai/_utils/__init__.py b/src/openai/_utils/__init__.py index 5697894192..31b5b22799 100644 --- a/src/openai/_utils/__init__.py +++ b/src/openai/_utils/__init__.py @@ -6,6 +6,7 @@ is_list as is_list, is_given as is_given, is_tuple as is_tuple, + lru_cache as lru_cache, is_mapping as is_mapping, is_tuple_t as is_tuple_t, parse_date as parse_date, diff --git a/src/openai/_utils/_utils.py b/src/openai/_utils/_utils.py index 93c95517a9..5123a230f1 100644 --- a/src/openai/_utils/_utils.py +++ b/src/openai/_utils/_utils.py @@ -389,3 +389,11 @@ def get_async_library() -> str: return sniffio.current_async_library() except Exception: return "false" + + +def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]: + """A version of functools.lru_cache that retains the type signature + for the wrapped function arguments. + """ + wrapper = functools.lru_cache(maxsize=maxsize) + return cast(Any, wrapper) # type: ignore[no-any-return] diff --git a/src/openai/_version.py b/src/openai/_version.py index 4bb6604548..df70bd1a2c 100644 --- a/src/openai/_version.py +++ b/src/openai/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "openai" -__version__ = "1.21.1" # x-release-please-version +__version__ = "1.21.2" # x-release-please-version