diff --git a/ee/lib/gitlab/llm/open_ai/templates/explain_vulnerability.rb b/ee/lib/gitlab/llm/open_ai/templates/explain_vulnerability.rb index d04055bfad3d33b71e97153261585391fa41e540..2f296a927b72c3a139d5c6e925a262cea4f59bfc 100644 --- a/ee/lib/gitlab/llm/open_ai/templates/explain_vulnerability.rb +++ b/ee/lib/gitlab/llm/open_ai/templates/explain_vulnerability.rb @@ -58,6 +58,7 @@ def default_prompt Provide a code example with syntax highlighting on how to exploit it. Provide a code example with syntax highlighting on how to fix it. + Provide the response in markdown format with headers. PROMPT end @@ -68,6 +69,7 @@ def prompt_without_code The vulnerable code is in the file "#{filename}". Provide a code example with syntax highlighting on how to exploit it. Provide a code example with syntax highlighting on how to fix it. + Provide the response in markdown format with headers. PROMPT end @@ -77,6 +79,7 @@ def prompt_without_file_or_code Explain the vulnerability "#{title} - #{description} (#{identifiers})". Provide a code example with syntax highlighting on how to exploit it. Provide a code example with syntax highlighting on how to fix it. + Provide the response in markdown format with headers. PROMPT end end diff --git a/ee/spec/lib/gitlab/llm/open_ai/templates/explain_vulnerability_spec.rb b/ee/spec/lib/gitlab/llm/open_ai/templates/explain_vulnerability_spec.rb index 2fa8edceec7eeffe524f77f7313ef9334b7e772a..188b45d42cb424d6b9c4f9bbfa82ddc8d250591d 100644 --- a/ee/spec/lib/gitlab/llm/open_ai/templates/explain_vulnerability_spec.rb +++ b/ee/spec/lib/gitlab/llm/open_ai/templates/explain_vulnerability_spec.rb @@ -79,6 +79,7 @@ The vulnerable code is in the file "#{vulnerability.file}". Provide a code example with syntax highlighting on how to exploit it. Provide a code example with syntax highlighting on how to fix it. + Provide the response in markdown format with headers. PROMPT end end @@ -95,6 +96,7 @@ Explain the vulnerability "#{vulnerability.title} - #{vulnerability.description} (#{identifiers})". Provide a code example with syntax highlighting on how to exploit it. Provide a code example with syntax highlighting on how to fix it. + Provide the response in markdown format with headers. PROMPT expect(subject.to_prompt).to eq(expected)