Skip to main content

spec_drift/llm/
null.rs

1use super::{LlmClient, LlmVerdict};
2
3/// LLM client that always returns `None`. Used whenever the `[llm]` block is
4/// disabled, `--no-llm` is set, or a real provider isn't configured. Making
5/// the disabled-by-default path a first-class implementation means analyzers
6/// never need a `if let Some(client) = ...` branch.
7pub struct NullLlmClient;
8
9impl LlmClient for NullLlmClient {
10    fn evaluate(&self, _system_prompt: &str, _user_prompt: &str) -> Option<LlmVerdict> {
11        None
12    }
13
14    fn complete(&self, _system_prompt: &str, _user_prompt: &str) -> Option<String> {
15        None
16    }
17}
18
19#[cfg(test)]
20mod tests {
21    use super::*;
22
23    #[test]
24    fn always_returns_none() {
25        assert!(NullLlmClient.evaluate("x", "y").is_none());
26    }
27}