speedy-utils 1.1.19__tar.gz → 1.1.21__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/PKG-INFO +8 -8
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/pyproject.toml +8 -8
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/openai_memoize.py +9 -1
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/vector_cache/core.py +248 -232
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/utils_cache.py +37 -18
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/multi_worker/process.py +34 -9
- speedy_utils-1.1.21/tests/test_memoize_typing.py +76 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/.github/copilot-instructions.md +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/.github/workflows/publish.yml +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/.gitignore +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/.pre-commit-config.yaml +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/README.md +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/bumpversion.sh +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/ruff.toml +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/scripts/deploy.sh +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/setup.cfg +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/chat_format/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/chat_format/display.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/chat_format/transform.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/chat_format/utils.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/group_messages.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/_utils.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/async_llm_task.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/async_lm.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/async_lm_base.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/async_lm/lm_specific.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/base_prompt_builder.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/llm_task.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/lm.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/lm_base.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/lm/utils.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/scripts/README.md +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/scripts/vllm_load_balancer.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/scripts/vllm_serve.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/vector_cache/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/vector_cache/cli.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/vector_cache/types.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/llm_utils/vector_cache/utils.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/all.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/clock.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/function_decorator.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/logger.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/notebook_utils.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/patcher.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/report_manager.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/utils_io.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/utils_misc.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/common/utils_print.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/multi_worker/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/multi_worker/thread.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/scripts/__init__.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/scripts/mpython.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/src/speedy_utils/scripts/openapi_client_codegen.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/sample_objects.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_logger.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_logger_format.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_mpython.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_process.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_process_update.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/tests/test_thread.py +0 -0
- {speedy_utils-1.1.19 → speedy_utils-1.1.21}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: speedy-utils
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.21
|
|
4
4
|
Summary: Fast and easy-to-use package for data science
|
|
5
5
|
Project-URL: Homepage, https://github.com/anhvth/speedy
|
|
6
6
|
Project-URL: Repository, https://github.com/anhvth/speedy
|
|
@@ -18,26 +18,26 @@ Classifier: Programming Language :: Python :: 3.12
|
|
|
18
18
|
Classifier: Programming Language :: Python :: 3.13
|
|
19
19
|
Classifier: Programming Language :: Python :: 3.14
|
|
20
20
|
Requires-Python: >=3.8
|
|
21
|
-
Requires-Dist: aiohttp
|
|
21
|
+
Requires-Dist: aiohttp
|
|
22
22
|
Requires-Dist: bump2version
|
|
23
23
|
Requires-Dist: cachetools
|
|
24
24
|
Requires-Dist: debugpy
|
|
25
25
|
Requires-Dist: fastcore
|
|
26
26
|
Requires-Dist: fastprogress
|
|
27
|
-
Requires-Dist: freezegun
|
|
27
|
+
Requires-Dist: freezegun
|
|
28
28
|
Requires-Dist: ipdb
|
|
29
29
|
Requires-Dist: ipywidgets
|
|
30
|
-
Requires-Dist: json-repair
|
|
30
|
+
Requires-Dist: json-repair
|
|
31
31
|
Requires-Dist: jupyterlab
|
|
32
32
|
Requires-Dist: loguru
|
|
33
33
|
Requires-Dist: matplotlib
|
|
34
34
|
Requires-Dist: numpy
|
|
35
|
-
Requires-Dist: openai
|
|
36
|
-
Requires-Dist: packaging
|
|
35
|
+
Requires-Dist: openai
|
|
36
|
+
Requires-Dist: packaging
|
|
37
37
|
Requires-Dist: pandas
|
|
38
38
|
Requires-Dist: pydantic
|
|
39
|
-
Requires-Dist: pytest
|
|
40
|
-
Requires-Dist: ray
|
|
39
|
+
Requires-Dist: pytest
|
|
40
|
+
Requires-Dist: ray
|
|
41
41
|
Requires-Dist: requests
|
|
42
42
|
Requires-Dist: scikit-learn
|
|
43
43
|
Requires-Dist: tabulate
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "speedy-utils"
|
|
3
|
-
version = "1.1.
|
|
3
|
+
version = "1.1.21"
|
|
4
4
|
description = "Fast and easy-to-use package for data science"
|
|
5
5
|
authors = [{ name = "AnhVTH", email = "anhvth.226@gmail.com" }]
|
|
6
6
|
readme = "README.md"
|
|
@@ -24,14 +24,14 @@ dependencies = [
|
|
|
24
24
|
"tqdm",
|
|
25
25
|
"cachetools",
|
|
26
26
|
"bump2version",
|
|
27
|
-
"json-repair
|
|
27
|
+
"json-repair",
|
|
28
28
|
"fastprogress",
|
|
29
|
-
"freezegun
|
|
30
|
-
"packaging
|
|
31
|
-
"openai
|
|
32
|
-
"ray
|
|
33
|
-
"aiohttp
|
|
34
|
-
"pytest
|
|
29
|
+
"freezegun",
|
|
30
|
+
"packaging",
|
|
31
|
+
"openai",
|
|
32
|
+
"ray",
|
|
33
|
+
"aiohttp",
|
|
34
|
+
"pytest",
|
|
35
35
|
]
|
|
36
36
|
classifiers = [
|
|
37
37
|
"Development Status :: 4 - Beta",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
from openai import OpenAI, AsyncOpenAI
|
|
2
|
+
from typing import Any, Callable
|
|
2
3
|
|
|
3
4
|
from speedy_utils.common.utils_cache import memoize
|
|
4
5
|
|
|
@@ -30,6 +31,8 @@ class MOpenAI(OpenAI):
|
|
|
30
31
|
- If you need a shared cache across instances, or more advanced cache controls,
|
|
31
32
|
modify `memoize` or wrap at a class/static level instead of assigning to the
|
|
32
33
|
bound method.
|
|
34
|
+
- Type information is now fully preserved by the memoize decorator, eliminating
|
|
35
|
+
the need for type casting.
|
|
33
36
|
|
|
34
37
|
Example
|
|
35
38
|
m = MOpenAI(api_key="...", model="gpt-4")
|
|
@@ -40,7 +43,12 @@ class MOpenAI(OpenAI):
|
|
|
40
43
|
def __init__(self, *args, cache=True, **kwargs):
|
|
41
44
|
super().__init__(*args, **kwargs)
|
|
42
45
|
if cache:
|
|
43
|
-
|
|
46
|
+
# Create a memoized wrapper for the instance's post method.
|
|
47
|
+
# The memoize decorator now preserves exact type information,
|
|
48
|
+
# so no casting is needed.
|
|
49
|
+
orig_post = self.post
|
|
50
|
+
memoized = memoize(orig_post)
|
|
51
|
+
self.post = memoized
|
|
44
52
|
|
|
45
53
|
|
|
46
54
|
class MAsyncOpenAI(AsyncOpenAI):
|