fix: resolve all 75 mem-cli compilation errors across 25 files
CI / CI (pull_request) Successful in 4m17s
CI / CI (pull_request) Successful in 4m17s
- embed_text -> embed_one + Vector to Vec<f32> conversion (semantic.rs, unified_query.rs) - DefaultAgent: remove shadowing type alias, re-export concrete struct - Position: add Default derive for unwrap_or_default() - streaming_body -> streaming + yield Result<Bytes> for SSE - borrow-after-move: compute len before move in 6 places - add missing imports: sqlx::Row, chrono::Timelike, std::pin::Pin - add missing derives: Serialize on CompactionStats, FacetFilters - extract_token: extract Authorization header from HttpRequest first - AuthError variants: match actual enum (TokenExpired, not ExpiredToken) - validate_bearer_token -> extract_bearer_token (sync check) - check_limit -> check with correct args - link_entities -> link_mentions (async, correct signature) - InferenceEngine::new + infer_facts: match actual 2-arg/3-arg API - RoutedResult: add missing confidence_score + is_valid fields - client_sdk: fix ownership (remove borrow, save status before .text()) - index_chunk -> index_document (match OpenSearchClient API) - recursive async dfs_paths: Box::pin for infinite future size - log -> tracing crate in authentik_service_account - CI: add SQLX_OFFLINE=true env var for offline builds
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sqlx::{Pool, Postgres};
|
||||
use std::collections::{HashMap, HashSet, VecDeque};
|
||||
use std::pin::Pin;
|
||||
use std::future::Future;
|
||||
use tracing::{debug, info};
|
||||
|
||||
/// A single path through the graph
|
||||
@@ -123,13 +125,14 @@ impl PathFinder {
|
||||
info!("Found shortest path: {} → {} (distance: {})",
|
||||
source_id, target_id, final_entities.len() - 1);
|
||||
|
||||
let distance = final_entities.len() - 1;
|
||||
return Ok(Some(Path {
|
||||
source_id: source_id.to_string(),
|
||||
target_id: target_id.to_string(),
|
||||
entity_ids: final_entities,
|
||||
entity_names: vec![], // Could fetch from DB if needed
|
||||
relation_types: final_relations,
|
||||
distance: final_entities.len() - 1,
|
||||
distance,
|
||||
total_confidence: final_confidence.max(0.0).min(1.0),
|
||||
}));
|
||||
}
|
||||
@@ -293,19 +296,20 @@ impl PathFinder {
|
||||
}
|
||||
|
||||
/// DFS helper for finding all paths
|
||||
async fn dfs_paths(
|
||||
&self,
|
||||
source_id: &str,
|
||||
target_id: &str,
|
||||
fn dfs_paths<'a>(
|
||||
&'a self,
|
||||
source_id: &'a str,
|
||||
target_id: &'a str,
|
||||
current_path: Vec<String>,
|
||||
relations_path: Vec<String>,
|
||||
confidence: f32,
|
||||
depth: usize,
|
||||
max_depth: usize,
|
||||
paths_found: &mut Vec<Path>,
|
||||
visited: &mut HashSet<String>,
|
||||
paths_found: &'a mut Vec<Path>,
|
||||
visited: &'a mut HashSet<String>,
|
||||
max_paths: usize,
|
||||
) -> Result<(), String> {
|
||||
) -> Pin<Box<dyn Future<Output = Result<(), String>> + Send + 'a>> {
|
||||
Box::pin(async move {
|
||||
if paths_found.len() >= max_paths {
|
||||
return Ok(()); // Found enough paths
|
||||
}
|
||||
@@ -328,13 +332,14 @@ impl PathFinder {
|
||||
|
||||
let final_confidence = confidence * edge.confidence;
|
||||
|
||||
let distance = final_path.len() - 1;
|
||||
paths_found.push(Path {
|
||||
source_id: source_id.to_string(),
|
||||
target_id: target_id.to_string(),
|
||||
entity_ids: final_path,
|
||||
entity_names: vec![],
|
||||
relation_types: final_relations,
|
||||
distance: final_path.len() - 1,
|
||||
distance,
|
||||
total_confidence: final_confidence.max(0.0).min(1.0),
|
||||
});
|
||||
|
||||
@@ -370,6 +375,7 @@ impl PathFinder {
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}) // Box::pin
|
||||
}
|
||||
|
||||
/// Fetch direct neighbors of an entity
|
||||
|
||||
Reference in New Issue
Block a user