mirror of
https://gitea.ingwaz.work/Ingwaz/openbrain-mcp.git
synced 2026-03-31 06:39:06 +00:00
Fix dedup threshold postgres type
This commit is contained in:
@@ -77,7 +77,7 @@ async fn find_dedup_match<C>(
|
||||
client: &C,
|
||||
agent_id: &str,
|
||||
embedding: &Vector,
|
||||
threshold: f32,
|
||||
threshold: f64,
|
||||
) -> Result<Option<DedupMatch>>
|
||||
where
|
||||
C: GenericClient + Sync,
|
||||
@@ -144,6 +144,7 @@ impl Database {
|
||||
) -> Result<StoreMemoryResult> {
|
||||
let client = self.pool.get().await?;
|
||||
let vector = Vector::from(embedding.to_vec());
|
||||
let dedup_threshold = dedup_threshold as f64;
|
||||
|
||||
if let Some(existing) = find_dedup_match(&client, agent_id, &vector, dedup_threshold).await? {
|
||||
let merged_metadata = merge_metadata(&existing.metadata, &metadata);
|
||||
@@ -372,6 +373,7 @@ impl Database {
|
||||
let mut client = self.pool.get().await?;
|
||||
let transaction = client.transaction().await?;
|
||||
let mut results = Vec::with_capacity(entries.len());
|
||||
let dedup_threshold = dedup_threshold as f64;
|
||||
|
||||
for (content, metadata, embedding, keywords, expires_at) in entries {
|
||||
let vector = Vector::from(embedding);
|
||||
|
||||
Reference in New Issue
Block a user