From ea5fe19ad751fd6fa686e502a5cf7f26a78668e9 Mon Sep 17 00:00:00 2001 From: Oxbian Date: Sun, 18 May 2025 12:19:33 -0400 Subject: feat: refactor chat, resume into modules + color in UI --- src/app/modules/wikipedia.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/app/modules/wikipedia.rs') diff --git a/src/app/modules/wikipedia.rs b/src/app/modules/wikipedia.rs index 5864df4..86177ae 100644 --- a/src/app/modules/wikipedia.rs +++ b/src/app/modules/wikipedia.rs @@ -76,7 +76,7 @@ async fn find_get_best_article(articles: Vec, user_query: &String, best_ let messages = vec![ Message::new(MessageType::SYSTEM, best_llm.system_prompt.clone()), - Message::new(MessageType::USER, format!("The user's query is: {}. Here are the headings:\n{}\n\nPlease select the most relevant heading. Output the heading **only** and nothing else.", user_query, articles_headings))]; + Message::new(MessageType::USER, format!("The user's query is: {}. Here are the headings:\n{}\n\nPlease select the most relevant heading. Output the heading only and nothing else.", user_query, articles_headings))]; let best_article = best_llm.ask(&messages).await?; // wiki query get article content & parse @@ -98,9 +98,9 @@ fn extract_text_from_tags(html: &str) -> String { // Trouver le premier groupe capturé non vide (parmi cap[1] à cap[4]) (1..=4) .filter_map(|i| cap.get(i)) - .map(|m| m.as_str()) // &str + .map(|m| m.as_str()) .flat_map(|s| s.split_whitespace()) - .collect::>() // Vec<&str> + .collect::>() }) .collect::>() // collect words .join(" "); // join with spaces -- cgit v1.2.3