Lyra Agent hinzugefügt, Multi-Agent Routing, BaseAgent refactoring
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// crates/lyra/src/lib.rs
|
||||
//
|
||||
// Lyra — Persönlicher Begleit-Agent von Nazarick.
|
||||
// Dünner Wrapper um BaseAgent — nur name() ist Lyra-spezifisch.
|
||||
|
||||
use nazarick_core::agent::BaseAgent;
|
||||
use nazarick_core::traits::Agent;
|
||||
use nazarick_core::types::AgentId;
|
||||
use nazarick_core::llm::LlmProvider;
|
||||
|
||||
pub struct Lyra {
|
||||
base: BaseAgent,
|
||||
}
|
||||
|
||||
impl Lyra {
|
||||
/// Erstellt eine neue Lyra-Instanz.
|
||||
/// `soul_core_path` → Pfad zu soul_core.md
|
||||
/// `soul_personality_path` → Pfad zu soul_personality.md
|
||||
/// `llm` → LLM-Provider (z.B. LmStudioProvider)
|
||||
pub fn new(
|
||||
soul_core_path: impl Into<String>,
|
||||
soul_personality_path: impl Into<String>,
|
||||
llm: Box<dyn LlmProvider>,
|
||||
) -> Self {
|
||||
Self {
|
||||
base: BaseAgent::new(soul_core_path, soul_personality_path, llm),
|
||||
}
|
||||
}
|
||||
|
||||
/// Delegiert chat() an BaseAgent.
|
||||
pub async fn chat(&mut self, user_message: &str) -> nazarick_core::types::Result<String> {
|
||||
self.base.chat(user_message).await
|
||||
}
|
||||
}
|
||||
|
||||
impl Agent for Lyra {
|
||||
fn id(&self) -> AgentId {
|
||||
self.base.id
|
||||
}
|
||||
|
||||
fn name(&self) -> &str {
|
||||
"Lyra"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user