Skip to content

Commit f3d6745

Browse files
committed
Update model detection and edit code prompt
1 parent 05ca7fb commit f3d6745

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/calc/tokens.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func PreciseTokensFromMessages(messages []openai.ChatCompletionMessage, model st
5959
if model == "gpt-3.5-turbo-0301" || model == "gpt-3.5-turbo" {
6060
tokens_per_message = 4
6161
tokens_per_name = -1
62-
} else if strings.Contains(model, "4") {
62+
} else if strings.Contains(model, "gpt-4") {
6363
tokens_per_message = 3
6464
tokens_per_name = 1
6565
} else {

pkg/constants/prompts.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ var PR_BODY_PROMPT string = "You are a helpful assistant who writes pull request
4040

4141
var COMPRESS_DIFF_PROMPT string = "You are a helpful assistant who describes git diff changes. You will be given a Git diff and you should use it to create a description of the changes. The description should be no longer than 75 characters long and should describe the changes in the diff. Do not include the file names in the description."
4242

43-
var EDIT_CODE_PROMPT string = `You are a helpful assistant who edits code. You will be given a file what you are trying to accomplish in the edit and you should edit it to the best of your abilities. Only edit the code you are told. All code to edit will be preceded by "EDIT:". If "EDIT:" is omitted, assume you must edit the entire file. The goal of the edit will be preceded by "GOAL:". The entire file will be preceded by "FILE:". If there is not content after "FILE:", assume you are writing new code. There may also be additional files added to give you more information about the project, those will be preceded by 'CONTEXT: '. DO NOT EDIT THOSE FILES. Make sure to use the language specified in the task. The output code should be unformatted. Use no markdown.\n`
43+
var EDIT_CODE_PROMPT string = `You are a helpful assistant who edits code. You will be given a file what you are trying to accomplish in the edit and you should edit it to the best of your abilities. Only edit the code you are told. All code to edit will be preceded by "EDIT:". If "EDIT:" is omitted, assume you must edit the entire file. The goal of the edit will be preceded by "GOAL:". The entire file will be preceded by "FILE:". If there is not content after "FILE:", assume you are writing new code. There may also be additional files added to give you more information about the project, those will be preceded by 'CONTEXT: '. DO NOT EDIT THOSE FILES. Make sure to use the language specified in the task. The output code should be unformatted. Use no markdown and do not output "EDIT:" or any other context directives.\n`
4444

4545
var RELEASE_PROMPT string = `You are a helpful assistant who creates GitHub release notes from git commit logs. You will be given a series of git commit messages and your task is to summarize these messages into release notes. The release notes should:
4646
- Be concise and informative about the changes made in the release.

0 commit comments

Comments
 (0)