abstractcore 2.6.5__py3-none-any.whl → 2.6.6__py3-none-any.whl

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.
@@ -3,6 +3,8 @@ Image scaling utility for AbstractCore media handling.
3
3
 
4
4
  Provides intelligent image scaling based on model-specific requirements
5
5
  and capabilities for vision models.
6
+
7
+ Requires: PIL (Pillow) - install with `pip install Pillow`
6
8
  """
7
9
 
8
10
  from typing import Tuple, Optional, Union, Dict, Any
@@ -11,9 +13,10 @@ from pathlib import Path
11
13
 
12
14
  try:
13
15
  from PIL import Image, ImageOps
14
- PIL_AVAILABLE = True
15
- except ImportError:
16
- PIL_AVAILABLE = False
16
+ except ImportError as e:
17
+ raise ImportError(
18
+ "PIL (Pillow) is required for image scaling. Install with: pip install Pillow"
19
+ ) from e
17
20
 
18
21
  from ..base import MediaProcessingError
19
22
  from ...utils.structured_logging import get_logger
@@ -38,9 +41,6 @@ class ModelOptimizedScaler:
38
41
  def __init__(self):
39
42
  self.logger = get_logger(__name__)
40
43
 
41
- if not PIL_AVAILABLE:
42
- raise MediaProcessingError("PIL (Pillow) is required for image scaling")
43
-
44
44
  def get_optimal_resolution(self, model_name: str, original_size: Tuple[int, int],
45
45
  model_capabilities: Optional[Dict[str, Any]] = None) -> Tuple[int, int]:
46
46
  """
@@ -11,4 +11,4 @@ including when the package is installed from PyPI where pyproject.toml is not av
11
11
 
12
12
  # Package version - update this when releasing new versions
13
13
  # This must be manually synchronized with the version in pyproject.toml
14
- __version__ = "2.6.5"
14
+ __version__ = "2.6.6"
@@ -22,9 +22,15 @@ References:
22
22
  import math
23
23
  from typing import Tuple, Dict, Any, Optional, List
24
24
  from pathlib import Path
25
- from PIL import Image
26
25
  import logging
27
26
 
27
+ try:
28
+ from PIL import Image
29
+ except ImportError as e:
30
+ raise ImportError(
31
+ "PIL (Pillow) is required for VLM token calculation. Install with: pip install Pillow"
32
+ ) from e
33
+
28
34
  from ..utils.structured_logging import get_logger
29
35
  from ..architectures.detection import get_model_capabilities, detect_architecture
30
36
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: abstractcore
3
- Version: 2.6.5
3
+ Version: 2.6.6
4
4
  Summary: Unified interface to all LLM providers with essential infrastructure for tool calling, streaming, and model management
5
5
  Author-email: Laurent-Philippe Albou <contact@abstractcore.ai>
6
6
  Maintainer-email: Laurent-Philippe Albou <contact@abstractcore.ai>
@@ -64,6 +64,7 @@ Requires-Dist: pymupdf4llm<1.0.0,>=0.0.20; extra == "media"
64
64
  Requires-Dist: unstructured[office]<1.0.0,>=0.10.0; extra == "media"
65
65
  Requires-Dist: pandas<3.0.0,>=1.0.0; extra == "media"
66
66
  Provides-Extra: compression
67
+ Requires-Dist: abstractcore[media]; extra == "compression"
67
68
  Requires-Dist: pdf2image<2.0.0,>=1.16.0; extra == "compression"
68
69
  Provides-Extra: api-providers
69
70
  Requires-Dist: abstractcore[anthropic,openai]; extra == "api-providers"
@@ -83,12 +84,18 @@ Provides-Extra: all-providers-apple
83
84
  Requires-Dist: abstractcore[anthropic,embeddings,huggingface,lmstudio,mlx,ollama,openai]; extra == "all-providers-apple"
84
85
  Provides-Extra: all-providers-gpu
85
86
  Requires-Dist: abstractcore[anthropic,embeddings,huggingface,lmstudio,ollama,openai,vllm]; extra == "all-providers-gpu"
87
+ Provides-Extra: all-providers-non-mlx
88
+ Requires-Dist: abstractcore[anthropic,embeddings,huggingface,lmstudio,ollama,openai]; extra == "all-providers-non-mlx"
89
+ Provides-Extra: local-providers-non-mlx
90
+ Requires-Dist: abstractcore[lmstudio,ollama]; extra == "local-providers-non-mlx"
86
91
  Provides-Extra: all
87
92
  Requires-Dist: abstractcore[anthropic,compression,dev,docs,embeddings,huggingface,lmstudio,media,mlx,ollama,openai,processing,server,test,tools,vllm]; extra == "all"
88
93
  Provides-Extra: all-apple
89
94
  Requires-Dist: abstractcore[anthropic,compression,dev,docs,embeddings,huggingface,lmstudio,media,mlx,ollama,openai,processing,server,test,tools]; extra == "all-apple"
90
95
  Provides-Extra: all-gpu
91
96
  Requires-Dist: abstractcore[anthropic,compression,dev,docs,embeddings,huggingface,lmstudio,media,ollama,openai,processing,server,test,tools,vllm]; extra == "all-gpu"
97
+ Provides-Extra: all-non-mlx
98
+ Requires-Dist: abstractcore[anthropic,compression,dev,docs,embeddings,huggingface,lmstudio,media,ollama,openai,processing,server,test,tools]; extra == "all-non-mlx"
92
99
  Provides-Extra: lightweight
93
100
  Requires-Dist: abstractcore[anthropic,compression,embeddings,lmstudio,media,ollama,openai,processing,server,tools]; extra == "lightweight"
94
101
  Provides-Extra: dev
@@ -1046,6 +1053,9 @@ pip install abstractcore[server]
1046
1053
  # With embeddings
1047
1054
  pip install abstractcore[embeddings]
1048
1055
 
1056
+ # With compression (Glyph visual-text compression)
1057
+ pip install abstractcore[compression]
1058
+
1049
1059
  # Everything (recommended for Apple Silicon)
1050
1060
  pip install abstractcore[all]
1051
1061
 
@@ -60,7 +60,7 @@ abstractcore/media/processors/office_processor.py,sha256=_aTrrDtREiy6MivbANFc1FK
60
60
  abstractcore/media/processors/pdf_processor.py,sha256=qniYt7cTYYPVRi_cS1IsXztOldeY0bqdn7sdbELBU9k,17157
61
61
  abstractcore/media/processors/text_processor.py,sha256=D84QWxxIou4MeNhERmCTxi_p27CgicVFhMXJiujZgIE,21905
62
62
  abstractcore/media/utils/__init__.py,sha256=30-CTif91iRKOXJ4njGiduWAt-xp31U7NafMBNvgdO0,460
63
- abstractcore/media/utils/image_scaler.py,sha256=jPdYd65K5oeo0YaXjOkmv-tvs6tNHYwxJCZ29vZqFDg,11367
63
+ abstractcore/media/utils/image_scaler.py,sha256=RWE2kPeURLEtJDK-Qs4KvZKtu-GkMLziFL9Vc9-aWjc,11388
64
64
  abstractcore/processing/__init__.py,sha256=QcACEnhnHKYCkFL1LNOW_uqBrwkTAmz5A61N4K2dyu0,988
65
65
  abstractcore/processing/basic_deepsearch.py,sha256=dzJQtH4k44XY9tvG0Z4JIlYt_s7HpbLdSPScha-t7vk,101036
66
66
  abstractcore/processing/basic_extractor.py,sha256=3x-3BdIHgLvqLnLF6K1-P4qVaLIpAnNIIutaJi7lDQM,49832
@@ -100,11 +100,11 @@ abstractcore/utils/self_fixes.py,sha256=1VYxPq-q7_DtNl39NbrzUmyHpkhb9Q2SdnXUj4c0
100
100
  abstractcore/utils/structured_logging.py,sha256=Vm-HviSa42G9DJCWmaEv4a0QG3NMsADD3ictLOs4En0,19952
101
101
  abstractcore/utils/token_utils.py,sha256=eLwFmJ68p9WMFD_MHLMmeJRW6Oqx_4hKELB8FNQ2Mnk,21097
102
102
  abstractcore/utils/trace_export.py,sha256=MD1DHDWltpewy62cYzz_OSPAA6edZbZq7_pZbvxz_H8,9279
103
- abstractcore/utils/version.py,sha256=bw_xqN48f_FOq8CRO369DqSiwKLeZ7sT8x-9FwxKe7Y,605
104
- abstractcore/utils/vlm_token_calculator.py,sha256=VBmIji_oiqOQ13IvVhNkb8E246tYMIXWVVOnl86Ne94,27978
105
- abstractcore-2.6.5.dist-info/licenses/LICENSE,sha256=PI2v_4HMvd6050uDD_4AY_8PzBnu2asa3RKbdDjowTA,1078
106
- abstractcore-2.6.5.dist-info/METADATA,sha256=BAyyNyC_zudt7B3Oqc0eVczlzvuW9_5fV6BA-ay9Hic,45179
107
- abstractcore-2.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
108
- abstractcore-2.6.5.dist-info/entry_points.txt,sha256=jXNdzeltVs23A2JM2e2HOiAHldHrsnud3EvPI5VffOs,658
109
- abstractcore-2.6.5.dist-info/top_level.txt,sha256=DiNHBI35SIawW3N9Z-z0y6cQYNbXd32pvBkW0RLfScs,13
110
- abstractcore-2.6.5.dist-info/RECORD,,
103
+ abstractcore/utils/version.py,sha256=Z8uyHNTgXcYjIz0T3S0B0d_LcOXgKpyd_2WS8Rg3MtU,605
104
+ abstractcore/utils/vlm_token_calculator.py,sha256=pIDc_iwJ4IrM_e8AxY2HDU8UdTYitBOXVhu0F-EaMTY,28144
105
+ abstractcore-2.6.6.dist-info/licenses/LICENSE,sha256=PI2v_4HMvd6050uDD_4AY_8PzBnu2asa3RKbdDjowTA,1078
106
+ abstractcore-2.6.6.dist-info/METADATA,sha256=Z4_SfHiSDLDXMDGLWdsd7cZASoZg2DtXgCQfnjrB6HA,45799
107
+ abstractcore-2.6.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
108
+ abstractcore-2.6.6.dist-info/entry_points.txt,sha256=jXNdzeltVs23A2JM2e2HOiAHldHrsnud3EvPI5VffOs,658
109
+ abstractcore-2.6.6.dist-info/top_level.txt,sha256=DiNHBI35SIawW3N9Z-z0y6cQYNbXd32pvBkW0RLfScs,13
110
+ abstractcore-2.6.6.dist-info/RECORD,,