mirror of
https://github.com/perstarkse/minne.git
synced 2026-04-20 07:51:23 +02:00
refactor: add openai client and improve reference handling
This commit is contained in:
@@ -57,7 +57,7 @@ impl<'a> IngressAnalyzer<'a> {
|
||||
text, category, instructions
|
||||
);
|
||||
|
||||
combined_knowledge_entity_retrieval(self.db_client, self.openai_client, input_text).await
|
||||
combined_knowledge_entity_retrieval(self.db_client, self.openai_client, &input_text).await
|
||||
}
|
||||
|
||||
fn prepare_llm_request(
|
||||
|
||||
@@ -158,7 +158,7 @@ async fn create_single_entity(
|
||||
llm_entity.name, llm_entity.description, llm_entity.entity_type
|
||||
);
|
||||
|
||||
let embedding = generate_embedding(openai_client, embedding_input).await?;
|
||||
let embedding = generate_embedding(openai_client, &embedding_input).await?;
|
||||
|
||||
Ok(KnowledgeEntity {
|
||||
id: assigned_id,
|
||||
|
||||
@@ -101,7 +101,7 @@ impl ContentProcessor {
|
||||
|
||||
// Could potentially process chunks in parallel with a bounded concurrent limit
|
||||
for chunk in chunks {
|
||||
let embedding = generate_embedding(&self.openai_client, chunk.to_string()).await?;
|
||||
let embedding = generate_embedding(&self.openai_client, chunk).await?;
|
||||
let text_chunk = TextChunk::new(content.id.to_string(), chunk.to_string(), embedding);
|
||||
store_item(&self.db_client, text_chunk).await?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user