speedy-utils 1.1.19__tar.gz → 1.1.20__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.
Files changed (67) hide show
  1. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/PKG-INFO +8 -8
  2. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/pyproject.toml +8 -8
  3. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/openai_memoize.py +9 -1
  4. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/vector_cache/core.py +248 -232
  5. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/utils_cache.py +37 -18
  6. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/multi_worker/process.py +32 -8
  7. speedy_utils-1.1.20/tests/test_memoize_typing.py +76 -0
  8. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/.github/copilot-instructions.md +0 -0
  9. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/.github/workflows/publish.yml +0 -0
  10. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/.gitignore +0 -0
  11. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/.pre-commit-config.yaml +0 -0
  12. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/README.md +0 -0
  13. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/bumpversion.sh +0 -0
  14. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/ruff.toml +0 -0
  15. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/scripts/deploy.sh +0 -0
  16. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/setup.cfg +0 -0
  17. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/__init__.py +0 -0
  18. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/chat_format/__init__.py +0 -0
  19. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/chat_format/display.py +0 -0
  20. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/chat_format/transform.py +0 -0
  21. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/chat_format/utils.py +0 -0
  22. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/group_messages.py +0 -0
  23. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/__init__.py +0 -0
  24. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/__init__.py +0 -0
  25. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/_utils.py +0 -0
  26. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/async_llm_task.py +0 -0
  27. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/async_lm.py +0 -0
  28. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/async_lm_base.py +0 -0
  29. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/async_lm/lm_specific.py +0 -0
  30. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/base_prompt_builder.py +0 -0
  31. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/llm_task.py +0 -0
  32. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/lm.py +0 -0
  33. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/lm_base.py +0 -0
  34. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/lm/utils.py +0 -0
  35. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/scripts/README.md +0 -0
  36. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/scripts/vllm_load_balancer.py +0 -0
  37. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/scripts/vllm_serve.py +0 -0
  38. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/vector_cache/__init__.py +0 -0
  39. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/vector_cache/cli.py +0 -0
  40. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/vector_cache/types.py +0 -0
  41. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/llm_utils/vector_cache/utils.py +0 -0
  42. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/__init__.py +0 -0
  43. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/all.py +0 -0
  44. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/__init__.py +0 -0
  45. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/clock.py +0 -0
  46. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/function_decorator.py +0 -0
  47. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/logger.py +0 -0
  48. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/notebook_utils.py +0 -0
  49. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/patcher.py +0 -0
  50. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/report_manager.py +0 -0
  51. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/utils_io.py +0 -0
  52. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/utils_misc.py +0 -0
  53. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/common/utils_print.py +0 -0
  54. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/multi_worker/__init__.py +0 -0
  55. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/multi_worker/thread.py +0 -0
  56. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/scripts/__init__.py +0 -0
  57. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/scripts/mpython.py +0 -0
  58. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/src/speedy_utils/scripts/openapi_client_codegen.py +0 -0
  59. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/sample_objects.py +0 -0
  60. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test.py +0 -0
  61. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_logger.py +0 -0
  62. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_logger_format.py +0 -0
  63. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_mpython.py +0 -0
  64. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_process.py +0 -0
  65. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_process_update.py +0 -0
  66. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/tests/test_thread.py +0 -0
  67. {speedy_utils-1.1.19 → speedy_utils-1.1.20}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: speedy-utils
3
- Version: 1.1.19
3
+ Version: 1.1.20
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>=3.10.11
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>=1.5.1
27
+ Requires-Dist: freezegun
28
28
  Requires-Dist: ipdb
29
29
  Requires-Dist: ipywidgets
30
- Requires-Dist: json-repair<0.31.0,>=0.25.0
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>=1.106.0
36
- Requires-Dist: packaging<25,>=23.2
35
+ Requires-Dist: openai
36
+ Requires-Dist: packaging
37
37
  Requires-Dist: pandas
38
38
  Requires-Dist: pydantic
39
- Requires-Dist: pytest>=8.3.5
40
- Requires-Dist: ray>=2.36.1
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.19"
3
+ version = "1.1.20"
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>=0.25.0,<0.31.0",
27
+ "json-repair",
28
28
  "fastprogress",
29
- "freezegun>=1.5.1",
30
- "packaging>=23.2,<25",
31
- "openai>=1.106.0",
32
- "ray>=2.36.1",
33
- "aiohttp>=3.10.11",
34
- "pytest>=8.3.5",
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
- self.post = memoize(self.post) # type: ignore
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):