fix: 优化生成 Prompt 的标题映射,移除技术术语
- 标签约束 → 约束 - 用户自定义内容 → 自定义内容 - 片段内容 → 参考片段 - 片段: xxx → xxx(去掉前缀) - 智能建议补充 → 补充建议
This commit is contained in:
@@ -210,7 +210,7 @@ func AssemblePrompt(projectName string, customContent string, tagOptions []model
|
||||
|
||||
// Custom content
|
||||
if customContent != "" {
|
||||
parts = append(parts, fmt.Sprintf("## 用户自定义内容\n\n%s", customContent))
|
||||
parts = append(parts, fmt.Sprintf("## 自定义内容\n\n%s", customContent))
|
||||
}
|
||||
|
||||
// Tag constraints
|
||||
@@ -219,21 +219,21 @@ func AssemblePrompt(projectName string, customContent string, tagOptions []model
|
||||
for _, opt := range tagOptions {
|
||||
constraints = append(constraints, fmt.Sprintf("- %s", opt.ConstraintText))
|
||||
}
|
||||
parts = append(parts, fmt.Sprintf("## 标签约束\n\n%s", strings.Join(constraints, "\n")))
|
||||
parts = append(parts, fmt.Sprintf("## 约束\n\n%s", strings.Join(constraints, "\n")))
|
||||
}
|
||||
|
||||
// Snippets
|
||||
if len(snippets) > 0 {
|
||||
var snippetParts []string
|
||||
for _, s := range snippets {
|
||||
snippetParts = append(snippetParts, fmt.Sprintf("--- 片段: %s ---\n%s", s.Name, s.Content))
|
||||
snippetParts = append(snippetParts, fmt.Sprintf("--- %s ---\n%s", s.Name, s.Content))
|
||||
}
|
||||
parts = append(parts, fmt.Sprintf("## 片段内容\n\n%s", strings.Join(snippetParts, "\n\n")))
|
||||
parts = append(parts, fmt.Sprintf("## 参考片段\n\n%s", strings.Join(snippetParts, "\n\n")))
|
||||
}
|
||||
|
||||
// Suggestions
|
||||
if len(suggestions) > 0 {
|
||||
parts = append(parts, fmt.Sprintf("## 智能建议补充\n\n%s", strings.Join(suggestions, "\n")))
|
||||
parts = append(parts, fmt.Sprintf("## 补充建议\n\n%s", strings.Join(suggestions, "\n")))
|
||||
}
|
||||
|
||||
return strings.Join(parts, "\n\n")
|
||||
|
||||
Reference in New Issue
Block a user