feat(cache-redis-semantic): expose backend accessors for bridge binding

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
Yujong Lee 2026-09-21 20:34:51 +00:00
parent a69ebb7ac4
commit c311073a17

View file

@ -41,15 +41,6 @@ pub struct RedisSemanticConfig {
pub similarity_threshold: f32,
}
impl Default for RedisSemanticConfig {
fn default() -> Self {
Self {
index_name: DEFAULT_INDEX_NAME.into(),
similarity_threshold: 0.9,
}
}
}
struct Inner {
index_name: String,
distance_threshold: f64,
@ -247,6 +238,18 @@ impl<E: Embedder, C: redis::ConnectionLike + Send + 'static> RedisSemanticCache<
}
}
pub fn embedder(&self) -> &E {
&self.embedder
}
pub fn index_name(&self) -> &str {
&self.inner.index_name
}
pub fn similarity_threshold(&self) -> f32 {
(1.0 - self.inner.distance_threshold) as f32
}
fn tag<'a>(key: &'a str, context: &'a SemanticCacheContext) -> &'a str {
context.scope.as_deref().unwrap_or(key)
}