abstractcore 2.30.0__tar.gz → 2.31.0__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.
- {abstractcore-2.30.0 → abstractcore-2.31.0}/PKG-INFO +5 -1
- {abstractcore-2.30.0 → abstractcore-2.31.0}/README.md +4 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/base.py +101 -21
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_native_session.py +38 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_provider.py +115 -1
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/openai_compatible_provider.py +1 -1
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/streaming.py +29 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/app.py +2 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/audio_endpoints.py +24 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/wire_naming.py +95 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/version.py +1 -1
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/PKG-INFO +5 -1
- {abstractcore-2.30.0 → abstractcore-2.31.0}/LICENSE +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/__main__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/app_config_utils.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/deepsearch.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/extractor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/intent.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/judge.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/apps/summarizer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/architectures/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/architectures/detection.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/architectures/enums.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/architectures/response_postprocessing.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/architectures/thinking_controls.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/OCRA.ttf +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/OCRB.ttf +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/OCRBL.ttf +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/README.md +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/abstractframework_identity.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/architecture_formats.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/bloc-schema.jsonld +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/model_capabilities.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/model_capabilities.schema.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/model_downloads_catalog.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/model_downloads_catalog.schema.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/semantic_models.md +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/assets/session_schema.json +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/errors.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/host.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/music_selectors.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/registry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/scene3d_selectors.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/types.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/capabilities/vision_catalog.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/bodystructure.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/client.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/context.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/discovery.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/errors.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/imap_codec.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/legacy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/limits.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/models.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/oauth.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/policy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/search.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/store.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/comms/email/vault.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/analytics.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/cache.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/config.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/exceptions.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/glyph_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/optimizer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/orchestrator.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/pil_text_renderer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/quality.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/text_formatter.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/compression/vision_compressor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/capability_defaults.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/email_cli.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/engines.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/host_jobs.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/main.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/manager.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/model_catalog.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/model_materializer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/model_verify.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/models_engines_cli.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/provider_profiles.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/recommendations.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/route_engines.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/config/vision_config.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/console/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/console/theme_sync.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/console/themes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/console/web.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/bloc_kv.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/bloc_metadata.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/cached_session.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/degeneration.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/endpoint_damping.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/enums.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/factory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/file_blocs.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/file_boxes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/generate_contract.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/interface.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/multimodal_generation.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/output_specs.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/retry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/session.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/core/types.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/download.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/embeddings/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/embeddings/manager.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/embeddings/models.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/endpoint/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/endpoint/app.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/events/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/exceptions/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/client.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/factory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/naming.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/stdio_client.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/mcp/tool_source.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/auto_handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/base.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/capabilities.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/delivery.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/enrichment.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/handlers/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/handlers/anthropic_handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/handlers/local_handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/handlers/openai_handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/openai_parts.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/pdf_routing.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/audio_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/direct_pdf_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/glyph_pdf_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/image_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/office_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/pdf_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/text_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/processors/video_processor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/types.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/utils/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/utils/image_scaler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/utils/video_frames.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/media/vision_fallback.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/basic_deepsearch.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/basic_extractor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/basic_intent.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/basic_judge.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/processing/basic_summarizer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/_http.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/anthropic_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/capability_host.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/endpoint_context.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/generation_cancel.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/generation_progress.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/hf_residency.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/huggingface_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/lmstudio_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_hy_v3.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_model_rules.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_native_cache.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_prefill_observer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_qwen4.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_residency.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_runtime.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/mlx_vision_addon.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/model_capabilities.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/model_config_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/ollama_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/openai_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/openrouter_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/portkey_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/process_residency.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/registry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/speculation.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/tokenizer_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/vllm_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/weights_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/py.typed +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/__main__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/auth_policy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/camera_endpoints.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/capability_generation.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/console_routes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/credentials.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/email_routes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/first_run.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/host_routes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/scene3d_endpoints.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/session_routes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/server/vision_endpoints.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/structured/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/structured/handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/structured/json_schema.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/structured/retry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/structured/schema_compat.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/testing/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/testing/mailserver.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/abstractignore.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/arg_canonicalizer.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/arg_coercion.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/browser_tools.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/code_analysis.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/common_tools.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/comms_tools.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/core.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/email_digests.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/fetch_url_ssrf.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/handler.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/inventory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/parser.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/process_tree.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/registry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/risk_facts.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/sandbox.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/shell_session.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/shell_tools.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/syntax_rewriter.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/tag_rewriter.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/telegram_tdlib.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/tools/telegram_tools.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/__init__.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/async_stream.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/cli.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/context_calibration.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/context_estimate.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/data_registry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/display.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/file_filters.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/host_profile.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/hostinfo.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/identity.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/install_settings.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/jsonish.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/memory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/message_preprocessor.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/model_cache.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/model_fit.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/residency.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/self_fixes.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/stdio.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/structured_logging.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/token_utils.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/trace_export.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/truncation.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/vlm_token_calculator.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/windows_dll.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/utils/workspace_paths.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/SOURCES.txt +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/dependency_links.txt +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/entry_points.txt +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/requires.txt +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore.egg-info/top_level.txt +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/pyproject.toml +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/setup.cfg +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_abstractendpoint_singleton_provider.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_agentic_cli_compatibility.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_basic_session.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_cache_dtype.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_endpoint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_engine_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_model_config_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_tokenizer_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_kv_weights_fingerprint.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_bloc_metadata_json_extract.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_cached_session_kv_mode.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_cached_session_kv_thinking_prefix.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_capabilities_registry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_capabilities_registry_preferred_backends_from_config.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_complete_integration.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_comprehensive_events.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_console_about.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_console_email_tab.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_console_web.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_core_components.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_display_rule.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_email_digests.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_embedding_model_token_warnings.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_enhanced_prompt.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_environment_variable_tool_call_tags.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_factory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_file_bloc_store_unit.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_file_boxes_cached_session.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_final_accuracy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_final_comprehensive.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_final_graceful_errors.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_generate_contract.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_generate_response_reasoning_property_unit.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_generate_with_outputs.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_graceful_fallback.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_import_debug.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_import_safety.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_incremental_thinking_tag_stripper.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_install_hints_no_bare_packages.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_install_settings.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_integrated_functionality.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_llms_sources.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_mcp_handshake.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_mcp_integration.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_mcp_stdio_client.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_multimodal_generate_output.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_openai_prompt_cache_key_passthrough.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_output_specs.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_packaging_assets.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_packaging_extras.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_prompt_cache_api.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_prompt_cache_bloc_composition.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_prompt_cache_bloc_e2e_gate.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_prompt_cache_control_plane.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_prompt_cache_prepare_modules_thinking_http.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_retry_observability.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_retry_strategy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_seed_determinism.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_seed_temperature_basic.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_sensory_prompting.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_server_prompt_cache_control_plane_proxy.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_server_prompt_cache_key_passthrough.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_session_reasoning_persistence_unit.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_sound_effect_seconds_route.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_structured_output_truncation_retry.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_text_only_model_experience.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_unload_memory.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_user_scenario_validation.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_voice_host_credentials.py +0 -0
- {abstractcore-2.30.0 → abstractcore-2.31.0}/tests/test_windows_host_fixes.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: abstractcore
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.31.0
|
|
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>
|
|
@@ -193,6 +193,10 @@ Dynamic: license-file
|
|
|
193
193
|
Unified LLM Interface
|
|
194
194
|
> Write once, run everywhere
|
|
195
195
|
|
|
196
|
+
What's new in 2.31.0: streamed tool calls carry the declared MCP tool name, the MLX prefix cache
|
|
197
|
+
survives per-call system riders in tool loops, and `POST /v1/voice/clone` takes `language`. See the
|
|
198
|
+
[changelog](CHANGELOG.md#2310---2026-10-27).
|
|
199
|
+
|
|
196
200
|
AbstractCore is an offline-capable, open-source-first LLM infrastructure layer
|
|
197
201
|
for Python applications. It gives you one `create_llm(...)` API across local
|
|
198
202
|
runtimes, self-hosted servers, cloud APIs, and OpenAI-compatible gateways.
|
|
@@ -9,6 +9,10 @@
|
|
|
9
9
|
Unified LLM Interface
|
|
10
10
|
> Write once, run everywhere
|
|
11
11
|
|
|
12
|
+
What's new in 2.31.0: streamed tool calls carry the declared MCP tool name, the MLX prefix cache
|
|
13
|
+
survives per-call system riders in tool loops, and `POST /v1/voice/clone` takes `language`. See the
|
|
14
|
+
[changelog](CHANGELOG.md#2310---2026-10-27).
|
|
15
|
+
|
|
12
16
|
AbstractCore is an offline-capable, open-source-first LLM infrastructure layer
|
|
13
17
|
for Python applications. It gives you one `create_llm(...)` API across local
|
|
14
18
|
runtimes, self-hosted servers, cloud APIs, and OpenAI-compatible gateways.
|
|
@@ -4996,27 +4996,7 @@ class BaseProvider(AbstractCoreInterface, ABC):
|
|
|
4996
4996
|
)
|
|
4997
4997
|
|
|
4998
4998
|
# Convert tools to ToolDefinition objects first (outside retry loop)
|
|
4999
|
-
converted_tools = None
|
|
5000
|
-
if tools:
|
|
5001
|
-
converted_tools = []
|
|
5002
|
-
for tool in tools:
|
|
5003
|
-
if hasattr(tool, "to_dict"): # ToolDefinition object
|
|
5004
|
-
converted_tools.append(tool.to_dict())
|
|
5005
|
-
elif callable(tool): # Function - check for enhanced metadata
|
|
5006
|
-
if hasattr(tool, "_tool_definition"):
|
|
5007
|
-
# Use the enhanced tool definition from @tool decorator
|
|
5008
|
-
converted_tools.append(tool._tool_definition.to_dict())
|
|
5009
|
-
else:
|
|
5010
|
-
# Fall back to basic conversion
|
|
5011
|
-
from ..tools.core import ToolDefinition
|
|
5012
|
-
|
|
5013
|
-
tool_def = ToolDefinition.from_function(tool)
|
|
5014
|
-
converted_tools.append(tool_def.to_dict())
|
|
5015
|
-
elif isinstance(tool, dict): # Already a dict
|
|
5016
|
-
converted_tools.append(tool)
|
|
5017
|
-
else:
|
|
5018
|
-
# Handle other types gracefully
|
|
5019
|
-
self.logger.warning(f"Unknown tool type: {type(tool)}, skipping")
|
|
4999
|
+
converted_tools = self._convert_request_tools(tools) if tools else None
|
|
5020
5000
|
|
|
5021
5001
|
# Handle tool execution control
|
|
5022
5002
|
should_execute_tools = execute_tools if execute_tools is not None else self.execute_tools
|
|
@@ -9017,6 +8997,30 @@ class BaseProvider(AbstractCoreInterface, ABC):
|
|
|
9017
8997
|
}
|
|
9018
8998
|
response.metadata = meta
|
|
9019
8999
|
|
|
9000
|
+
def _convert_request_tools(
|
|
9001
|
+
self, tools: Optional[List[Any]], *, warn_unknown: bool = True
|
|
9002
|
+
) -> List[Dict[str, Any]]:
|
|
9003
|
+
"""Request tools (ToolDefinition, @tool function, plain function, dict) as dicts."""
|
|
9004
|
+
converted: List[Dict[str, Any]] = []
|
|
9005
|
+
for tool in tools or []:
|
|
9006
|
+
if hasattr(tool, "to_dict"): # ToolDefinition object
|
|
9007
|
+
converted.append(tool.to_dict())
|
|
9008
|
+
elif callable(tool): # Function - check for enhanced metadata
|
|
9009
|
+
if hasattr(tool, "_tool_definition"):
|
|
9010
|
+
# Use the enhanced tool definition from @tool decorator
|
|
9011
|
+
converted.append(tool._tool_definition.to_dict())
|
|
9012
|
+
else:
|
|
9013
|
+
# Fall back to basic conversion
|
|
9014
|
+
from ..tools.core import ToolDefinition
|
|
9015
|
+
|
|
9016
|
+
converted.append(ToolDefinition.from_function(tool).to_dict())
|
|
9017
|
+
elif isinstance(tool, dict): # Already a dict
|
|
9018
|
+
converted.append(tool)
|
|
9019
|
+
elif warn_unknown:
|
|
9020
|
+
# Handle other types gracefully
|
|
9021
|
+
self.logger.warning(f"Unknown tool type: {type(tool)}, skipping")
|
|
9022
|
+
return converted
|
|
9023
|
+
|
|
9020
9024
|
def _get_allowed_tool_names(self, tools: List[Dict[str, Any]]) -> set[str]:
|
|
9021
9025
|
"""Extract allowed tool names from provider-normalized tool definitions."""
|
|
9022
9026
|
names: set[str] = set()
|
|
@@ -9554,6 +9558,25 @@ Please provide a structured response."""
|
|
|
9554
9558
|
prompt, messages, system_prompt, tools, media, stream, **kwargs
|
|
9555
9559
|
)
|
|
9556
9560
|
|
|
9561
|
+
# Native async lanes (OpenAI, OpenAI-compatible, Anthropic, Ollama
|
|
9562
|
+
# override `_agenerate_internal`) never cross the sync passthrough or
|
|
9563
|
+
# the UnifiedStreamProcessor, so their native calls still carry the
|
|
9564
|
+
# WIRE alias of a declared name. Restore it here for both stream modes
|
|
9565
|
+
# (backlog 0856); on the default lane the names are already declared
|
|
9566
|
+
# ones and this is a no-op.
|
|
9567
|
+
allowed_tool_names = (
|
|
9568
|
+
self._get_allowed_tool_names(self._convert_request_tools(tools, warn_unknown=False))
|
|
9569
|
+
if tools
|
|
9570
|
+
else set()
|
|
9571
|
+
)
|
|
9572
|
+
if (
|
|
9573
|
+
allowed_tool_names
|
|
9574
|
+
and not stream
|
|
9575
|
+
and isinstance(response, GenerateResponse)
|
|
9576
|
+
and response.tool_calls
|
|
9577
|
+
):
|
|
9578
|
+
self._restore_native_tool_call_names(response, allowed_tool_names)
|
|
9579
|
+
|
|
9557
9580
|
if (
|
|
9558
9581
|
thinking_meta
|
|
9559
9582
|
and not stream
|
|
@@ -9600,10 +9623,34 @@ Please provide a structured response."""
|
|
|
9600
9623
|
# Wrap the async stream so a terminal finish_reason=length chunk is
|
|
9601
9624
|
# annotated + warned before it reaches the consumer (mirror of the
|
|
9602
9625
|
# sync unified_stream per-chunk annotation).
|
|
9626
|
+
if allowed_tool_names:
|
|
9627
|
+
response = self._restore_async_stream_tool_names(response, allowed_tool_names)
|
|
9603
9628
|
return speculation_outcome_async_stream(self._annotate_async_stream(response), speculation_outcome)
|
|
9604
9629
|
|
|
9605
9630
|
return attach_speculation_outcome(response, speculation_outcome)
|
|
9606
9631
|
|
|
9632
|
+
async def _restore_async_stream_tool_names(
|
|
9633
|
+
self, source: "AsyncIterator[GenerateResponse]", allowed_tool_names: set[str]
|
|
9634
|
+
) -> "AsyncIterator[GenerateResponse]":
|
|
9635
|
+
"""Restore declared tool names on each chunk's native calls (backlog 0856).
|
|
9636
|
+
|
|
9637
|
+
Only names change, so partial deltas keep their ids and argument
|
|
9638
|
+
fragments. Lookups are memoized and unresolved names warned once per
|
|
9639
|
+
stream. When this generator is closed it closes its source."""
|
|
9640
|
+
cache: Dict[str, Optional[str]] = {}
|
|
9641
|
+
warned: set = set()
|
|
9642
|
+
try:
|
|
9643
|
+
async for chunk in source:
|
|
9644
|
+
if isinstance(chunk, GenerateResponse) and chunk.tool_calls:
|
|
9645
|
+
self._restore_native_tool_call_names(
|
|
9646
|
+
chunk, allowed_tool_names, cache=cache, warned=warned
|
|
9647
|
+
)
|
|
9648
|
+
yield chunk
|
|
9649
|
+
finally:
|
|
9650
|
+
aclose = getattr(source, "aclose", None)
|
|
9651
|
+
if aclose is not None:
|
|
9652
|
+
await aclose()
|
|
9653
|
+
|
|
9607
9654
|
async def _annotate_async_stream(
|
|
9608
9655
|
self, source: "AsyncIterator[GenerateResponse]"
|
|
9609
9656
|
) -> "AsyncIterator[GenerateResponse]":
|
|
@@ -9619,6 +9666,39 @@ Please provide a structured response."""
|
|
|
9619
9666
|
pass
|
|
9620
9667
|
yield chunk
|
|
9621
9668
|
|
|
9669
|
+
def _restore_native_tool_call_names(
|
|
9670
|
+
self,
|
|
9671
|
+
response: GenerateResponse,
|
|
9672
|
+
allowed_tool_names: set[str],
|
|
9673
|
+
*,
|
|
9674
|
+
cache: Optional[Dict[str, Optional[str]]] = None,
|
|
9675
|
+
warned: Optional[set] = None,
|
|
9676
|
+
) -> None:
|
|
9677
|
+
"""Wire alias -> declared name on `response.tool_calls`, in place on the response.
|
|
9678
|
+
|
|
9679
|
+
Same allowlist and warning as the sync stream (UnifiedStreamProcessor):
|
|
9680
|
+
a name no declared tool maps to is left as returned, for the host to refuse.
|
|
9681
|
+
"""
|
|
9682
|
+
from ..tools.wire_naming import restore_tool_call_names, unresolved_tool_name_warning
|
|
9683
|
+
|
|
9684
|
+
restored, unresolved = restore_tool_call_names(
|
|
9685
|
+
response.tool_calls, allowed_tool_names, cache=cache
|
|
9686
|
+
)
|
|
9687
|
+
response.tool_calls = restored
|
|
9688
|
+
if warned is not None:
|
|
9689
|
+
unresolved = [n for n in unresolved if n not in warned]
|
|
9690
|
+
warned.update(unresolved)
|
|
9691
|
+
if unresolved:
|
|
9692
|
+
meta = dict(response.metadata) if isinstance(response.metadata, dict) else {}
|
|
9693
|
+
warnings_list = list(meta.get("warnings") or []) if isinstance(meta.get("warnings"), list) else []
|
|
9694
|
+
for name in unresolved:
|
|
9695
|
+
message = unresolved_tool_name_warning(name, allowed_tool_names)
|
|
9696
|
+
if message not in warnings_list:
|
|
9697
|
+
warnings_list.append(message)
|
|
9698
|
+
self.logger.warning(message)
|
|
9699
|
+
meta["warnings"] = warnings_list
|
|
9700
|
+
response.metadata = meta
|
|
9701
|
+
|
|
9622
9702
|
async def _agenerate_internal(
|
|
9623
9703
|
self,
|
|
9624
9704
|
prompt: str,
|
|
@@ -57,6 +57,44 @@ CHECKPOINT_ENTRIES = 8
|
|
|
57
57
|
CHECKPOINT_GUARD_TOKENS = 8
|
|
58
58
|
|
|
59
59
|
|
|
60
|
+
class CheckpointGuardView:
|
|
61
|
+
"""ONE call's view of the session prefix cache, with its own checkpoint guard.
|
|
62
|
+
|
|
63
|
+
mlx-vlm places a hybrid model's single per-call snapshot at
|
|
64
|
+
`len(prompt) - manager.exact_cache_guard_tokens`
|
|
65
|
+
(`APCCoordinator.checkpoint_len`, read once when the stream starts). A
|
|
66
|
+
request whose prompt ENDS in per-call riders (non-leading system messages
|
|
67
|
+
the runtime re-injects at the tail on every call, e.g. the session
|
|
68
|
+
attachment index) needs the snapshot BEFORE those riders: the next call
|
|
69
|
+
re-renders them after its newly appended turns, so a snapshot that
|
|
70
|
+
contains them is never a prefix of anything and every call re-prefills
|
|
71
|
+
the whole conversation (measured on the operator's 27B run: 10 of 10 tool
|
|
72
|
+
loop calls cold, 24,552 tokens fed at step 10).
|
|
73
|
+
|
|
74
|
+
The guard is per call, so it lives on this view and never on the shared
|
|
75
|
+
manager: every other attribute and method resolves on the real manager
|
|
76
|
+
(its lock, budget, counters and snapshots stay one), and writes go to the
|
|
77
|
+
manager too.
|
|
78
|
+
"""
|
|
79
|
+
|
|
80
|
+
__slots__ = ("_manager", "exact_cache_guard_tokens")
|
|
81
|
+
|
|
82
|
+
def __init__(self, manager, guard_tokens: int):
|
|
83
|
+
object.__setattr__(self, "_manager", manager)
|
|
84
|
+
object.__setattr__(self, "exact_cache_guard_tokens", int(guard_tokens))
|
|
85
|
+
|
|
86
|
+
def __getattr__(self, name):
|
|
87
|
+
return getattr(object.__getattribute__(self, "_manager"), name)
|
|
88
|
+
|
|
89
|
+
def __setattr__(self, name, value):
|
|
90
|
+
if name == "exact_cache_guard_tokens":
|
|
91
|
+
raise AttributeError("a CheckpointGuardView's guard is fixed for its call")
|
|
92
|
+
setattr(object.__getattribute__(self, "_manager"), name, value)
|
|
93
|
+
|
|
94
|
+
def __copy__(self):
|
|
95
|
+
return CheckpointGuardView(object.__getattribute__(self, "_manager"), self.exact_cache_guard_tokens)
|
|
96
|
+
|
|
97
|
+
|
|
60
98
|
# Prefix-cache sizing rule (framework 0.9.3). mlx-vlm's automatic shape is
|
|
61
99
|
# budget = min(8 GiB, working_set/10) PLUS a reserve of max(1 GiB,
|
|
62
100
|
# working_set/10) that must stay free on top of every snapshot it retains.
|
|
@@ -3559,6 +3559,7 @@ class MLXProvider(BaseProvider):
|
|
|
3559
3559
|
self._mtp_last_result = None
|
|
3560
3560
|
self._mtp_last_apc = None
|
|
3561
3561
|
self._native_cache_key = None
|
|
3562
|
+
self._native_rider_tokens = None
|
|
3562
3563
|
self._mtp_call_block_size = getattr(self, "_mtp_block_size", None)
|
|
3563
3564
|
default = getattr(self, "_speculation_request", None)
|
|
3564
3565
|
if getattr(self, "_speculation_inherits_config", False):
|
|
@@ -3821,6 +3822,81 @@ class MLXProvider(BaseProvider):
|
|
|
3821
3822
|
seen.add(identity)
|
|
3822
3823
|
self._native_media_records = []
|
|
3823
3824
|
|
|
3825
|
+
def _native_rider_tail_tokens(
|
|
3826
|
+
self,
|
|
3827
|
+
*,
|
|
3828
|
+
full_prompt: Any,
|
|
3829
|
+
processed_prompt: Any,
|
|
3830
|
+
messages: Optional[List[Dict[str, Any]]],
|
|
3831
|
+
system_prompt: Optional[str],
|
|
3832
|
+
tools: Optional[List[Dict[str, Any]]],
|
|
3833
|
+
prefilled_modules: Optional[List[str]],
|
|
3834
|
+
enable_thinking: Optional[bool],
|
|
3835
|
+
reasoning_effort: Optional[str],
|
|
3836
|
+
) -> Tuple[Optional[int], Optional[str]]:
|
|
3837
|
+
"""`(tokens at the END of this prompt that belong to per-call riders, why unmeasured)`.
|
|
3838
|
+
|
|
3839
|
+
A RIDER is a trailing non-leading `system` message: context a host
|
|
3840
|
+
re-injects at the tail on EVERY call (the runtime's session attachment
|
|
3841
|
+
index, inbox guidance). It is the only part of a byte-stable request
|
|
3842
|
+
that moves between calls: call N+1 renders it AFTER the turns appended
|
|
3843
|
+
since call N. A hybrid model restores only an EXACT stored prefix, and
|
|
3844
|
+
the native lane stores ONE snapshot per call, `guard` tokens before the
|
|
3845
|
+
prompt's end. With a rider at the tail that snapshot contains the
|
|
3846
|
+
rider, is a prefix of no later prompt, and every call of the run
|
|
3847
|
+
re-prefills the whole conversation (operator run 2026-10-27: 10 of 10
|
|
3848
|
+
tool-loop calls cold, 24,552 tokens prefilled at step 10, while a run
|
|
3849
|
+
of the same session without attachments restored all but the new turns).
|
|
3850
|
+
|
|
3851
|
+
Measured, never estimated: the boundary is the longest common TOKEN
|
|
3852
|
+
prefix of the full prompt and the same request rendered without its
|
|
3853
|
+
riders (no generation prompt), so a rider the template merges into the
|
|
3854
|
+
previous turn and a BPE re-merge across the boundary are both counted.
|
|
3855
|
+
`(None, None)` (keep the default placement) when nothing trails or when the
|
|
3856
|
+
final turn is `prompt` (riders then do not trail). `(None, reason)` when
|
|
3857
|
+
riders trail but rendering or tokenization failed: the caller reports it.
|
|
3858
|
+
|
|
3859
|
+
Every trailing `system` message counts as a rider. A host whose trailing
|
|
3860
|
+
system message is DURABLE (present at the same place in the next call)
|
|
3861
|
+
re-prefills it plus the guard on the next call: bounded by its size, the
|
|
3862
|
+
price of never storing a snapshot that a per-call rider poisons.
|
|
3863
|
+
"""
|
|
3864
|
+
if isinstance(processed_prompt, str) and processed_prompt.strip():
|
|
3865
|
+
return None, None
|
|
3866
|
+
if not isinstance(full_prompt, str) or not isinstance(messages, list) or not messages:
|
|
3867
|
+
return None, None
|
|
3868
|
+
keep = len(messages)
|
|
3869
|
+
while keep > 0:
|
|
3870
|
+
last = messages[keep - 1]
|
|
3871
|
+
role = str(last.get("role") or "").strip().lower() if isinstance(last, dict) else ""
|
|
3872
|
+
if role not in ("system", "developer"):
|
|
3873
|
+
break
|
|
3874
|
+
keep -= 1
|
|
3875
|
+
if keep == len(messages) or keep == 0:
|
|
3876
|
+
return None, None
|
|
3877
|
+
try:
|
|
3878
|
+
head = self._build_prompt_fragment(
|
|
3879
|
+
prompt="",
|
|
3880
|
+
messages=list(messages[:keep]),
|
|
3881
|
+
system_prompt=system_prompt,
|
|
3882
|
+
tools=tools,
|
|
3883
|
+
add_generation_prompt=False,
|
|
3884
|
+
prefilled_modules=prefilled_modules,
|
|
3885
|
+
enable_thinking=enable_thinking,
|
|
3886
|
+
reasoning_effort=reasoning_effort,
|
|
3887
|
+
)
|
|
3888
|
+
except Exception as exc:
|
|
3889
|
+
return None, f"head render raised {type(exc).__name__}"
|
|
3890
|
+
full_ids = self._encode_prompt_token_ids(full_prompt)
|
|
3891
|
+
head_ids = self._encode_prompt_token_ids(head) if isinstance(head, str) else None
|
|
3892
|
+
if not full_ids or not head_ids:
|
|
3893
|
+
return None, "tokenization unavailable"
|
|
3894
|
+
boundary = self._token_lcp_len(full_ids, head_ids)
|
|
3895
|
+
tail = len(full_ids) - boundary
|
|
3896
|
+
if boundary <= 0 or tail <= 0:
|
|
3897
|
+
return None, "no common prefix with the rider-free render"
|
|
3898
|
+
return tail, None
|
|
3899
|
+
|
|
3824
3900
|
def _mtp_call_kwargs(self, kwargs: Dict[str, Any]) -> Dict[str, Any]:
|
|
3825
3901
|
"""Translate the mlx-lm call-site kwargs into mlx-vlm's vocabulary."""
|
|
3826
3902
|
out = dict(kwargs)
|
|
@@ -3862,9 +3938,22 @@ class MLXProvider(BaseProvider):
|
|
|
3862
3938
|
session = getattr(self, "_native_session", None) or getattr(self, "_native_qwen4", None)
|
|
3863
3939
|
if session is None:
|
|
3864
3940
|
raise ProviderAPIError("Native MLX prefix caching requires a loaded native session")
|
|
3865
|
-
|
|
3941
|
+
manager = session.prompt_cache(
|
|
3866
3942
|
memory_max_gb=getattr(self, "_mlx_cache_options", {}).get("memory_max_gb")
|
|
3867
3943
|
)
|
|
3944
|
+
# Consumed by the ONE call that measured it: a later out-of-call
|
|
3945
|
+
# user of these kwargs (cache warm-up, prefill) gets the default.
|
|
3946
|
+
rider_tokens = getattr(self, "_native_rider_tokens", None)
|
|
3947
|
+
self._native_rider_tokens = None
|
|
3948
|
+
if rider_tokens:
|
|
3949
|
+
# Snapshot BEFORE this call's trailing riders (see
|
|
3950
|
+
# `_native_rider_tail_tokens`), on top of the manager's own guard.
|
|
3951
|
+
from .mlx_native_session import CheckpointGuardView
|
|
3952
|
+
|
|
3953
|
+
manager = CheckpointGuardView(
|
|
3954
|
+
manager, int(manager.exact_cache_guard_tokens) + int(rider_tokens)
|
|
3955
|
+
)
|
|
3956
|
+
out["apc_manager"] = manager
|
|
3868
3957
|
out["apc_tenant"] = json.dumps([getattr(self, "_mlx_cache_scope", "local"), self._native_cache_key])
|
|
3869
3958
|
return out
|
|
3870
3959
|
|
|
@@ -5237,6 +5326,31 @@ class MLXProvider(BaseProvider):
|
|
|
5237
5326
|
# prompt. Never run mlx-lm's suffix/delta discipline on these states.
|
|
5238
5327
|
self._native_cache_key = str(prompt_cache_key)
|
|
5239
5328
|
cache_telemetry = {"mode": "key", "key": prompt_cache_key, "backend": "mlx_vlm_apc"}
|
|
5329
|
+
if getattr(self, "_native_runtime", None) is None:
|
|
5330
|
+
self._native_rider_tokens, unmeasured = self._native_rider_tail_tokens(
|
|
5331
|
+
full_prompt=full_prompt,
|
|
5332
|
+
processed_prompt=processed_prompt,
|
|
5333
|
+
messages=messages,
|
|
5334
|
+
system_prompt=system_prompt,
|
|
5335
|
+
tools=tools,
|
|
5336
|
+
prefilled_modules=prompt_cache_prefilled_modules,
|
|
5337
|
+
enable_thinking=mlx_enable_thinking if isinstance(mlx_enable_thinking, bool) else None,
|
|
5338
|
+
reasoning_effort=(
|
|
5339
|
+
mlx_reasoning_effort if isinstance(mlx_reasoning_effort, str) else None
|
|
5340
|
+
),
|
|
5341
|
+
)
|
|
5342
|
+
if self._native_rider_tokens:
|
|
5343
|
+
cache_telemetry["snapshot_excludes_tail_tokens"] = int(self._native_rider_tokens)
|
|
5344
|
+
elif unmeasured:
|
|
5345
|
+
# Riders trail but could not be measured: the snapshot keeps the
|
|
5346
|
+
# default placement and the next call will likely go cold. Say so.
|
|
5347
|
+
cache_telemetry["snapshot_rider_tail"] = f"#FALLBACK unmeasured: {unmeasured}"
|
|
5348
|
+
if not getattr(self, "_native_rider_unmeasured_warned", False):
|
|
5349
|
+
self._native_rider_unmeasured_warned = True
|
|
5350
|
+
self.logger.warning(
|
|
5351
|
+
"mlx: trailing system riders could not be measured (%s); the prefix "
|
|
5352
|
+
"snapshot contains them and the next call re-prefills" % unmeasured
|
|
5353
|
+
)
|
|
5240
5354
|
prompt_cache_key = None
|
|
5241
5355
|
# A turn whose prompt is fed as EMBEDDINGS must never enter key-mode delta
|
|
5242
5356
|
# feed. `_prepare_cache_delta_feed` matches by longest-common-prefix over
|
{abstractcore-2.30.0 → abstractcore-2.31.0}/abstractcore/providers/openai_compatible_provider.py
RENAMED
|
@@ -2326,7 +2326,7 @@ class OpenAICompatibleProvider(BaseProvider):
|
|
|
2326
2326
|
fields["reference_text"] = str(reference_text)
|
|
2327
2327
|
if validate is not None:
|
|
2328
2328
|
fields["validate"] = "true" if bool(validate) else "false"
|
|
2329
|
-
for key in ("consent",):
|
|
2329
|
+
for key in ("consent", "language"):
|
|
2330
2330
|
value = kwargs.get(key)
|
|
2331
2331
|
if value is not None:
|
|
2332
2332
|
fields[key] = str(value)
|
|
@@ -1482,6 +1482,8 @@ class UnifiedStreamProcessor:
|
|
|
1482
1482
|
metadata=_unparsed_metadata(chunk.metadata, unparsed),
|
|
1483
1483
|
)
|
|
1484
1484
|
|
|
1485
|
+
native_name_cache: Dict[str, Optional[str]] = {}
|
|
1486
|
+
native_name_warned: set = set()
|
|
1485
1487
|
for chunk in response_stream:
|
|
1486
1488
|
# The provider's TERMINAL chunk (finish_reason set) carries the
|
|
1487
1489
|
# accounting — usage, prompt-cache telemetry — and consumers read
|
|
@@ -1491,6 +1493,33 @@ class UnifiedStreamProcessor:
|
|
|
1491
1493
|
# overwritten by a synthetic "stop".
|
|
1492
1494
|
terminal = chunk.finish_reason is not None
|
|
1493
1495
|
|
|
1496
|
+
# Provider-emitted (native) calls carry the WIRE alias of a
|
|
1497
|
+
# declared name (`mcp::srv::tool` is declared as
|
|
1498
|
+
# `mcp_srv_tool_<hash>`). Restore the declared name here, the
|
|
1499
|
+
# one boundary every sync stream crosses with this request's
|
|
1500
|
+
# tools, under the same allowlist as the non-streaming
|
|
1501
|
+
# passthrough (backlog 0856). Only names change: complete calls
|
|
1502
|
+
# and partial deltas keep ids, indexes and argument fragments.
|
|
1503
|
+
if allowed_tool_names and isinstance(chunk.tool_calls, list) and chunk.tool_calls:
|
|
1504
|
+
from ..tools.wire_naming import (
|
|
1505
|
+
restore_tool_call_names,
|
|
1506
|
+
unresolved_tool_name_warning,
|
|
1507
|
+
)
|
|
1508
|
+
|
|
1509
|
+
restored_calls, unresolved = restore_tool_call_names(
|
|
1510
|
+
chunk.tool_calls, allowed_tool_names, cache=native_name_cache
|
|
1511
|
+
)
|
|
1512
|
+
chunk.tool_calls = restored_calls
|
|
1513
|
+
# Warn once per name per stream (Anthropic repeats the name
|
|
1514
|
+
# on every partial delta).
|
|
1515
|
+
unresolved = [n for n in unresolved if n not in native_name_warned]
|
|
1516
|
+
if unresolved:
|
|
1517
|
+
native_name_warned.update(unresolved)
|
|
1518
|
+
chunk.metadata = _with_warnings(
|
|
1519
|
+
chunk.metadata,
|
|
1520
|
+
[unresolved_tool_name_warning(n, allowed_tool_names) for n in unresolved],
|
|
1521
|
+
)
|
|
1522
|
+
|
|
1494
1523
|
if harmony is not None:
|
|
1495
1524
|
if isinstance(chunk.metadata, dict):
|
|
1496
1525
|
for _k in ("media_delivered", "media_dropped", "prompt_cache"):
|
|
@@ -1296,6 +1296,7 @@ def _custom_openapi() -> Dict[str, Any]:
|
|
|
1296
1296
|
"provider": None,
|
|
1297
1297
|
"name": "my_voice",
|
|
1298
1298
|
"reference_text": "Hello from AbstractCore voice cloning.",
|
|
1299
|
+
"language": None,
|
|
1299
1300
|
"validate": True,
|
|
1300
1301
|
"base_url": "http://127.0.0.1:5000/v1",
|
|
1301
1302
|
"clone_path": "/voice/clone",
|
|
@@ -1315,6 +1316,7 @@ def _custom_openapi() -> Dict[str, Any]:
|
|
|
1315
1316
|
"provider": None,
|
|
1316
1317
|
"name": "my_voice",
|
|
1317
1318
|
"reference_text": "Hello from AbstractCore voice cloning.",
|
|
1319
|
+
"language": None,
|
|
1318
1320
|
"validate": True,
|
|
1319
1321
|
"base_url": "http://127.0.0.1:5000/v1",
|
|
1320
1322
|
"clone_path": "/voice/clone",
|
|
@@ -2406,6 +2406,15 @@ async def voice_clone(
|
|
|
2406
2406
|
),
|
|
2407
2407
|
name: Optional[str] = Form(default=None, description="Friendly cloned voice name.", examples=["my_voice"]),
|
|
2408
2408
|
reference_text: Optional[str] = Form(default=None, description="Transcript of the reference audio when available.", examples=["Hello from AbstractCore voice cloning."]),
|
|
2409
|
+
language: Optional[str] = Form(
|
|
2410
|
+
default=None,
|
|
2411
|
+
description=(
|
|
2412
|
+
"Language of the recording (ISO 639-1). When omitted, the cloner identifies it from the "
|
|
2413
|
+
"transcript. Local cloning needs abstractvoice>=0.19.0 to record it; remote "
|
|
2414
|
+
"AbstractVoice-compatible servers receive it as a form field."
|
|
2415
|
+
),
|
|
2416
|
+
examples=["fr"],
|
|
2417
|
+
),
|
|
2409
2418
|
validate: Optional[bool] = Form(default=None, description="Ask compatible clone servers to validate the clone before returning.", examples=[True]),
|
|
2410
2419
|
base_url: Optional[str] = Form(
|
|
2411
2420
|
default=None,
|
|
@@ -2474,6 +2483,7 @@ async def voice_clone(
|
|
|
2474
2483
|
reference_text=_optional_text(reference_text),
|
|
2475
2484
|
validate=validate,
|
|
2476
2485
|
clone_path=path,
|
|
2486
|
+
language=_optional_text(language),
|
|
2477
2487
|
file_field=field,
|
|
2478
2488
|
consent=_optional_text(consent),
|
|
2479
2489
|
)
|
|
@@ -2482,9 +2492,13 @@ async def voice_clone(
|
|
|
2482
2492
|
return out
|
|
2483
2493
|
|
|
2484
2494
|
core = _voice_core_for_request(request, task="clone", engine=request_provider)
|
|
2495
|
+
language_s = _optional_text(language)
|
|
2485
2496
|
try:
|
|
2486
2497
|
out = core.voice.clone(
|
|
2487
2498
|
bytes(audio_bytes),
|
|
2499
|
+
# Only when stated: an absent language keeps the backend's own
|
|
2500
|
+
# identification (and the call unchanged for older plugins).
|
|
2501
|
+
**({"language": language_s} if language_s else {}),
|
|
2488
2502
|
name=_optional_text(name),
|
|
2489
2503
|
reference_text=_optional_text(reference_text),
|
|
2490
2504
|
consent=_optional_text(consent),
|
|
@@ -2540,6 +2554,15 @@ async def provider_voice_clone(
|
|
|
2540
2554
|
),
|
|
2541
2555
|
name: Optional[str] = Form(default=None, description="Friendly cloned voice name.", examples=["my_voice"]),
|
|
2542
2556
|
reference_text: Optional[str] = Form(default=None, description="Transcript of the reference audio when available.", examples=["Hello from AbstractCore voice cloning."]),
|
|
2557
|
+
language: Optional[str] = Form(
|
|
2558
|
+
default=None,
|
|
2559
|
+
description=(
|
|
2560
|
+
"Language of the recording (ISO 639-1). When omitted, the cloner identifies it from the "
|
|
2561
|
+
"transcript. Local cloning needs abstractvoice>=0.19.0 to record it; remote "
|
|
2562
|
+
"AbstractVoice-compatible servers receive it as a form field."
|
|
2563
|
+
),
|
|
2564
|
+
examples=["fr"],
|
|
2565
|
+
),
|
|
2543
2566
|
validate: Optional[bool] = Form(default=None, description="Ask compatible clone servers to validate the clone before returning.", examples=[True]),
|
|
2544
2567
|
base_url: Optional[str] = Form(
|
|
2545
2568
|
default=None,
|
|
@@ -2574,6 +2597,7 @@ async def provider_voice_clone(
|
|
|
2574
2597
|
provider=provider_s,
|
|
2575
2598
|
name=name,
|
|
2576
2599
|
reference_text=reference_text,
|
|
2600
|
+
language=language,
|
|
2577
2601
|
validate=validate,
|
|
2578
2602
|
base_url=base_url,
|
|
2579
2603
|
clone_path=clone_path,
|
|
@@ -24,6 +24,7 @@ from __future__ import annotations
|
|
|
24
24
|
import hashlib
|
|
25
25
|
import re
|
|
26
26
|
from copy import deepcopy
|
|
27
|
+
from dataclasses import is_dataclass, replace
|
|
27
28
|
from typing import Any, Dict, Iterable, List, Optional
|
|
28
29
|
|
|
29
30
|
# OpenAI function-name contract; Anthropic's is compatible with this subset.
|
|
@@ -159,3 +160,97 @@ def wire_safe_tool_history(messages: List[Dict[str, Any]]) -> List[Dict[str, Any
|
|
|
159
160
|
if isinstance(direct_name, str) and direct_name:
|
|
160
161
|
call["name"] = wire_safe_tool_name(direct_name)
|
|
161
162
|
return safe
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
def restore_tool_name(name: str, allowed_original_names: Iterable[str]) -> Optional[str]:
|
|
166
|
+
"""The declared tool a returned name means, under the response-normalization rules.
|
|
167
|
+
|
|
168
|
+
Exact match, then the wire alias of an allowed original
|
|
169
|
+
(``resolve_wire_tool_name``), then a namespaced/decorated spelling
|
|
170
|
+
(``map_namespaced_tool_name``). None when nothing in the allowlist maps:
|
|
171
|
+
the caller must leave the name as returned (the host refuses it).
|
|
172
|
+
"""
|
|
173
|
+
allowed = [n for n in (allowed_original_names or []) if isinstance(n, str) and n]
|
|
174
|
+
candidate = str(name or "").strip()
|
|
175
|
+
if not candidate or not allowed:
|
|
176
|
+
return None
|
|
177
|
+
if candidate in allowed:
|
|
178
|
+
return candidate
|
|
179
|
+
return resolve_wire_tool_name(candidate, allowed) or map_namespaced_tool_name(candidate, allowed)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
def restore_tool_call_names(
|
|
183
|
+
tool_calls: Any,
|
|
184
|
+
allowed_original_names: Iterable[str],
|
|
185
|
+
*,
|
|
186
|
+
cache: Optional[Dict[str, Optional[str]]] = None,
|
|
187
|
+
) -> "tuple[Any, List[str]]":
|
|
188
|
+
"""Restore declared names on provider-emitted (native) tool calls, nothing else.
|
|
189
|
+
|
|
190
|
+
Backlog 0856: the non-streaming passthrough restored wire aliases, streamed
|
|
191
|
+
native calls did not, so a host saw ``mcp_RAGnarok_query_b6ff8949`` and
|
|
192
|
+
refused it. This rewrites ONLY the name, wherever the call carries one (a
|
|
193
|
+
top-level ``name`` and/or ``function.name``), so it is safe on complete
|
|
194
|
+
calls and on partial deltas alike: ids, indexes and (possibly partial)
|
|
195
|
+
argument strings are untouched, a delta without a name passes through, and
|
|
196
|
+
the caller's dicts are copied, never mutated.
|
|
197
|
+
|
|
198
|
+
Returns ``(calls, unresolved_names)``. A name nothing in THIS request's
|
|
199
|
+
allowlist maps to is left as returned and listed in ``unresolved_names``.
|
|
200
|
+
``cache`` (one dict per request) memoizes lookups across a stream's
|
|
201
|
+
chunks: some providers repeat the full name on every partial delta.
|
|
202
|
+
"""
|
|
203
|
+
allowed = [n for n in (allowed_original_names or []) if isinstance(n, str) and n]
|
|
204
|
+
if not isinstance(tool_calls, list) or not tool_calls or not allowed:
|
|
205
|
+
return tool_calls, []
|
|
206
|
+
|
|
207
|
+
unresolved: List[str] = []
|
|
208
|
+
|
|
209
|
+
def _restored(raw: Any) -> Any:
|
|
210
|
+
if not isinstance(raw, str) or not raw.strip():
|
|
211
|
+
return raw
|
|
212
|
+
key = raw.strip()
|
|
213
|
+
if cache is not None and key in cache:
|
|
214
|
+
mapped = cache[key]
|
|
215
|
+
else:
|
|
216
|
+
mapped = restore_tool_name(raw, allowed)
|
|
217
|
+
if cache is not None:
|
|
218
|
+
cache[key] = mapped
|
|
219
|
+
if mapped is None:
|
|
220
|
+
unresolved.append(raw.strip())
|
|
221
|
+
return raw
|
|
222
|
+
return mapped
|
|
223
|
+
|
|
224
|
+
out: List[Any] = []
|
|
225
|
+
changed = False
|
|
226
|
+
for call in tool_calls:
|
|
227
|
+
if isinstance(call, dict):
|
|
228
|
+
new_call = call
|
|
229
|
+
if isinstance(call.get("name"), str):
|
|
230
|
+
restored = _restored(call["name"])
|
|
231
|
+
if restored != call["name"]:
|
|
232
|
+
new_call = dict(call)
|
|
233
|
+
new_call["name"] = restored
|
|
234
|
+
function = call.get("function")
|
|
235
|
+
if isinstance(function, dict) and isinstance(function.get("name"), str):
|
|
236
|
+
restored = _restored(function["name"])
|
|
237
|
+
if restored != function["name"]:
|
|
238
|
+
new_call = dict(new_call) if new_call is call else new_call
|
|
239
|
+
new_call["function"] = {**function, "name": restored}
|
|
240
|
+
changed = changed or new_call is not call
|
|
241
|
+
out.append(new_call)
|
|
242
|
+
continue
|
|
243
|
+
raw_name = getattr(call, "name", None)
|
|
244
|
+
restored = _restored(raw_name)
|
|
245
|
+
if restored != raw_name and is_dataclass(call) and not isinstance(call, type):
|
|
246
|
+
out.append(replace(call, name=restored))
|
|
247
|
+
changed = True
|
|
248
|
+
else:
|
|
249
|
+
out.append(call)
|
|
250
|
+
return (out if changed else tool_calls), list(dict.fromkeys(unresolved))
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
def unresolved_tool_name_warning(name: str, allowed_original_names: Iterable[str]) -> str:
|
|
254
|
+
"""The warning both streaming lanes attach when a returned name maps to no declared tool."""
|
|
255
|
+
available = ", ".join(sorted(n for n in allowed_original_names if isinstance(n, str) and n))
|
|
256
|
+
return f"Tool call '{name}' does not match any available tool (available: {available})."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: abstractcore
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.31.0
|
|
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>
|
|
@@ -193,6 +193,10 @@ Dynamic: license-file
|
|
|
193
193
|
Unified LLM Interface
|
|
194
194
|
> Write once, run everywhere
|
|
195
195
|
|
|
196
|
+
What's new in 2.31.0: streamed tool calls carry the declared MCP tool name, the MLX prefix cache
|
|
197
|
+
survives per-call system riders in tool loops, and `POST /v1/voice/clone` takes `language`. See the
|
|
198
|
+
[changelog](CHANGELOG.md#2310---2026-10-27).
|
|
199
|
+
|
|
196
200
|
AbstractCore is an offline-capable, open-source-first LLM infrastructure layer
|
|
197
201
|
for Python applications. It gives you one `create_llm(...)` API across local
|
|
198
202
|
runtimes, self-hosted servers, cloud APIs, and OpenAI-compatible gateways.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|