diff --git a/src/ai.rs b/src/ai.rs index c3c8b46..df6829d 100644 --- a/src/ai.rs +++ b/src/ai.rs @@ -122,7 +122,7 @@ pub fn chunked(s: &str) -> Vec { .collect() } -fn remove_data_urls(input: &str) -> String { +pub fn remove_data_urls(input: &str) -> String { let re = regex::Regex::new("data:(.*?)(;base64)?,(.*)").unwrap(); // Replace all occurrences of data URLs with an empty string diff --git a/src/pages/mod.rs b/src/pages/mod.rs index 9df6588..f3a8680 100644 --- a/src/pages/mod.rs +++ b/src/pages/mod.rs @@ -14,7 +14,7 @@ use component::*; use serde_json::json; use webarc::{ - ai::{generate_embedding, EmbedStore, SearchResult}, + ai::{generate_embedding, remove_data_urls, EmbedStore, SearchResult}, archive::WebsiteArchive, conf::get_config, render_page, @@ -139,20 +139,25 @@ pub async fn domain_info_route( render_page(content, ctx).await } -#[get("/txt//?