-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.rs
More file actions
43 lines (39 loc) · 1.15 KB
/
config.rs
File metadata and controls
43 lines (39 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use anyhow::Result;
use crate::config::Config;
pub(in super::super) fn print_header() {
println!("DiffScope Doctor");
println!("================\n");
}
pub(in super::super) fn print_configuration(config: &Config) {
println!("Configuration:");
println!(" Model: {}", config.model);
println!(
" Adapter: {}",
config.adapter.as_deref().unwrap_or("(auto-detect)")
);
println!(
" Base URL: {}",
config.base_url.as_deref().unwrap_or("(default)")
);
println!(
" API Key: {}",
if config.api_key.is_some() {
"set"
} else {
"not set"
}
);
if let Some(cw) = config.context_window {
println!(" Context: {cw} tokens");
}
println!();
}
pub(in super::super) fn print_unreachable(base_url: &str) -> Result<()> {
println!("UNREACHABLE");
println!("\nCannot reach {base_url}. Make sure your LLM server is running.");
println!("\nQuick start:");
println!(" Ollama: ollama serve");
println!(" vLLM: vllm serve <model>");
println!(" LM Studio: Start the app and enable the local server");
Ok(())
}