// nazarick-core/src/llm/traits.rs use std::str::FromStr; use crate::types::Result; use crate::llm::types::{LlmRequest, LlmResponse}; #[derive(Debug, Clone, PartialEq)] pub enum SkillFormat { /// XML-Tags — für lokale Modelle ohne Function Calling Xml, /// Native Tool Use — Ollama, Mistral API, OpenRouter ToolUse, /// Skills deaktiviert None, } impl FromStr for SkillFormat { type Err = (); fn from_str(s: &str) -> std::result::Result { match s { "tool_use" => Ok(Self::ToolUse), "none" => Ok(Self::None), _ => Ok(Self::Xml), } } } #[async_trait::async_trait] pub trait LlmProvider: Send + Sync { async fn complete(&self, request: LlmRequest) -> Result; fn name(&self) -> &str; fn skill_format(&self) -> SkillFormat { SkillFormat::Xml } }