LLM支持优化
This commit is contained in:
@@ -393,8 +393,15 @@ impl ConfigCommand {
|
||||
let timeout: u64 = value.parse()?;
|
||||
manager.config_mut().llm.timeout = timeout;
|
||||
}
|
||||
"llm.thinking_enabled" => {
|
||||
manager.config_mut().llm.thinking_enabled = value == "true";
|
||||
}
|
||||
"llm.thinking_budget_tokens" => {
|
||||
let budget: u32 = value.parse()?;
|
||||
manager.config_mut().llm.thinking_budget_tokens = Some(budget);
|
||||
}
|
||||
"llm.api_key_storage" => {
|
||||
let valid_values = vec!["keyring", "config", "environment"];
|
||||
let valid_values = ["keyring", "config", "environment"];
|
||||
if !valid_values.contains(&value) {
|
||||
bail!("Invalid value: {}. Use: {}", value, valid_values.join(", "));
|
||||
}
|
||||
@@ -433,6 +440,8 @@ impl ConfigCommand {
|
||||
"llm.max_tokens" => config.llm.max_tokens.to_string(),
|
||||
"llm.temperature" => config.llm.temperature.to_string(),
|
||||
"llm.timeout" => config.llm.timeout.to_string(),
|
||||
"llm.thinking_enabled" => config.llm.thinking_enabled.to_string(),
|
||||
"llm.thinking_budget_tokens" => config.llm.thinking_budget_tokens.map(|v| v.to_string()).unwrap_or_else(|| "none".to_string()),
|
||||
"llm.api_key_storage" => config.llm.api_key_storage.clone(),
|
||||
"commit.format" => config.commit.format.to_string(),
|
||||
"commit.auto_generate" => config.commit.auto_generate.to_string(),
|
||||
@@ -681,15 +690,13 @@ impl ConfigCommand {
|
||||
l.to_string()
|
||||
} else {
|
||||
println!("{}", "Select Output Language:".bold());
|
||||
let languages = vec![
|
||||
("en", "English"),
|
||||
let languages = [("en", "English"),
|
||||
("zh", "中文"),
|
||||
("ja", "日本語"),
|
||||
("ko", "한국어"),
|
||||
("es", "Español"),
|
||||
("fr", "Français"),
|
||||
("de", "Deutsch"),
|
||||
];
|
||||
("de", "Deutsch")];
|
||||
|
||||
let lang_names: Vec<&str> = languages.iter().map(|(_, n)| *n).collect();
|
||||
let idx = Select::new()
|
||||
@@ -879,8 +886,8 @@ impl ConfigCommand {
|
||||
manager.import(&config_content)?;
|
||||
manager.save()?;
|
||||
|
||||
if let (Some(pats), Some(pwd)) = (encrypted_pats, pwd) {
|
||||
if !pats.is_empty() {
|
||||
if let (Some(pats), Some(pwd)) = (encrypted_pats, pwd)
|
||||
&& !pats.is_empty() {
|
||||
println!();
|
||||
println!("{}", "Importing Personal Access Tokens...".bold());
|
||||
|
||||
@@ -951,7 +958,6 @@ impl ConfigCommand {
|
||||
println!("{} {} token(s) failed to import", "⚠".yellow(), failed_count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
println!("{} Configuration imported from {}", "✓".green(), file);
|
||||
Ok(())
|
||||
@@ -969,31 +975,35 @@ impl ConfigCommand {
|
||||
println!("Ollama models (local):");
|
||||
println!(" llama2, llama2-uncensored, llama2:13b");
|
||||
println!(" codellama, codellama:34b");
|
||||
println!(" mistral, mixtral");
|
||||
println!(" phi, gemma");
|
||||
println!(" mistral, mixtral, phi, gemma");
|
||||
println!("\nRun 'ollama list' to see installed models");
|
||||
}
|
||||
"openai" => {
|
||||
println!("OpenAI models:");
|
||||
println!(" gpt-4, gpt-4-turbo, gpt-4o");
|
||||
println!(" gpt-3.5-turbo, gpt-3.5-turbo-16k");
|
||||
println!(" o-series (reasoning): o4-mini, o3, o3-mini, o1, o1-mini, o1-pro");
|
||||
println!(" GPT-4: gpt-4.1, gpt-4.1-mini, gpt-4.1-nano, gpt-4o, gpt-4o-mini");
|
||||
println!(" Legacy: gpt-4-turbo, gpt-4, gpt-3.5-turbo");
|
||||
println!("\nUse --think/-t with o-series models for reasoning mode.");
|
||||
}
|
||||
"anthropic" => {
|
||||
println!("Anthropic Claude models:");
|
||||
println!(" claude-3-opus-20240229");
|
||||
println!(" claude-3-sonnet-20240229");
|
||||
println!(" claude-3-haiku-20240307");
|
||||
println!(" Claude 4 (thinking): claude-opus-4-7, claude-sonnet-4-6, claude-haiku-4-5");
|
||||
println!(" Claude 3.5: claude-3-opus-20240229, claude-3-sonnet-20240229, claude-3-haiku-20240307");
|
||||
println!(" Legacy: claude-2.1, claude-2.0, claude-instant-1.2");
|
||||
println!("\nUse --think/-t with Claude 4 models for extended thinking.");
|
||||
}
|
||||
"kimi" => {
|
||||
println!("Kimi (Moonshot AI) models:");
|
||||
println!(" moonshot-v1-8k");
|
||||
println!(" moonshot-v1-32k");
|
||||
println!(" moonshot-v1-128k");
|
||||
println!(" K2 (thinking): kimi-k2.6, kimi-k2.5, kimi-k2-thinking, kimi-k2-thinking-turbo");
|
||||
println!(" K2 instruct: kimi-k2-instruct, kimi-k2-instruct-0905");
|
||||
println!(" Legacy: moonshot-v1-8k, moonshot-v1-32k, moonshot-v1-128k");
|
||||
println!("\nUse --think/-t with K2 models for thinking mode.");
|
||||
}
|
||||
"deepseek" => {
|
||||
println!("DeepSeek models:");
|
||||
println!(" deepseek-chat");
|
||||
println!(" deepseek-reasoner");
|
||||
println!(" V4: deepseek-v4-flash, deepseek-v4-pro");
|
||||
println!(" Legacy: deepseek-chat, deepseek-reasoner (deprecated 2026-07-24)");
|
||||
println!("\nUse --think/-t for reasoning mode.");
|
||||
}
|
||||
"openrouter" => {
|
||||
println!("OpenRouter models (examples):");
|
||||
|
||||
Reference in New Issue
Block a user