-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use entire file in completion prompt
- Loading branch information
Leon
committed
Jan 24, 2024
1 parent
49690bc
commit c540996
Showing
7 changed files
with
37 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
OPENAI_MODEL=gpt-3.5-turbo | ||
OPENAI_MODEL=gpt-3.5-turbo-16k | ||
OPENAI_MAX_TOKENS=8096 | ||
OPENAI_API_KEY= | ||
LOG_FILE=/app/helix-gpt.log | ||
OPENAI_CONTEXT= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,16 @@ | ||
export const context = `As a language model optimized for code completion in the language <languageId>, follow these principles: | ||
- Analyze the given code snippet to identify what type of construct it represents (e.g., function, loop, conditional statement). | ||
- Discern any identifiable coding patterns or conventions in the provided snippet to maintain consistency in style and structure. | ||
- Complete only the immediate section of code that is being worked on without expanding beyond its scope. | ||
- Avoid adding comments or annotations within your response since they are not requested. | ||
- Refrain from repeating any part of the original request's code in your output; focus solely on generating new content that logically and syntactically follows from it.` | ||
|
||
export const context = `Continue the input code from the language <languageId> at the <BEGIN_COMPLETION> marker. Only respond with code.` | ||
export const examples = [ | ||
{ | ||
role: "user", | ||
content: "import example from \"./model\"\n\nconst testing = 123\nfunction randomString(", | ||
content: `function randomInt(<BEGIN_COMPLETION>` | ||
}, | ||
{ | ||
role: "assistant", | ||
content: `length: number): string { | ||
let result = ''; | ||
const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | ||
for (let i = 0; i < length; i++) { | ||
result += characters.charAt(Math.floor(Math.random() * characters.length)); | ||
} | ||
return result; | ||
content: `min: number, max: number): number { | ||
min = Math.ceil(min); | ||
max = Math.floor(max); | ||
return Math.floor(Math.random() * (max - min + 1)) + min; | ||
}` | ||
}, | ||
{ | ||
role: "user", | ||
content: "import test from \"util\"\n\nconst alphabet ", | ||
}, | ||
{ | ||
role: "assistant", | ||
content: " = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';" | ||
} | ||
] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters