mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-22 16:58:32 +02:00
moved entry points to bin to clarify
This commit is contained in:
1
Cargo.lock
generated
1
Cargo.lock
generated
@@ -5387,7 +5387,6 @@ dependencies = [
|
|||||||
"axum",
|
"axum",
|
||||||
"axum_typed_multipart",
|
"axum_typed_multipart",
|
||||||
"futures",
|
"futures",
|
||||||
"futures-lite 2.3.0",
|
|
||||||
"lapin",
|
"lapin",
|
||||||
"mime",
|
"mime",
|
||||||
"mime_guess",
|
"mime_guess",
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ async-openai = "0.24.1"
|
|||||||
axum = { version = "0.7.5", features = ["multipart", "macros"] }
|
axum = { version = "0.7.5", features = ["multipart", "macros"] }
|
||||||
axum_typed_multipart = "0.12.1"
|
axum_typed_multipart = "0.12.1"
|
||||||
futures = "0.3.31"
|
futures = "0.3.31"
|
||||||
futures-lite = "2.3.0"
|
|
||||||
lapin = { version = "2.5.0", features = ["serde_json"] }
|
lapin = { version = "2.5.0", features = ["serde_json"] }
|
||||||
mime = "0.3.17"
|
mime = "0.3.17"
|
||||||
mime_guess = "2.0.5"
|
mime_guess = "2.0.5"
|
||||||
@@ -29,8 +28,8 @@ uuid = { version = "1.10.0", features = ["v4", "serde"] }
|
|||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "server"
|
name = "server"
|
||||||
path = "src/server.rs"
|
path = "src/bin/server.rs"
|
||||||
|
|
||||||
[[bin]]
|
[[bin]]
|
||||||
name = "consumer"
|
name = "worker"
|
||||||
path = "src/consumer.rs"
|
path = "src/bin/worker.rs"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
use text_splitter::TextSplitter;
|
use text_splitter::TextSplitter;
|
||||||
use tracing::{debug, info};
|
use tracing::{debug, info};
|
||||||
|
|
||||||
@@ -35,11 +37,17 @@ impl ContentProcessor {
|
|||||||
// Store original content
|
// Store original content
|
||||||
store_item(&self.db_client, content.clone()).await?;
|
store_item(&self.db_client, content.clone()).await?;
|
||||||
|
|
||||||
|
let now = Instant::now();
|
||||||
// Process in parallel where possible
|
// Process in parallel where possible
|
||||||
let (analysis, _similar_chunks) = tokio::try_join!(
|
let (analysis, _similar_chunks) = tokio::try_join!(
|
||||||
self.perform_semantic_analysis(content),
|
self.perform_semantic_analysis(content),
|
||||||
self.find_similar_content(content),
|
self.find_similar_content(content),
|
||||||
)?;
|
)?;
|
||||||
|
let end = now.elapsed();
|
||||||
|
info!(
|
||||||
|
"{:?} time elapsed during creation of entities and relationships",
|
||||||
|
end
|
||||||
|
);
|
||||||
|
|
||||||
// Convert and store entities
|
// Convert and store entities
|
||||||
let (entities, relationships) = analysis
|
let (entities, relationships) = analysis
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use futures_lite::stream::StreamExt;
|
use futures::StreamExt;
|
||||||
use lapin::{message::Delivery, options::*, types::FieldTable, Channel, Consumer, Queue};
|
use lapin::{message::Delivery, options::*, types::FieldTable, Channel, Consumer, Queue};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
|||||||
Reference in New Issue
Block a user