feat: additional variables to database structs & display

This commit is contained in:
Per Stark
2025-01-29 15:50:43 +01:00
parent 2460d430b2
commit 364edbeb45
12 changed files with 126 additions and 35 deletions

View File

@@ -41,13 +41,15 @@ pub fn create_ingress_objects(
});
}
Err(_) => {
info!("Treating input as plain text");
object_list.push(IngressObject::Text {
text: input_content.to_string(),
instructions: input.instructions.clone(),
category: input.category.clone(),
user_id: user_id.into(),
});
if input_content.len() > 2 {
info!("Treating input as plain text");
object_list.push(IngressObject::Text {
text: input_content.to_string(),
instructions: input.instructions.clone(),
category: input.category.clone(),
user_id: user_id.into(),
});
}
}
}
}

View File

@@ -14,7 +14,6 @@ use serde::{Deserialize, Serialize};
use std::fmt::Write;
use tiktoken_rs::{o200k_base, CoreBPE};
/// Knowledge object type, containing the content or reference to it, as well as metadata
#[derive(Debug, Serialize, Deserialize, Clone)]
pub enum IngressObject {
Url {
@@ -62,6 +61,7 @@ impl IngressObject {
instructions.into(),
category.into(),
None,
Some(url.into()),
user_id.into(),
))
}
@@ -75,6 +75,7 @@ impl IngressObject {
instructions.into(),
category.into(),
None,
None,
user_id.into(),
)),
IngressObject::File {
@@ -89,6 +90,7 @@ impl IngressObject {
instructions.into(),
category.into(),
Some(file_info.to_owned()),
None,
user_id.into(),
))
}