Files
nazarick-private/crates/nazarick-core/src/llm/traits.rs
T
Sithies 18b666f45d
CI / check (push) Successful in 4m11s
CI / test (push) Successful in 3m57s
CI / clippy (push) Has been cancelled
added Tokens, openrouter, memory system
2026-03-21 19:59:07 +01:00

34 lines
860 B
Rust

// nazarick-core/src/llm/traits.rs
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 SkillFormat {
/// Parsed aus config.toml String
pub fn from_str(s: &str) -> Self {
match s {
"tool_use" => Self::ToolUse,
"none" => Self::None,
_ => Self::Xml, // default
}
}
}
#[async_trait::async_trait]
pub trait LlmProvider: Send + Sync {
async fn complete(&self, request: LlmRequest) -> Result<LlmResponse>;
fn name(&self) -> &str;
fn skill_format(&self) -> SkillFormat {
SkillFormat::Xml
}
}