mirror of
https://github.com/perstarkse/minne.git
synced 2026-03-29 22:01:59 +02:00
wip query
This commit is contained in:
@@ -5,7 +5,6 @@ use tracing::{debug, info};
|
||||
|
||||
use crate::{
|
||||
error::ProcessingError,
|
||||
retrieval::vector::find_items_by_vector_similarity,
|
||||
storage::{
|
||||
db::{store_item, SurrealDbClient},
|
||||
types::{
|
||||
@@ -39,10 +38,8 @@ impl ContentProcessor {
|
||||
|
||||
let now = Instant::now();
|
||||
// Process in parallel where possible
|
||||
let (analysis, _similar_chunks) = tokio::try_join!(
|
||||
self.perform_semantic_analysis(content),
|
||||
self.find_similar_content(content),
|
||||
)?;
|
||||
let analysis = self.perform_semantic_analysis(content).await?;
|
||||
|
||||
let end = now.elapsed();
|
||||
info!(
|
||||
"{:?} time elapsed during creation of entities and relationships",
|
||||
@@ -74,20 +71,6 @@ impl ContentProcessor {
|
||||
.await
|
||||
}
|
||||
|
||||
async fn find_similar_content(
|
||||
&self,
|
||||
content: &TextContent,
|
||||
) -> Result<Vec<TextChunk>, ProcessingError> {
|
||||
find_items_by_vector_similarity(
|
||||
3,
|
||||
content.text.clone(),
|
||||
&self.db_client,
|
||||
"text_chunk".to_string(),
|
||||
&self.openai_client,
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn store_graph_entities(
|
||||
&self,
|
||||
entities: Vec<KnowledgeEntity>,
|
||||
|
||||
Reference in New Issue
Block a user