Expand description
Adapters that wrap existing runtime traits as Components.
behest has many long-lived trait abstractions
(ChatProvider, SessionStore, etc.) that predate the
Component trait. To make them composable with the
ComponentRegistry without
forcing every existing implementation to provide a Component::init
method, this module provides ready-made wrapper factories that
take an already-constructed Arc<T> and expose it as a registered
component.
These wrappers are the canonical M3 deliverable: the existing trait surface stays unchanged, while the runtime becomes composable on top.
§Example
use std::sync::Arc;
use behest_runtime::component_factory::ChatProviderComponent;
use behest_runtime::registry::ComponentRegistry;
// Caller-supplied provider, pre-constructed:
let provider: Arc<dyn behest_provider::ChatProvider> = todo!();
let factory = ChatProviderComponent::new("primary", provider);
// ... register with ComponentRegistry via register_factory().Structs§
- Chat
Provider Any AnyComponentadapter forChatProviderComponent.- Chat
Provider Component - A
Componentthat wraps an existingChatProvider. - Chat
Provider Factory - Factory for
ChatProviderComponentthat takes a pre-builtArc<dyn ChatProvider>and registers it under the given name. - Embedding
Provider Any AnyComponentadapter forEmbeddingProviderComponent.- Embedding
Provider Component - A
Componentthat wraps an existingEmbeddingProvider. - Embedding
Provider Factory - Factory for
EmbeddingProviderComponent. - Empty
Config - Configuration for a chat provider component wrapper. Currently
unused; the wrapper takes a pre-constructed provider. Exists to
satisfy the
Component::Configbound so the wrapper can be registered in aComponentRegistry. - Wrapper
Error - Error type for wrapper components: lifecycle errors only, since the wrapped provider was constructed externally.
Type Aliases§
- Factory
Error - Convenience: re-export a name-keyed error so callers don’t have to
import
ExtensionErrorseparately.