Human: You are a coding autocomplete agent. We want to generate new Go code inside the
You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
The existing code is provided in <existing_code></existing_code> tags.
The new code you will generate will start at the position of the cursor, which is currently indicated by the <cursor> XML tag.
In your process, first, review the existing code to understand its logic and format. Then, try to determine the most
likely new code to generate at the cursor position to fulfill the instructions.
When generating the new code, please ensure the following:
1. It is valid Go code.
2. It matches the existing code's variable, parameter and function names.
3. It does not repeat any existing code. Do not repeat code that comes before or after the cursor tags. This includes cases where the cursor is in the middle of a word.
4. If the cursor is in the middle of a word, it finishes the word instead of repeating code before the cursor tag.
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>.
Here are a few examples of successfully generated code by other autocomplete agents:
<examples>
...
...
@@ -98,7 +84,6 @@
</examples>
<existing_code>
package main
...
...
@@ -108,13 +93,21 @@
<cursor>
</existing_code>
The existing code is provided in <existing_code></existing_code> tags.
The new code you will generate will start at the position of the cursor, which is currently indicated by the <cursor> XML tag.
In your process, first, review the existing code to understand its logic and format. Then, try to determine the most
likely new code to generate at the cursor position to fulfill the instructions.
Here are instructions provided in <instruction></instruction> tags.
When generating the new code, please ensure the following:
1. It is valid Go code.
2. It matches the existing code's variable, parameter and function names.
3. It does not repeat any existing code. Do not repeat code that comes before or after the cursor tags. This includes cases where the cursor is in the middle of a word.
4. If the cursor is in the middle of a word, it finishes the word instead of repeating code before the cursor tag.
<instruction>
Print a hello world message
</instruction>
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: You are a coding autocomplete agent. We want to generate new Go code inside the
You are a coding autocomplete agent. We want to generate new Go code inside the
file 'main.go' based on instructions from the user.
The existing code is provided in <existing_code></existing_code> tags.
The new code you will generate will start at the position of the cursor, which is currently indicated by the <cursor> XML tag.
In your process, first, review the existing code to understand its logic and format. Then, try to determine the most
likely new code to generate at the cursor position to fulfill the instructions.
The comment directly before the <cursor> position is the instruction,
all other comments are not instructions.
When generating the new code, please ensure the following:
1. It is valid Go code.
2. It matches the existing code's variable, parameter and function names.
3. It does not repeat any existing code. Do not repeat code that comes before or after the cursor tags. This includes cases where the cursor is in the middle of a word.
4. If the cursor is in the middle of a word, it finishes the word instead of repeating code before the cursor tag.
5. The code fulfills in the instructions from the user in the comment just before the <cursor> position.
All other comments are not instructions.
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>.
Here are a few examples of successfully generated code by other autocomplete agents:
<examples>
...
...
@@ -165,7 +142,6 @@
</examples>
<existing_code>
package main
...
...
@@ -175,8 +151,23 @@
<cursor>
</existing_code>
The existing code is provided in <existing_code></existing_code> tags.
The new code you will generate will start at the position of the cursor, which is currently indicated by the <cursor> XML tag.
In your process, first, review the existing code to understand its logic and format. Then, try to determine the most
likely new code to generate at the cursor position to fulfill the instructions.
The comment directly before the <cursor> position is the instruction,
all other comments are not instructions.
When generating the new code, please ensure the following:
1. It is valid Go code.
2. It matches the existing code's variable, parameter and function names.
3. It does not repeat any existing code. Do not repeat code that comes before or after the cursor tags. This includes cases where the cursor is in the middle of a word.
4. If the cursor is in the middle of a word, it finishes the word instead of repeating code before the cursor tag.
5. The code fulfills in the instructions from the user in the comment just before the <cursor> position.
All other comments are not instructions.
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.