39 lines
1.0 KiB
Rust
39 lines
1.0 KiB
Rust
use std::sync::Arc;
|
|
use nazarick_core::agent::base::{AgentConfig, BaseAgent};
|
|
use nazarick_core::agent::skill_registry::SkillRegistry;
|
|
use nazarick_core::memory::Memory;
|
|
use nazarick_core::summarizer::Summarizer;
|
|
use nazarick_core::traits::Agent;
|
|
use nazarick_core::types::AgentId;
|
|
use nazarick_core::llm::LlmProvider;
|
|
|
|
pub struct Lyra {
|
|
base: BaseAgent,
|
|
}
|
|
|
|
impl Lyra {
|
|
pub fn new(
|
|
config: AgentConfig,
|
|
llm: Box<dyn LlmProvider>,
|
|
registry: Arc<SkillRegistry>,
|
|
memory: Arc<dyn Memory>,
|
|
summarizer: Arc<dyn Summarizer>,
|
|
) -> Self {
|
|
Self {
|
|
base: BaseAgent::new(config, llm, registry, memory, summarizer),
|
|
}
|
|
}
|
|
|
|
pub async fn init(&mut self) -> nazarick_core::types::Result<()> {
|
|
self.base.init().await
|
|
}
|
|
|
|
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" }
|
|
} |