feat: Introduce smart-features Cargo feature to conditionally compile smart note functionalities and their dependencies.
This commit is contained in:
@@ -17,6 +17,7 @@ pub enum FactoryError {
|
||||
|
||||
pub type FactoryResult<T> = Result<T, FactoryError>;
|
||||
|
||||
#[cfg(feature = "smart-features")]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum EmbeddingProvider {
|
||||
FastEmbed,
|
||||
@@ -24,12 +25,14 @@ pub enum EmbeddingProvider {
|
||||
// OpenAI(String), // ApiKey
|
||||
}
|
||||
|
||||
#[cfg(feature = "smart-features")]
|
||||
#[derive(Debug, Clone)]
|
||||
pub enum VectorProvider {
|
||||
Qdrant { url: String, collection: String },
|
||||
// InMemory,
|
||||
}
|
||||
|
||||
#[cfg(feature = "smart-features")]
|
||||
pub async fn build_embedding_generator(
|
||||
provider: &EmbeddingProvider,
|
||||
) -> FactoryResult<Arc<dyn notes_domain::ports::EmbeddingGenerator>> {
|
||||
@@ -41,6 +44,7 @@ pub async fn build_embedding_generator(
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "smart-features")]
|
||||
pub async fn build_vector_store(
|
||||
provider: &VectorProvider,
|
||||
) -> FactoryResult<Arc<dyn notes_domain::ports::VectorStore>> {
|
||||
|
||||
Reference in New Issue
Block a user