Skip to content
Snippets Groups Projects
Commit 381e4bd1 authored by Jan Provaznik's avatar Jan Provaznik
Browse files

Merge branch 'fix-code-suggestions-prompt-for-anthropic' into 'master'

parents 7456695c 386a9e63
No related branches found
No related tags found
1 merge request!138637Fix code generation anthropic prompt
Pipeline #1094474318 passed
......@@ -20,7 +20,7 @@ def request_params
def prompt
<<~PROMPT.strip
You are a coding autocomplete agent. We want to generate new #{language.name} code inside the
Human: You are a coding autocomplete agent. We want to generate new #{language.name} code inside the
file '#{file_path_info}' based on instructions from the user.
#{examples_section}
#{existing_code_block}
......@@ -38,7 +38,7 @@ def prompt
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: #{instructions}
#{instructions}
Assistant: <new_code>
PROMPT
......
......@@ -68,7 +68,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new Go code inside the
Human: You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
Here are a few examples of successfully generated code by other autocomplete agents:
......@@ -107,7 +107,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Print a hello world message
Print a hello world message
Assistant: <new_code>
PROMPT
......@@ -126,7 +126,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new Go code inside the
Human: You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
Here are a few examples of successfully generated code by other autocomplete agents:
......@@ -168,7 +168,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Generate the most likely code based on instructions.
Generate the most likely code based on instructions.
Assistant: <new_code>
PROMPT
......@@ -189,7 +189,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new Go code inside the
Human: You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
......@@ -207,7 +207,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Print a hello world message
Print a hello world message
Assistant: <new_code>
PROMPT
......@@ -230,7 +230,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new Go code inside the
Human: You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
<existing_code>
......@@ -252,7 +252,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Print a hello world message
Print a hello world message
Assistant: <new_code>
PROMPT
......@@ -273,7 +273,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new code inside the
Human: You are a coding autocomplete agent. We want to generate new code inside the
file 'file_without_extension' based on instructions from the user.
<existing_code>
......@@ -299,7 +299,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Print a hello world message
Print a hello world message
Assistant: <new_code>
PROMPT
......@@ -320,7 +320,7 @@
model_provider: ::CodeSuggestions::TaskFactory::ANTHROPIC,
prompt_version: 2,
prompt: <<~PROMPT
You are a coding autocomplete agent. We want to generate new code inside the
Human: You are a coding autocomplete agent. We want to generate new code inside the
file 'README.md' based on instructions from the user.
<existing_code>
......@@ -346,7 +346,7 @@
Return new code enclosed in <new_code></new_code> tags. We will then insert this at the <cursor> position.
If you are not able to write code based on the given instructions return an empty result like <new_code></new_code>.
Human: Print a hello world message
Print a hello world message
Assistant: <new_code>
PROMPT
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment