diff --git a/internal/tools/gittar/ai/cr/impl/cr_mr_file/file.go b/internal/tools/gittar/ai/cr/impl/cr_mr_file/file.go index 594cd2ad7a5..95939ca8cc6 100644 --- a/internal/tools/gittar/ai/cr/impl/cr_mr_file/file.go +++ b/internal/tools/gittar/ai/cr/impl/cr_mr_file/file.go @@ -132,11 +132,13 @@ func (r *OneChangedFile) constructAIRequest(i18n i18n.Translator, lang i18n.Lang FileName string FileContent string UserLang string + Truncated bool } tmplArgs.CodeLanguage = r.CodeLanguage tmplArgs.FileName = r.FileName tmplArgs.FileContent = r.FileContent tmplArgs.UserLang = i18nutil.GetUserLang(lang) + tmplArgs.Truncated = r.Truncated for i := range req.Messages { t, _ := template.New("").Parse(req.Messages[i].Content) diff --git a/internal/tools/gittar/ai/cr/impl/cr_mr_file/prompt.yaml b/internal/tools/gittar/ai/cr/impl/cr_mr_file/prompt.yaml index 1b494090f9a..ef5d744be1b 100644 --- a/internal/tools/gittar/ai/cr/impl/cr_mr_file/prompt.yaml +++ b/internal/tools/gittar/ai/cr/impl/cr_mr_file/prompt.yaml @@ -5,7 +5,7 @@ messages: - role: system content: | You are an expert Software Engineer. - Below is a file, please help me do a brief code review on it (don't print file name and file content in your review). + Below is a file (content truncated: {{.Truncated}}), please help me do a brief code review on it (don't print file name and file content in your review). Please summarize the code and identify potential problems (at most 5). Start with the most important findings. File `{{.FileName}}`: