feat: text splitting and storage

This commit is contained in:
Per Stark
2024-11-20 12:10:23 +01:00
parent 1212e33098
commit 4d6510ee2e
6 changed files with 257 additions and 89 deletions

View File

@@ -38,7 +38,7 @@ impl IngressObject {
let text = Self::fetch_text_from_url(url).await?;
let id = Uuid::new_v4();
Ok(TextContent {
id,
id: id.to_string(),
text,
instructions: instructions.clone(),
category: category.clone(),
@@ -48,7 +48,7 @@ impl IngressObject {
IngressObject::Text { text, instructions, category } => {
let id = Uuid::new_v4();
Ok(TextContent {
id,
id: id.to_string(),
text: text.clone(),
instructions: instructions.clone(),
category: category.clone(),
@@ -59,7 +59,7 @@ impl IngressObject {
let id = Uuid::new_v4();
let text = Self::extract_text_from_file(file_info).await?;
Ok(TextContent {
id,
id: id.to_string(),
text,
instructions: instructions.clone(),
category: category.clone(),