We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bb95fe3 commit cbeebfcCopy full SHA for cbeebfc
src/openai/_utils/__init__.py
@@ -6,6 +6,7 @@
6
is_list as is_list,
7
is_given as is_given,
8
is_tuple as is_tuple,
9
+ lru_cache as lru_cache,
10
is_mapping as is_mapping,
11
is_tuple_t as is_tuple_t,
12
parse_date as parse_date,
src/openai/_utils/_utils.py
@@ -389,3 +389,11 @@ def get_async_library() -> str:
389
return sniffio.current_async_library()
390
except Exception:
391
return "false"
392
+
393
394
+def lru_cache(*, maxsize: int | None = 128) -> Callable[[CallableT], CallableT]:
395
+ """A version of functools.lru_cache that retains the type signature
396
+ for the wrapped function arguments.
397
+ """
398
+ wrapper = functools.lru_cache(maxsize=maxsize)
399
+ return cast(Any, wrapper) # type: ignore[no-any-return]
0 commit comments