abstractcore 2.9.1__py3-none-any.whl → 2.11.4__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.
- abstractcore/__init__.py +7 -27
- abstractcore/apps/deepsearch.py +9 -4
- abstractcore/apps/extractor.py +33 -100
- abstractcore/apps/intent.py +19 -0
- abstractcore/apps/judge.py +20 -1
- abstractcore/apps/summarizer.py +20 -1
- abstractcore/architectures/detection.py +34 -1
- abstractcore/architectures/response_postprocessing.py +313 -0
- abstractcore/assets/architecture_formats.json +38 -8
- abstractcore/assets/model_capabilities.json +882 -160
- abstractcore/compression/__init__.py +1 -2
- abstractcore/compression/glyph_processor.py +6 -4
- abstractcore/config/main.py +52 -20
- abstractcore/config/manager.py +390 -12
- abstractcore/config/vision_config.py +5 -5
- abstractcore/core/interface.py +151 -3
- abstractcore/core/session.py +16 -10
- abstractcore/download.py +1 -1
- abstractcore/embeddings/manager.py +20 -6
- abstractcore/endpoint/__init__.py +2 -0
- abstractcore/endpoint/app.py +458 -0
- abstractcore/mcp/client.py +3 -1
- abstractcore/media/__init__.py +52 -17
- abstractcore/media/auto_handler.py +42 -22
- abstractcore/media/base.py +44 -1
- abstractcore/media/capabilities.py +12 -33
- abstractcore/media/enrichment.py +105 -0
- abstractcore/media/handlers/anthropic_handler.py +19 -28
- abstractcore/media/handlers/local_handler.py +124 -70
- abstractcore/media/handlers/openai_handler.py +19 -31
- abstractcore/media/processors/__init__.py +4 -2
- abstractcore/media/processors/audio_processor.py +57 -0
- abstractcore/media/processors/office_processor.py +8 -3
- abstractcore/media/processors/pdf_processor.py +46 -3
- abstractcore/media/processors/text_processor.py +22 -24
- abstractcore/media/processors/video_processor.py +58 -0
- abstractcore/media/types.py +97 -4
- abstractcore/media/utils/image_scaler.py +20 -2
- abstractcore/media/utils/video_frames.py +219 -0
- abstractcore/media/vision_fallback.py +136 -22
- abstractcore/processing/__init__.py +32 -3
- abstractcore/processing/basic_deepsearch.py +15 -10
- abstractcore/processing/basic_intent.py +3 -2
- abstractcore/processing/basic_judge.py +3 -2
- abstractcore/processing/basic_summarizer.py +1 -1
- abstractcore/providers/__init__.py +3 -1
- abstractcore/providers/anthropic_provider.py +95 -8
- abstractcore/providers/base.py +1516 -81
- abstractcore/providers/huggingface_provider.py +546 -69
- abstractcore/providers/lmstudio_provider.py +30 -916
- abstractcore/providers/mlx_provider.py +382 -35
- abstractcore/providers/model_capabilities.py +5 -1
- abstractcore/providers/ollama_provider.py +99 -15
- abstractcore/providers/openai_compatible_provider.py +406 -180
- abstractcore/providers/openai_provider.py +188 -44
- abstractcore/providers/openrouter_provider.py +76 -0
- abstractcore/providers/registry.py +61 -5
- abstractcore/providers/streaming.py +138 -33
- abstractcore/providers/vllm_provider.py +92 -817
- abstractcore/server/app.py +478 -28
- abstractcore/server/audio_endpoints.py +139 -0
- abstractcore/server/vision_endpoints.py +1319 -0
- abstractcore/structured/handler.py +316 -41
- abstractcore/tools/common_tools.py +5501 -2012
- abstractcore/tools/comms_tools.py +1641 -0
- abstractcore/tools/core.py +37 -7
- abstractcore/tools/handler.py +4 -9
- abstractcore/tools/parser.py +49 -2
- abstractcore/tools/tag_rewriter.py +2 -1
- abstractcore/tools/telegram_tdlib.py +407 -0
- abstractcore/tools/telegram_tools.py +261 -0
- abstractcore/utils/cli.py +1085 -72
- abstractcore/utils/structured_logging.py +29 -8
- abstractcore/utils/token_utils.py +2 -0
- abstractcore/utils/truncation.py +29 -0
- abstractcore/utils/version.py +3 -4
- abstractcore/utils/vlm_token_calculator.py +12 -2
- abstractcore-2.11.4.dist-info/METADATA +562 -0
- abstractcore-2.11.4.dist-info/RECORD +133 -0
- {abstractcore-2.9.1.dist-info → abstractcore-2.11.4.dist-info}/WHEEL +1 -1
- {abstractcore-2.9.1.dist-info → abstractcore-2.11.4.dist-info}/entry_points.txt +1 -0
- abstractcore-2.9.1.dist-info/METADATA +0 -1190
- abstractcore-2.9.1.dist-info/RECORD +0 -119
- {abstractcore-2.9.1.dist-info → abstractcore-2.11.4.dist-info}/licenses/LICENSE +0 -0
- {abstractcore-2.9.1.dist-info → abstractcore-2.11.4.dist-info}/top_level.txt +0 -0
|
@@ -3,7 +3,7 @@ Glyph visual-text compression system for AbstractCore.
|
|
|
3
3
|
|
|
4
4
|
This module provides visual-text compression capabilities that transform long textual
|
|
5
5
|
sequences into optimized images for processing by Vision-Language Models (VLMs),
|
|
6
|
-
|
|
6
|
+
which can reduce token usage for long inputs (results vary by content/model/settings).
|
|
7
7
|
|
|
8
8
|
Based on the Glyph framework by Z.ai/THU-COAI with AbstractCore-specific enhancements.
|
|
9
9
|
"""
|
|
@@ -26,4 +26,3 @@ __all__ = [
|
|
|
26
26
|
'CompressionError',
|
|
27
27
|
'CompressionQualityError'
|
|
28
28
|
]
|
|
29
|
-
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
2
|
Glyph visual-text compression processor for AbstractCore.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
Renders long text into images for vision-capable models using a Pillow-based renderer.
|
|
5
|
+
|
|
6
|
+
This is an experimental feature; compression ratios and quality vary significantly by
|
|
7
|
+
content, model, and rendering settings.
|
|
6
8
|
"""
|
|
7
9
|
|
|
8
10
|
import time
|
|
@@ -29,7 +31,8 @@ class GlyphProcessor(BaseMediaHandler):
|
|
|
29
31
|
Glyph visual-text compression processor for AbstractCore.
|
|
30
32
|
|
|
31
33
|
Transforms long textual sequences into optimized images for processing
|
|
32
|
-
by Vision-Language Models (VLMs)
|
|
34
|
+
by Vision-Language Models (VLMs). This can reduce token usage for long inputs,
|
|
35
|
+
but results depend on content/model/OCR behavior.
|
|
33
36
|
"""
|
|
34
37
|
|
|
35
38
|
def __init__(self, config: Optional[GlyphConfig] = None, **kwargs):
|
|
@@ -378,4 +381,3 @@ class GlyphProcessor(BaseMediaHandler):
|
|
|
378
381
|
},
|
|
379
382
|
'provider_profiles': list(self.provider_profiles.keys())
|
|
380
383
|
}
|
|
381
|
-
|
abstractcore/config/main.py
CHANGED
|
@@ -265,9 +265,9 @@ def add_arguments(parser: argparse.ArgumentParser):
|
|
|
265
265
|
# Timeout configuration group
|
|
266
266
|
timeout_group = parser.add_argument_group('Timeout Configuration')
|
|
267
267
|
timeout_group.add_argument("--set-default-timeout", type=float, metavar="SECONDS",
|
|
268
|
-
help="Set default HTTP request timeout in seconds (default: 7200 = 2 hours)")
|
|
268
|
+
help="Set default HTTP request timeout in seconds (default: 7200 = 2 hours; 0 = unlimited)")
|
|
269
269
|
timeout_group.add_argument("--set-tool-timeout", type=float, metavar="SECONDS",
|
|
270
|
-
help="Set tool execution timeout in seconds (default: 600 = 10 minutes)")
|
|
270
|
+
help="Set tool execution timeout in seconds (default: 600 = 10 minutes; 0 = unlimited)")
|
|
271
271
|
|
|
272
272
|
def print_status():
|
|
273
273
|
"""Print comprehensive configuration status with improved readability."""
|
|
@@ -463,8 +463,8 @@ def print_status():
|
|
|
463
463
|
print("│ abstractcore --set-default-cache-dir PATH")
|
|
464
464
|
print("│")
|
|
465
465
|
print("│ ⏱️ Performance & Timeouts")
|
|
466
|
-
print("│ abstractcore --set-default-timeout SECONDS (HTTP requests, default: 7200)")
|
|
467
|
-
print("│ abstractcore --set-tool-timeout SECONDS (Tool execution, default: 600)")
|
|
466
|
+
print("│ abstractcore --set-default-timeout SECONDS (HTTP requests, default: 7200; 0 = unlimited)")
|
|
467
|
+
print("│ abstractcore --set-tool-timeout SECONDS (Tool execution, default: 600; 0 = unlimited)")
|
|
468
468
|
print("│")
|
|
469
469
|
print("│ 🎯 Specialized Models")
|
|
470
470
|
print("│ abstractcore --set-chat-model PROVIDER/MODEL")
|
|
@@ -525,12 +525,32 @@ def interactive_configure():
|
|
|
525
525
|
print("\n3. API Keys Setup")
|
|
526
526
|
api_choice = input("Configure API keys? [y/N]: ").lower().strip()
|
|
527
527
|
if api_choice == 'y':
|
|
528
|
-
for provider in ["openai", "anthropic", "google"]:
|
|
528
|
+
for provider in ["openai", "anthropic", "openrouter", "google"]:
|
|
529
529
|
key = input(f"Enter {provider} API key (or press Enter to skip): ").strip()
|
|
530
530
|
if key:
|
|
531
531
|
config_manager.set_api_key(provider, key)
|
|
532
532
|
print(f"✅ Set {provider} API key")
|
|
533
533
|
|
|
534
|
+
# Ask about console log verbosity
|
|
535
|
+
print("\n4. Console Logging Verbosity")
|
|
536
|
+
print("Choose console verbosity level:")
|
|
537
|
+
print(" none | error | warning | info | debug")
|
|
538
|
+
level = input("Console log level [info]: ").strip().lower()
|
|
539
|
+
if not level:
|
|
540
|
+
level = "info"
|
|
541
|
+
level_map = {
|
|
542
|
+
"none": "NONE",
|
|
543
|
+
"error": "ERROR",
|
|
544
|
+
"warning": "WARNING",
|
|
545
|
+
"info": "INFO",
|
|
546
|
+
"debug": "DEBUG",
|
|
547
|
+
}
|
|
548
|
+
if level in level_map:
|
|
549
|
+
config_manager.set_console_log_level(level_map[level])
|
|
550
|
+
print(f"✅ Set console log level to: {level_map[level]}")
|
|
551
|
+
else:
|
|
552
|
+
print("⚠️ Invalid level; keeping existing console log level.")
|
|
553
|
+
|
|
534
554
|
print("\n✅ Configuration complete! Run 'abstractcore --status' to see current settings.")
|
|
535
555
|
|
|
536
556
|
def handle_commands(args) -> bool:
|
|
@@ -727,32 +747,44 @@ def handle_commands(args) -> bool:
|
|
|
727
747
|
handled = True
|
|
728
748
|
|
|
729
749
|
# Timeout configuration
|
|
730
|
-
|
|
750
|
+
# #[WARNING:TIMEOUT]
|
|
751
|
+
if args.set_default_timeout is not None:
|
|
731
752
|
try:
|
|
732
|
-
config_manager.set_default_timeout(args.set_default_timeout)
|
|
753
|
+
ok = config_manager.set_default_timeout(args.set_default_timeout)
|
|
754
|
+
if not ok:
|
|
755
|
+
raise RuntimeError("Configuration update failed")
|
|
733
756
|
# Format display (show in minutes if >= 60 seconds)
|
|
734
|
-
if args.set_default_timeout
|
|
757
|
+
if args.set_default_timeout <= 0:
|
|
758
|
+
display = "unlimited"
|
|
759
|
+
elif args.set_default_timeout >= 60:
|
|
735
760
|
minutes = args.set_default_timeout / 60
|
|
736
761
|
display = f"{minutes:.1f} minutes" if minutes != int(minutes) else f"{int(minutes)} minutes"
|
|
737
762
|
else:
|
|
738
763
|
display = f"{args.set_default_timeout} seconds"
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
764
|
+
suffix = "" if args.set_default_timeout <= 0 else f" ({args.set_default_timeout}s)"
|
|
765
|
+
print(f"✅ Set default HTTP timeout to: {display}{suffix}")
|
|
766
|
+
except Exception as e:
|
|
767
|
+
print(f"❌ Failed to set default HTTP timeout: {e}")
|
|
742
768
|
handled = True
|
|
743
769
|
|
|
744
|
-
|
|
770
|
+
# #[WARNING:TIMEOUT]
|
|
771
|
+
if args.set_tool_timeout is not None:
|
|
745
772
|
try:
|
|
746
|
-
config_manager.set_tool_timeout(args.set_tool_timeout)
|
|
773
|
+
ok = config_manager.set_tool_timeout(args.set_tool_timeout)
|
|
774
|
+
if not ok:
|
|
775
|
+
raise RuntimeError("Configuration update failed")
|
|
747
776
|
# Format display (show in minutes if >= 60 seconds)
|
|
748
|
-
if args.set_tool_timeout
|
|
777
|
+
if args.set_tool_timeout <= 0:
|
|
778
|
+
display = "unlimited"
|
|
779
|
+
elif args.set_tool_timeout >= 60:
|
|
749
780
|
minutes = args.set_tool_timeout / 60
|
|
750
781
|
display = f"{minutes:.1f} minutes" if minutes != int(minutes) else f"{int(minutes)} minutes"
|
|
751
782
|
else:
|
|
752
783
|
display = f"{args.set_tool_timeout} seconds"
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
784
|
+
suffix = "" if args.set_tool_timeout <= 0 else f" ({args.set_tool_timeout}s)"
|
|
785
|
+
print(f"✅ Set tool execution timeout to: {display}{suffix}")
|
|
786
|
+
except Exception as e:
|
|
787
|
+
print(f"❌ Failed to set tool execution timeout: {e}")
|
|
756
788
|
handled = True
|
|
757
789
|
|
|
758
790
|
return handled
|
|
@@ -795,7 +827,7 @@ COMMON TASKS:
|
|
|
795
827
|
|
|
796
828
|
SPECIALIZED MODELS:
|
|
797
829
|
abstractcore --set-chat-model openai/gpt-4o-mini # For chat applications
|
|
798
|
-
abstractcore --set-code-model anthropic/claude-
|
|
830
|
+
abstractcore --set-code-model anthropic/claude-haiku-4-5 # For coding tasks (cost-effective default)
|
|
799
831
|
|
|
800
832
|
PRIORITY SYSTEM:
|
|
801
833
|
1. Explicit parameters (highest): summarizer doc.pdf --provider openai --model gpt-4o
|
|
@@ -839,5 +871,5 @@ DOCUMENTATION: docs/centralized-config.md
|
|
|
839
871
|
|
|
840
872
|
|
|
841
873
|
if __name__ == "__main__":
|
|
842
|
-
logging.basicConfig(level=logging.
|
|
843
|
-
sys.exit(main())
|
|
874
|
+
logging.basicConfig(level=logging.ERROR)
|
|
875
|
+
sys.exit(main())
|