//! Embedding Adapter - Bridges Tauri LLM EmbeddingClient to Growth System trait //! //! Implements zclaw_growth::retrieval::semantic::EmbeddingClient //! by wrapping the concrete llm::EmbeddingClient. use std::sync::Arc; use zclaw_growth::retrieval::semantic::EmbeddingClient; /// Adapter wrapping Tauri's llm::EmbeddingClient to implement the growth trait pub struct TauriEmbeddingAdapter { inner: Arc, } impl TauriEmbeddingAdapter { pub fn new(client: crate::llm::EmbeddingClient) -> Self { Self { inner: Arc::new(client), } } } #[async_trait::async_trait] impl EmbeddingClient for TauriEmbeddingAdapter { async fn embed(&self, text: &str) -> Result, String> { let response = self.inner.embed(text).await?; Ok(response.embedding) } fn is_available(&self) -> bool { self.inner.is_configured() } }