swarmauri-base 0.11.0.dev6__tar.gz → 0.11.0.dev11__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.
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/PKG-INFO +24 -2
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/README.md +21 -1
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/pyproject.toml +4 -3
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ComponentBase.py +1 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/agents/AgentCompactionMixin.py +89 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/conversations/ConversationCompactionMixin.py +126 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/git_filters/config.py +27 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/middlewares/MiddlewareBase.py +3 -10
- swarmauri_base-0.11.0.dev11/swarmauri_base/run_stores/RunStoreBase.py +51 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/run_stores/__init__.py +3 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/tts/HttpTTSMixin.py +165 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/tts/JsonAudioTTSMixin.py +67 -0
- swarmauri_base-0.11.0.dev11/swarmauri_base/tts/__init__.py +5 -0
- swarmauri_base-0.11.0.dev6/swarmauri_base/tts/__init__.py +0 -3
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/LICENSE +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/DynamicBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/LoggerMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ObserveBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ServiceMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/TomlMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/YamlMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentConversationMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentRetrieveMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentSystemContextMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentToolMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/AgentVectorStoreMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/RealtimeAgentBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/RealtimeInputAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/RealtimeOutputAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/agents/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OAuth20AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OAuth20LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OAuth21AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OAuth21LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OIDC10AppClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/OIDC10LoginBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/http.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/auth_idp/utils.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/BalanceTransfersMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/BillingProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/CustomersMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/HostedCheckoutMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/InvoicingMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/MarketplaceMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/OnlinePaymentsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/PaymentMethodsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/PayoutsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/ProductsPricesMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/PromotionsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/RefundsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/ReportsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/RiskMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/SubscriptionsMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/WebhooksMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/mixins.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/refs.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/specs.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/billing/utils.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/certs/CertServiceBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/certs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chains/ChainBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chains/ChainContextBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chains/ChainStepBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chains/PromptContextChainBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chains/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chunkers/ChunkerBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/chunkers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/cipher_suites/CipherSuiteBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/cipher_suites/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/conversations/ConversationBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/conversations/ConversationSystemContextMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/conversations/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/crypto/CryptoBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/crypto/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/dataconnectors/DataConnectorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/dataconnectors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/distances/DistanceBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/distances/VisionDistanceBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/distances/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/document_stores/DocumentStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/document_stores/DocumentStoreRetrieveBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/document_stores/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/documents/DocumentBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/documents/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/embeddings/EmbeddingBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/embeddings/VisionEmbeddingBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/embeddings/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ensembles/EnsembleBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ensembles/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluator_pools/EvaluatorPoolBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluator_pools/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluator_results/EvalResultBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluator_results/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluators/EvaluatorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/evaluators/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/factories/FactoryBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/factories/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/git_filters/GitFilterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/git_filters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/glogging.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/image_gens/ImageGenBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/image_gens/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/inner_products/InnerProductBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/inner_products/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/key_providers/KeyProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/key_providers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/key_providers/loaders.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveCapabilitiesBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveConfigBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveCorrelation.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveEventBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveInputBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveModelBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveSessionBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveSessionRuntime.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/LiveSessionState.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/SyncLiveSessionBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/AudioDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/InputTranscriptDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/InterruptionEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/OutputTranscriptDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/SessionErrorEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/SessionLifecycleEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/SessionResumptionEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/TextDeltaEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/ToolCallEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/ToolCancellationEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/TurnCompleteEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/UsageEvent.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/events/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/AudioInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/CommitTurnInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/ImageInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/InterruptInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/TextInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/ToolResultInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/VideoInput.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/live_models/inputs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/llms/LLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/llms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/logger_formatters/FormatterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/logger_formatters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/logger_handlers/HandlerBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/logger_handlers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/loggers/LoggerBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/loggers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/matrices/MatrixBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/matrices/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/measurements/MeasurementAggregateMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/measurements/MeasurementBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/measurements/MeasurementCalculateMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/measurements/MeasurementThresholdMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/measurements/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/messages/MessageBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/messages/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/metrics/MetricBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/metrics/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/middlewares/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ModelCatalogBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ModelProviderBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ProviderAuthBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ProviderConnectionConfig.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ProviderConnectionConfigBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ProviderEndpointBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/ProviderErrorMapperBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/model_providers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/models/ModelBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/models/ModelCapabilitiesBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/models/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/mre_crypto/MreCryptoBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/mre_crypto/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/norms/NormBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/norms/UseInnerProductMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/norms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ocrs/OCRBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/ocrs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/parsers/ParserBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/parsers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pipelines/PipelineBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pipelines/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/PopSignerMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/PopSigningBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/PopVerifierMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/binding.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pop/util.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/processes/ContainerProcessBackendBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/processes/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/processes/_subprocess.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/processes/collect_process.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/programs/ProgramBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/programs/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompt_templates/PromptTemplateBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompt_templates/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompts/PromptBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompts/PromptGeneratorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompts/PromptMatrixBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/prompts/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pseudometrics/PseudometricBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/pseudometrics/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/publishers/PublishBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/publishers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/rate_limits/RateLimitBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/rate_limits/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/retrievers/RetrieverBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/retrievers/RetrieverMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/retrievers/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/schema_converters/SchemaConverterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/schema_converters/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/secrets/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/seminorms/SeminormBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/seminorms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/service_registries/ServiceRegistryBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/service_registries/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/signing/SigningBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/signing/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/similarities/SimilarityBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/similarities/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/FileSystemSkillMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/LocalSkillMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/SkillBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/SkillCatalog.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/SkillLoaderBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/SkillMetadata.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/skills/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/state/StateBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/state/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/storage/StorageAdapterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/storage/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/stt/STTBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/stt/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/swarms/SwarmBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/swarms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/task_mgmt_strategies/TaskMgmtStrategyBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/task_mgmt_strategies/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tensors/TensorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tensors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tokens/TokenServiceBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tokens/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tool_llms/ToolLLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tool_llms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/toolkits/ToolkitBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/toolkits/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ParameterBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolExecutionError.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolExecutionPolicy.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolExecutionRequest.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolExecutionResult.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/ToolExecutorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tools/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/TransportBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/appserver_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/bidirectional/BidirectionalStreamClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/bidirectional/BidirectionalStreamConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/bidirectional/BidirectionalStreamState.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/bidirectional/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http/AsyncHttpStreamResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http/HttpClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http/HttpResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http/HttpStreamResponseBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http_client_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/http_server_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/mixins.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/multiplex_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/peer_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/runnable_mixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/websocket/WebSocketClientBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/websocket/WebSocketConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/websocket/WebSocketMultiplexConnectionBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/websocket/WebSocketState.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/transports/websocket/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/tts/TTSBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/utils/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/utils/allowed_models.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStoreCloudMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStoreComparator.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStorePersistentMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStoreRetrieveMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VectorStoreSaveLoadMixin.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/VisionVectorStoreBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vector_stores/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vectors/VectorBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vectors/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/video_lipsync/LipSyncBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/video_lipsync/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vlms/VLMBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/vlms/__init__.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/xmp/EmbedXmpBase.py +0 -0
- {swarmauri_base-0.11.0.dev6 → swarmauri_base-0.11.0.dev11}/swarmauri_base/xmp/__init__.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swarmauri_base
|
|
3
|
-
Version: 0.11.0.
|
|
3
|
+
Version: 0.11.0.dev11
|
|
4
4
|
Summary: Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure.
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -24,10 +24,12 @@ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
|
24
24
|
Classifier: Topic :: Software Development :: Libraries
|
|
25
25
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
26
|
Classifier: Topic :: Text Processing :: Markup
|
|
27
|
+
Requires-Dist: httpx (>=0.27)
|
|
27
28
|
Requires-Dist: numpy (>=1.26.4)
|
|
28
29
|
Requires-Dist: pydantic (>=2.0)
|
|
29
30
|
Requires-Dist: pyyaml (>=6.0.2)
|
|
30
|
-
Requires-Dist:
|
|
31
|
+
Requires-Dist: starlette
|
|
32
|
+
Requires-Dist: swarmauri_core (>=0.11.0.dev7,<0.12)
|
|
31
33
|
Requires-Dist: swarmauri_typing
|
|
32
34
|
Requires-Dist: toml (>=0.10.2)
|
|
33
35
|
Requires-Dist: tomli (>=2.0) ; python_version < "3.11"
|
|
@@ -215,5 +217,25 @@ Apache-2.0
|
|
|
215
217
|
|
|
216
218
|
When adding or changing a base class, keep it aligned with the corresponding `swarmauri_core` interface, preserve direct plugin instantiation patterns, update exports and tests, and follow the [Swarmauri SDK contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md).
|
|
217
219
|
|
|
220
|
+
## Run storage
|
|
218
221
|
|
|
222
|
+
`swarmauri_base.run_stores.RunStoreBase` implements shared checkpoint revision
|
|
223
|
+
rules. A backend supplies an insert, a read, and an atomic compare-and-swap.
|
|
224
|
+
|
|
225
|
+
## HTTP TTS transport
|
|
226
|
+
|
|
227
|
+
`tts.HttpTTSMixin` shares file, streaming and bounded async batch transport for
|
|
228
|
+
standalone TTS providers. Provider packages own request schemas, fixed URLs and
|
|
229
|
+
stream decoding. `_speech_endpoint(streaming)` selects provider-owned unary
|
|
230
|
+
and streaming routes; `_audio_content(response)` decodes unary JSON audio when
|
|
231
|
+
needed. `_speech_request(payload, streaming)` prepares headers and body once for
|
|
232
|
+
providers that require XML or an exact body signature. Existing JSON/binary
|
|
233
|
+
providers retain their default behavior. Transport does
|
|
234
|
+
not replay potentially billable requests.
|
|
235
|
+
|
|
236
|
+
`tts.JsonAudioTTSMixin` decodes complete base64/data-URI audio from JSON for
|
|
237
|
+
file and batch workflows. It rejects URL audio and malformed/empty data, and
|
|
238
|
+
checks WAV headers when WAV is requested. Providers validate their own status
|
|
239
|
+
and format fields. Its stream/astream methods raise locally; a complete JSON
|
|
240
|
+
response is never labeled an incremental stream.
|
|
219
241
|
|
|
@@ -180,4 +180,24 @@ Apache-2.0
|
|
|
180
180
|
|
|
181
181
|
When adding or changing a base class, keep it aligned with the corresponding `swarmauri_core` interface, preserve direct plugin instantiation patterns, update exports and tests, and follow the [Swarmauri SDK contribution guide](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md).
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
## Run storage
|
|
184
|
+
|
|
185
|
+
`swarmauri_base.run_stores.RunStoreBase` implements shared checkpoint revision
|
|
186
|
+
rules. A backend supplies an insert, a read, and an atomic compare-and-swap.
|
|
187
|
+
|
|
188
|
+
## HTTP TTS transport
|
|
189
|
+
|
|
190
|
+
`tts.HttpTTSMixin` shares file, streaming and bounded async batch transport for
|
|
191
|
+
standalone TTS providers. Provider packages own request schemas, fixed URLs and
|
|
192
|
+
stream decoding. `_speech_endpoint(streaming)` selects provider-owned unary
|
|
193
|
+
and streaming routes; `_audio_content(response)` decodes unary JSON audio when
|
|
194
|
+
needed. `_speech_request(payload, streaming)` prepares headers and body once for
|
|
195
|
+
providers that require XML or an exact body signature. Existing JSON/binary
|
|
196
|
+
providers retain their default behavior. Transport does
|
|
197
|
+
not replay potentially billable requests.
|
|
198
|
+
|
|
199
|
+
`tts.JsonAudioTTSMixin` decodes complete base64/data-URI audio from JSON for
|
|
200
|
+
file and batch workflows. It rejects URL audio and malformed/empty data, and
|
|
201
|
+
checks WAV headers when WAV is requested. Providers validate their own status
|
|
202
|
+
and format fields. Its stream/astream methods raise locally; a complete JSON
|
|
203
|
+
response is never labeled an incremental stream.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "swarmauri_base"
|
|
3
|
-
version = "0.11.0.
|
|
3
|
+
version = "0.11.0.dev11"
|
|
4
4
|
description = "Reusable Swarmauri base classes, mixins, and dynamic Pydantic component models for composable intelligence infrastructure."
|
|
5
5
|
keywords = [
|
|
6
6
|
"swarmauri",
|
|
@@ -46,9 +46,11 @@ classifiers = [
|
|
|
46
46
|
requires-python = ">=3.10,<3.15"
|
|
47
47
|
dependencies = [
|
|
48
48
|
"pyyaml>=6.0.2",
|
|
49
|
+
"httpx>=0.27",
|
|
49
50
|
"numpy>=1.26.4",
|
|
50
51
|
"pydantic>=2.0",
|
|
51
|
-
"
|
|
52
|
+
"starlette",
|
|
53
|
+
"swarmauri_core>=0.11.0.dev7,<0.12",
|
|
52
54
|
"swarmauri_typing",
|
|
53
55
|
"toml>=0.10.2",
|
|
54
56
|
"tomli>=2.0; python_version < '3.11'"
|
|
@@ -62,7 +64,6 @@ swarmauri_tests_pylicense = { workspace = true }
|
|
|
62
64
|
[dependency-groups]
|
|
63
65
|
dev = [
|
|
64
66
|
"toml>=0.10.2",
|
|
65
|
-
"fastapi>=0.110.0",
|
|
66
67
|
"httpx>=0.27.0",
|
|
67
68
|
"pytest>=8.0.0",
|
|
68
69
|
"pytest-xdist>=3.6.1",
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
|
|
3
|
+
from swarmauri_core.agents.IAgentCompaction import (
|
|
4
|
+
CountInputTokens,
|
|
5
|
+
IAgentCompaction,
|
|
6
|
+
)
|
|
7
|
+
from swarmauri_core.conversations.ICompactingConversation import (
|
|
8
|
+
CompactionPlan,
|
|
9
|
+
ICompactingConversation,
|
|
10
|
+
)
|
|
11
|
+
|
|
12
|
+
from swarmauri_base.agents.AgentConversationMixin import AgentConversationMixin
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class AgentCompactionMixin(IAgentCompaction, AgentConversationMixin):
|
|
16
|
+
"""Orchestrate compaction with summarization supplied by the agent."""
|
|
17
|
+
|
|
18
|
+
@abstractmethod
|
|
19
|
+
def _summarize_compaction(self, plan: CompactionPlan) -> str:
|
|
20
|
+
"""Summarize the previous summary and eligible older messages."""
|
|
21
|
+
|
|
22
|
+
@abstractmethod
|
|
23
|
+
async def _asummarize_compaction(self, plan: CompactionPlan) -> str:
|
|
24
|
+
"""Asynchronously summarize the earlier conversation."""
|
|
25
|
+
|
|
26
|
+
def compact(self, *, count_input_tokens: CountInputTokens) -> bool:
|
|
27
|
+
conversation = self.conversation
|
|
28
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
29
|
+
return False
|
|
30
|
+
plan = conversation.plan_compaction()
|
|
31
|
+
if plan is None:
|
|
32
|
+
return False
|
|
33
|
+
original_tokens = count_input_tokens(conversation.history)
|
|
34
|
+
summary = self._summarize_compaction(plan)
|
|
35
|
+
return self._apply_summary(
|
|
36
|
+
conversation, plan, summary, original_tokens, count_input_tokens
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
async def acompact(self, *, count_input_tokens: CountInputTokens) -> bool:
|
|
40
|
+
conversation = self.conversation
|
|
41
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
42
|
+
return False
|
|
43
|
+
plan = conversation.plan_compaction()
|
|
44
|
+
if plan is None:
|
|
45
|
+
return False
|
|
46
|
+
original_tokens = count_input_tokens(conversation.history)
|
|
47
|
+
summary = await self._asummarize_compaction(plan)
|
|
48
|
+
return self._apply_summary(
|
|
49
|
+
conversation, plan, summary, original_tokens, count_input_tokens
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
def compact_if_needed(
|
|
53
|
+
self, *, count_input_tokens: CountInputTokens
|
|
54
|
+
) -> bool:
|
|
55
|
+
return self._compaction_needed(count_input_tokens) and self.compact(
|
|
56
|
+
count_input_tokens=count_input_tokens
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
async def acompact_if_needed(
|
|
60
|
+
self, *, count_input_tokens: CountInputTokens
|
|
61
|
+
) -> bool:
|
|
62
|
+
return self._compaction_needed(
|
|
63
|
+
count_input_tokens
|
|
64
|
+
) and await self.acompact(count_input_tokens=count_input_tokens)
|
|
65
|
+
|
|
66
|
+
def _compaction_needed(self, count_input_tokens: CountInputTokens) -> bool:
|
|
67
|
+
conversation = self.conversation
|
|
68
|
+
if not isinstance(conversation, ICompactingConversation):
|
|
69
|
+
return False
|
|
70
|
+
trigger = conversation.compaction_trigger_tokens
|
|
71
|
+
return (
|
|
72
|
+
trigger is not None
|
|
73
|
+
and count_input_tokens(conversation.history) >= trigger
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
def _apply_summary(
|
|
77
|
+
self,
|
|
78
|
+
conversation: ICompactingConversation,
|
|
79
|
+
plan: CompactionPlan,
|
|
80
|
+
summary: str,
|
|
81
|
+
original_tokens: int,
|
|
82
|
+
count_input_tokens: CountInputTokens,
|
|
83
|
+
) -> bool:
|
|
84
|
+
if self.conversation is not conversation or not summary.strip():
|
|
85
|
+
return False
|
|
86
|
+
proposed = conversation.preview_compaction(plan, summary)
|
|
87
|
+
if count_input_tokens(proposed) >= original_tokens:
|
|
88
|
+
return False
|
|
89
|
+
return conversation.apply_compaction(plan, summary)
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
from collections.abc import Mapping, Sequence
|
|
3
|
+
from copy import deepcopy
|
|
4
|
+
|
|
5
|
+
from pydantic import Field
|
|
6
|
+
from swarmauri_core.conversations.ICompactingConversation import (
|
|
7
|
+
CompactionPlan,
|
|
8
|
+
ICompactingConversation,
|
|
9
|
+
)
|
|
10
|
+
from swarmauri_core.messages.IMessage import IMessage
|
|
11
|
+
|
|
12
|
+
from swarmauri_base.conversations.ConversationBase import ConversationBase
|
|
13
|
+
from swarmauri_base.messages.MessageBase import MessageBase
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class ConversationCompactionMixin(ICompactingConversation, ConversationBase):
|
|
17
|
+
"""Plan and apply compaction independently of any model."""
|
|
18
|
+
|
|
19
|
+
summary: str | None = None
|
|
20
|
+
trigger_tokens: int | None = Field(default=None, gt=0)
|
|
21
|
+
keep_recent_turns: int = Field(default=4, ge=1)
|
|
22
|
+
|
|
23
|
+
@property
|
|
24
|
+
def compaction_trigger_tokens(self) -> int | None:
|
|
25
|
+
return self.trigger_tokens
|
|
26
|
+
|
|
27
|
+
@abstractmethod
|
|
28
|
+
def _summary_message(self, summary: str) -> MessageBase:
|
|
29
|
+
"""Render summary text as historical context."""
|
|
30
|
+
|
|
31
|
+
@staticmethod
|
|
32
|
+
def _instruction_end(messages: Sequence[MessageBase]) -> int:
|
|
33
|
+
for index, message in enumerate(messages):
|
|
34
|
+
if message.role not in {"system", "developer"}:
|
|
35
|
+
return index
|
|
36
|
+
return len(messages)
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def history(self) -> list[MessageBase]:
|
|
40
|
+
if not self.summary:
|
|
41
|
+
return list(self.messages)
|
|
42
|
+
start = self._instruction_end(self.messages)
|
|
43
|
+
return [
|
|
44
|
+
*self.messages[:start],
|
|
45
|
+
self._summary_message(self.summary),
|
|
46
|
+
*self.messages[start:],
|
|
47
|
+
]
|
|
48
|
+
|
|
49
|
+
@staticmethod
|
|
50
|
+
def _is_complete_turn(messages: Sequence[MessageBase]) -> bool:
|
|
51
|
+
"""Require a final reply and a result for every tool call."""
|
|
52
|
+
pending: set[str] = set()
|
|
53
|
+
answered = False
|
|
54
|
+
for message in messages[1:]:
|
|
55
|
+
if message.role == "assistant" and not pending:
|
|
56
|
+
for call in getattr(message, "tool_calls", None) or ():
|
|
57
|
+
call_id = (
|
|
58
|
+
call.get("id")
|
|
59
|
+
if isinstance(call, Mapping)
|
|
60
|
+
else getattr(call, "id", None)
|
|
61
|
+
)
|
|
62
|
+
if (
|
|
63
|
+
not isinstance(call_id, str)
|
|
64
|
+
or not call_id
|
|
65
|
+
or call_id in pending
|
|
66
|
+
):
|
|
67
|
+
return False
|
|
68
|
+
pending.add(call_id)
|
|
69
|
+
answered = not pending
|
|
70
|
+
elif message.role == "tool":
|
|
71
|
+
call_id = getattr(message, "tool_call_id", None)
|
|
72
|
+
if call_id not in pending:
|
|
73
|
+
return False
|
|
74
|
+
pending.remove(call_id)
|
|
75
|
+
else:
|
|
76
|
+
return False
|
|
77
|
+
return answered and not pending
|
|
78
|
+
|
|
79
|
+
def plan_compaction(self) -> CompactionPlan | None:
|
|
80
|
+
start = self._instruction_end(self.messages)
|
|
81
|
+
turns = [
|
|
82
|
+
index
|
|
83
|
+
for index in range(start, len(self.messages))
|
|
84
|
+
if self.messages[index].role == "user"
|
|
85
|
+
]
|
|
86
|
+
if not turns or turns[0] != start:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
stop = start
|
|
90
|
+
for begin, end in zip(turns[: -self.keep_recent_turns], turns[1:]):
|
|
91
|
+
if not self._is_complete_turn(self.messages[begin:end]):
|
|
92
|
+
break
|
|
93
|
+
stop = end
|
|
94
|
+
if stop == start:
|
|
95
|
+
return None
|
|
96
|
+
|
|
97
|
+
return CompactionPlan(
|
|
98
|
+
messages=tuple(deepcopy(self.messages)),
|
|
99
|
+
previous_summary=self.summary,
|
|
100
|
+
start=start,
|
|
101
|
+
stop=stop,
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
def preview_compaction(
|
|
105
|
+
self, plan: CompactionPlan, summary: str
|
|
106
|
+
) -> list[IMessage]:
|
|
107
|
+
return [
|
|
108
|
+
*plan.messages[: plan.start],
|
|
109
|
+
self._summary_message(summary.strip()),
|
|
110
|
+
*plan.messages[plan.stop :],
|
|
111
|
+
]
|
|
112
|
+
|
|
113
|
+
def apply_compaction(self, plan: CompactionPlan, summary: str) -> bool:
|
|
114
|
+
summary = summary.strip()
|
|
115
|
+
if not summary or self.plan_compaction() != plan:
|
|
116
|
+
return False
|
|
117
|
+
|
|
118
|
+
self.messages = (
|
|
119
|
+
self.messages[: plan.start] + self.messages[plan.stop :]
|
|
120
|
+
)
|
|
121
|
+
self.summary = summary
|
|
122
|
+
return True
|
|
123
|
+
|
|
124
|
+
def clear_history(self) -> None:
|
|
125
|
+
super().clear_history()
|
|
126
|
+
self.summary = None
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""Read optional project configuration without depending on a plugin host."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import os
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
|
|
8
|
+
try:
|
|
9
|
+
import tomllib
|
|
10
|
+
except ImportError:
|
|
11
|
+
import tomli as tomllib
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def load_filter_config() -> dict:
|
|
15
|
+
"""Read PEAGEN_CONFIG or the nearest peagen.toml if present."""
|
|
16
|
+
configured = os.environ.get("PEAGEN_CONFIG")
|
|
17
|
+
if configured:
|
|
18
|
+
path = Path(configured).expanduser()
|
|
19
|
+
with path.open("rb") as stream:
|
|
20
|
+
return tomllib.load(stream)
|
|
21
|
+
current = Path.cwd()
|
|
22
|
+
for directory in (current, *current.parents):
|
|
23
|
+
path = directory / "peagen.toml"
|
|
24
|
+
if path.is_file():
|
|
25
|
+
with path.open("rb") as stream:
|
|
26
|
+
return tomllib.load(stream)
|
|
27
|
+
return {}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from collections.abc import Awaitable, Callable
|
|
4
|
-
from typing import
|
|
4
|
+
from typing import Any
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
from starlette.requests import Request
|
|
7
|
+
from starlette.responses import Response
|
|
8
8
|
|
|
9
9
|
from swarmauri_core.middlewares.IMiddleware import (
|
|
10
10
|
ASGIApp,
|
|
@@ -83,13 +83,6 @@ class MiddlewareBase(IMiddleware, ComponentBase):
|
|
|
83
83
|
async def _dispatch_with_request(
|
|
84
84
|
self, scope: Scope, receive: ReceiveCallable, send: SendCallable
|
|
85
85
|
) -> None:
|
|
86
|
-
try:
|
|
87
|
-
from fastapi import Request, Response
|
|
88
|
-
except ImportError as exc: # pragma: no cover - optional dependency
|
|
89
|
-
raise RuntimeError(
|
|
90
|
-
"FastAPI must be installed to use dispatch-style middleware."
|
|
91
|
-
) from exc
|
|
92
|
-
|
|
93
86
|
request = Request(scope, receive=receive)
|
|
94
87
|
|
|
95
88
|
async def call_next(request: Request) -> Response:
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from abc import abstractmethod
|
|
2
|
+
from dataclasses import replace
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from swarmauri_core.run_stores import (
|
|
6
|
+
IRunStore,
|
|
7
|
+
RunCheckpoint,
|
|
8
|
+
RunConflictError,
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
from swarmauri_base.ComponentBase import ComponentBase, ResourceTypes
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@ComponentBase.register_model()
|
|
15
|
+
class RunStoreBase(IRunStore, ComponentBase):
|
|
16
|
+
"""Apply shared revision rules over atomic backend operations."""
|
|
17
|
+
|
|
18
|
+
resource: Literal["RunStore"] = ResourceTypes.RUN_STORE.value
|
|
19
|
+
type: Literal["RunStoreBase"] = "RunStoreBase"
|
|
20
|
+
|
|
21
|
+
def create(self, checkpoint: RunCheckpoint) -> None:
|
|
22
|
+
if checkpoint.revision != 0:
|
|
23
|
+
raise ValueError("A new run must start at revision zero")
|
|
24
|
+
if not self._insert(checkpoint):
|
|
25
|
+
raise RunConflictError(checkpoint.run_id)
|
|
26
|
+
|
|
27
|
+
def load(self, run_id: str) -> RunCheckpoint:
|
|
28
|
+
checkpoint = self._read(run_id)
|
|
29
|
+
if checkpoint is None:
|
|
30
|
+
raise KeyError(run_id)
|
|
31
|
+
return checkpoint
|
|
32
|
+
|
|
33
|
+
def save(self, checkpoint: RunCheckpoint) -> RunCheckpoint:
|
|
34
|
+
updated = replace(checkpoint, revision=checkpoint.revision + 1)
|
|
35
|
+
if not self._compare_and_swap(checkpoint.revision, updated):
|
|
36
|
+
raise RunConflictError(checkpoint.run_id)
|
|
37
|
+
return updated
|
|
38
|
+
|
|
39
|
+
@abstractmethod
|
|
40
|
+
def _insert(self, checkpoint: RunCheckpoint) -> bool:
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
@abstractmethod
|
|
44
|
+
def _read(self, run_id: str) -> RunCheckpoint | None:
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
@abstractmethod
|
|
48
|
+
def _compare_and_swap(
|
|
49
|
+
self, expected: int, checkpoint: RunCheckpoint
|
|
50
|
+
) -> bool:
|
|
51
|
+
pass
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
"""Share binary HTTP transport without coupling TTS provider packages."""
|
|
2
|
+
|
|
3
|
+
import asyncio
|
|
4
|
+
from collections.abc import AsyncIterator, Iterator, Mapping
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
from typing import Any, ClassVar
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class HttpTTSMixin:
|
|
12
|
+
"""Implement file, streaming and bounded batch execution for speech APIs.
|
|
13
|
+
|
|
14
|
+
Providers supply their fixed URL and payload. Requests are not retried
|
|
15
|
+
automatically: replaying a speech request can generate duplicate charges.
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
_speech_url: ClassVar[str]
|
|
19
|
+
_sse_stream: ClassVar[bool] = False
|
|
20
|
+
|
|
21
|
+
def _speech_payload(self, text: str, streaming: bool) -> dict[str, Any]:
|
|
22
|
+
raise NotImplementedError
|
|
23
|
+
|
|
24
|
+
def _speech_endpoint(self, streaming: bool) -> str:
|
|
25
|
+
"Select a provider-owned URL without accepting credential redirects."
|
|
26
|
+
return self._speech_url
|
|
27
|
+
|
|
28
|
+
def _speech_request(
|
|
29
|
+
self, payload: dict[str, Any], streaming: bool
|
|
30
|
+
) -> dict[str, Any]:
|
|
31
|
+
"""Prepare the exact headers/body once, allowing XML and signing."""
|
|
32
|
+
return {"headers": self._speech_headers(), "json": payload}
|
|
33
|
+
|
|
34
|
+
def _audio_content(self, response: httpx.Response) -> bytes:
|
|
35
|
+
"""Extract unary audio; JSON providers override this decoding hook."""
|
|
36
|
+
return response.content
|
|
37
|
+
|
|
38
|
+
def _speech_headers(self) -> dict[str, str]:
|
|
39
|
+
return {
|
|
40
|
+
"Authorization": f"Bearer {self.api_key.get_secret_value()}",
|
|
41
|
+
"Content-Type": "application/json",
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
def _payload(self, text: str, streaming: bool) -> dict[str, Any]:
|
|
45
|
+
if not isinstance(text, str) or not text.strip():
|
|
46
|
+
raise ValueError("Speech input must be non-empty text.")
|
|
47
|
+
return self._speech_payload(text, streaming)
|
|
48
|
+
|
|
49
|
+
def _check_response(
|
|
50
|
+
self, response: httpx.Response, streaming: bool = False
|
|
51
|
+
) -> None:
|
|
52
|
+
response.raise_for_status()
|
|
53
|
+
media_type = (
|
|
54
|
+
response.headers.get("content-type", "")
|
|
55
|
+
.partition(";")[0]
|
|
56
|
+
.strip()
|
|
57
|
+
.lower()
|
|
58
|
+
)
|
|
59
|
+
if streaming and self._sse_stream:
|
|
60
|
+
if media_type != "text/event-stream":
|
|
61
|
+
raise ValueError("Expected an SSE audio response.")
|
|
62
|
+
elif "json" in media_type or media_type.startswith("text/"):
|
|
63
|
+
raise ValueError(
|
|
64
|
+
"Expected binary audio, received a text response."
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
def predict(self, text: str, audio_path: str = "output.mp3") -> str:
|
|
68
|
+
payload = self._payload(text, streaming=False)
|
|
69
|
+
with httpx.Client(timeout=self.timeout) as client:
|
|
70
|
+
response = client.post(
|
|
71
|
+
self._speech_endpoint(False),
|
|
72
|
+
**self._speech_request(payload, False),
|
|
73
|
+
)
|
|
74
|
+
self._check_response(response)
|
|
75
|
+
content = self._audio_content(response)
|
|
76
|
+
if not content:
|
|
77
|
+
raise ValueError("Speech API returned empty audio.")
|
|
78
|
+
path = Path(audio_path).expanduser().resolve()
|
|
79
|
+
path.write_bytes(content)
|
|
80
|
+
return str(path)
|
|
81
|
+
|
|
82
|
+
async def apredict(self, text: str, audio_path: str = "output.mp3") -> str:
|
|
83
|
+
payload = self._payload(text, streaming=False)
|
|
84
|
+
async with httpx.AsyncClient(timeout=self.timeout) as client:
|
|
85
|
+
response = await client.post(
|
|
86
|
+
self._speech_endpoint(False),
|
|
87
|
+
**self._speech_request(payload, False),
|
|
88
|
+
)
|
|
89
|
+
self._check_response(response)
|
|
90
|
+
content = self._audio_content(response)
|
|
91
|
+
if not content:
|
|
92
|
+
raise ValueError("Speech API returned empty audio.")
|
|
93
|
+
path = Path(audio_path).expanduser().resolve()
|
|
94
|
+
path.write_bytes(content)
|
|
95
|
+
return str(path)
|
|
96
|
+
|
|
97
|
+
def _audio_chunks(self, response: httpx.Response) -> Iterator[bytes]:
|
|
98
|
+
yield from response.iter_bytes()
|
|
99
|
+
|
|
100
|
+
async def _async_audio_chunks(
|
|
101
|
+
self, response: httpx.Response
|
|
102
|
+
) -> AsyncIterator[bytes]:
|
|
103
|
+
async for chunk in response.aiter_bytes():
|
|
104
|
+
yield chunk
|
|
105
|
+
|
|
106
|
+
def stream(self, text: str) -> Iterator[bytes]:
|
|
107
|
+
payload = self._payload(text, streaming=True)
|
|
108
|
+
received = False
|
|
109
|
+
with httpx.Client(timeout=self.timeout) as client:
|
|
110
|
+
with client.stream(
|
|
111
|
+
"POST",
|
|
112
|
+
self._speech_endpoint(True),
|
|
113
|
+
**self._speech_request(payload, True),
|
|
114
|
+
) as response:
|
|
115
|
+
self._check_response(response, streaming=True)
|
|
116
|
+
for chunk in self._audio_chunks(response):
|
|
117
|
+
if chunk:
|
|
118
|
+
received = True
|
|
119
|
+
yield chunk
|
|
120
|
+
if not received:
|
|
121
|
+
raise ValueError("Speech API returned empty audio.")
|
|
122
|
+
|
|
123
|
+
async def astream(self, text: str) -> AsyncIterator[bytes]:
|
|
124
|
+
payload = self._payload(text, streaming=True)
|
|
125
|
+
received = False
|
|
126
|
+
async with httpx.AsyncClient(timeout=self.timeout) as client:
|
|
127
|
+
async with client.stream(
|
|
128
|
+
"POST",
|
|
129
|
+
self._speech_endpoint(True),
|
|
130
|
+
**self._speech_request(payload, True),
|
|
131
|
+
) as response:
|
|
132
|
+
self._check_response(response, streaming=True)
|
|
133
|
+
async for chunk in self._async_audio_chunks(response):
|
|
134
|
+
if chunk:
|
|
135
|
+
received = True
|
|
136
|
+
yield chunk
|
|
137
|
+
if not received:
|
|
138
|
+
raise ValueError("Speech API returned empty audio.")
|
|
139
|
+
|
|
140
|
+
def batch(self, text_path_dict: Mapping[str, str]) -> list[str]:
|
|
141
|
+
return [
|
|
142
|
+
self.predict(text, path) for text, path in text_path_dict.items()
|
|
143
|
+
]
|
|
144
|
+
|
|
145
|
+
async def abatch(
|
|
146
|
+
self, text_path_dict: Mapping[str, str], max_concurrent: int = 5
|
|
147
|
+
) -> list[str]:
|
|
148
|
+
if (
|
|
149
|
+
isinstance(max_concurrent, bool)
|
|
150
|
+
or not isinstance(max_concurrent, int)
|
|
151
|
+
or max_concurrent < 1
|
|
152
|
+
):
|
|
153
|
+
raise ValueError("max_concurrent must be a positive integer.")
|
|
154
|
+
semaphore = asyncio.Semaphore(max_concurrent)
|
|
155
|
+
|
|
156
|
+
async def generate(text: str, path: str) -> str:
|
|
157
|
+
async with semaphore:
|
|
158
|
+
return await self.apredict(text, path)
|
|
159
|
+
|
|
160
|
+
return await asyncio.gather(
|
|
161
|
+
*(generate(text, path) for text, path in text_path_dict.items())
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
def get_allowed_models(self) -> list[str]:
|
|
165
|
+
return list(self.allowed_models)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"Transport complete base64 audio in JSON without claiming incremental audio."
|
|
2
|
+
|
|
3
|
+
import base64
|
|
4
|
+
import binascii
|
|
5
|
+
from collections.abc import AsyncIterator, Iterator
|
|
6
|
+
from typing import Any
|
|
7
|
+
|
|
8
|
+
import httpx
|
|
9
|
+
|
|
10
|
+
from .HttpTTSMixin import HttpTTSMixin
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class JsonAudioTTSMixin(HttpTTSMixin):
|
|
14
|
+
"""Decode an audio field; never fetch URLs returned by an audio service."""
|
|
15
|
+
|
|
16
|
+
def _check_response(
|
|
17
|
+
self, response: httpx.Response, streaming: bool = False
|
|
18
|
+
) -> None:
|
|
19
|
+
response.raise_for_status()
|
|
20
|
+
|
|
21
|
+
def _audio_object(self, response: httpx.Response) -> dict[str, Any]:
|
|
22
|
+
data = response.json()
|
|
23
|
+
if not isinstance(data, dict):
|
|
24
|
+
raise ValueError("Expected a JSON audio object.")
|
|
25
|
+
if "error" in data:
|
|
26
|
+
raise RuntimeError("Speech API reported an error.")
|
|
27
|
+
return data
|
|
28
|
+
|
|
29
|
+
def _audio_content(self, response: httpx.Response) -> bytes:
|
|
30
|
+
data = self._audio_object(response)
|
|
31
|
+
audio = data.get("audio")
|
|
32
|
+
if not isinstance(audio, str) or not audio:
|
|
33
|
+
raise ValueError("Speech API returned no encoded audio.")
|
|
34
|
+
if audio.startswith("data:"):
|
|
35
|
+
header, separator, audio = audio.partition(",")
|
|
36
|
+
if (
|
|
37
|
+
not separator
|
|
38
|
+
or not header.startswith("data:audio/")
|
|
39
|
+
or not header.endswith(";base64")
|
|
40
|
+
):
|
|
41
|
+
raise ValueError("Expected a base64 audio data URI.")
|
|
42
|
+
try:
|
|
43
|
+
content = base64.b64decode(audio, validate=True)
|
|
44
|
+
except (ValueError, binascii.Error) as exc:
|
|
45
|
+
raise ValueError("Invalid base64 audio.") from exc
|
|
46
|
+
if not content:
|
|
47
|
+
raise ValueError("Speech API returned empty audio.")
|
|
48
|
+
if getattr(self, "response_format", None) == "wav" and (
|
|
49
|
+
content[:4] != b"RIFF" or content[8:12] != b"WAVE"
|
|
50
|
+
):
|
|
51
|
+
raise ValueError("Expected WAV audio.")
|
|
52
|
+
return content
|
|
53
|
+
|
|
54
|
+
def predict(self, text: str, audio_path: str = "output.wav") -> str:
|
|
55
|
+
return super().predict(text, audio_path)
|
|
56
|
+
|
|
57
|
+
async def apredict(self, text: str, audio_path: str = "output.wav") -> str:
|
|
58
|
+
return await super().apredict(text, audio_path)
|
|
59
|
+
|
|
60
|
+
def stream(self, text: str) -> Iterator[bytes]:
|
|
61
|
+
raise NotImplementedError(
|
|
62
|
+
"This JSON audio adapter has no verified streaming contract."
|
|
63
|
+
)
|
|
64
|
+
|
|
65
|
+
async def astream(self, text: str) -> AsyncIterator[bytes]:
|
|
66
|
+
for chunk in self.stream(text):
|
|
67
|
+
yield chunk
|