diff options
author | Oxbian <oxbian@mailbox.org> | 2025-05-18 12:19:33 -0400 |
---|---|---|
committer | Oxbian <oxbian@mailbox.org> | 2025-05-18 12:19:33 -0400 |
commit | ea5fe19ad751fd6fa686e502a5cf7f26a78668e9 (patch) | |
tree | cd005f10acc256613ef5a9b88cf36733659ea57f /src/app/modules/wikipedia.rs | |
parent | fecb211130ec487c7c617d28419c6d0097f19783 (diff) | |
download | NAI-main.tar.gz NAI-main.zip |
feat: refactor chat, resume into modules + color in UImain
Diffstat (limited to 'src/app/modules/wikipedia.rs')
-rw-r--r-- | src/app/modules/wikipedia.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<String>, 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<_>>() // Vec<&str> + .collect::<Vec<_>>() }) .collect::<Vec<_>>() // collect words .join(" "); // join with spaces |