Initial commit - AiRust cyber operator

This commit is contained in:
frostyripper1
2026-05-19 13:10:52 +02:00
commit ea5356d424
31 changed files with 8675 additions and 0 deletions
+40
View File
@@ -0,0 +1,40 @@
use std::fs::File;
use std::io::{ BufRead, BufReader};
pub fn load_knowledge() -> String {
let path = "output/english_master.jsonl";
let file = match File::open(path) {
Ok(f) => f,
Err(e) => {
eprintln!("❌ Could not open {}: {}", path, e);
return "Knowledge base not found.".to_string();
}
};
let reader = BufReader::new(file);
let mut knowledge = String::from("=== ENGLISH MASTERY KNOWLEDGE BASE ===\n\n");
let mut count = 0;
for line in reader.lines() {
let line = match line {
Ok(l) => l,
Err(_) => continue,
};
let trimmed = line.trim();
if trimmed.is_empty() {
continue;
}
// Just add the raw line as-is (since it's JSONL)
knowledge.push_str(trimmed);
knowledge.push_str("\n\n");
count += 1;
}
knowledge.push_str(&format!("\n=== TOTAL: {} EXAMPLES LOADED ===\n", count));
println!("📚 Successfully loaded {} examples from english_master.jsonl", count);
knowledge
}