Files
nazarick-private/crates/nazarick-core/src/llm/traits.rs
T
Sithies b6a5618f78
CI / check (push) Successful in 3m13s
CI / test (push) Successful in 3m53s
CI / clippy (push) Failing after 3m15s
CI / deploy (push) Has been skipped
Fix
2026-04-25 18:59:24 +02:00

36 lines
905 B
Rust

// 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<Self, Self::Err> {
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<LlmResponse>;
fn name(&self) -> &str;
fn skill_format(&self) -> SkillFormat {
SkillFormat::Xml
}
}