feat(commit): 添加提交消息模板支持
- 移除 config 命令中未使用的 List 子命令及相关显示字段 - 统一 ChangelogCommand 和 CommitCommand 的 ContentGenerator 初始化方式
This commit is contained in:
@@ -201,8 +201,16 @@ impl LlmClient {
|
||||
diff: &str,
|
||||
format: crate::config::CommitFormat,
|
||||
language: Language,
|
||||
template: Option<&str>,
|
||||
) -> Result<GeneratedCommit> {
|
||||
let system_prompt = get_commit_system_prompt(format, language);
|
||||
let mut system_prompt = get_commit_system_prompt(format, language).to_string();
|
||||
|
||||
if let Some(tmpl) = template {
|
||||
system_prompt.push_str(&format!(
|
||||
"\n\n## Commit Message Template\nFollow this template structure:\n{}",
|
||||
tmpl
|
||||
));
|
||||
}
|
||||
|
||||
// Add language instruction to the prompt
|
||||
let language_instruction = match language {
|
||||
@@ -218,7 +226,7 @@ impl LlmClient {
|
||||
let prompt = format!("{}{}", diff, language_instruction);
|
||||
let response = self
|
||||
.provider
|
||||
.generate_with_system(system_prompt, &prompt)
|
||||
.generate_with_system(&system_prompt, &prompt)
|
||||
.await?;
|
||||
|
||||
self.parse_commit_response(&response, format)
|
||||
|
||||
Reference in New Issue
Block a user