mirror of
https://github.com/perstarkse/minne.git
synced 2026-05-13 19:30:42 +02:00
feat: additional variables to database structs & display
This commit is contained in:
@@ -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(),
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user