Skip to content
This repository was archived by the owner on Mar 6, 2024. It is now read-only.

Commit bad0f55

Browse files
authored
don't send entire file when reviewing (#263)
<!-- This is an auto-generated comment: release notes by openai --> ### Summary by OpenAI ## Release Notes - **Improvement:** Updated constants, increased limits, improved message formatting, added error handling, and logging statements to enhance the performance, security, and maintainability of the system. > "Codebase refined, > Performance enhanced, > Bugs squashed, > Celebrate with a 🎉!" <!-- end of auto-generated comment: release notes by openai -->
1 parent 60b7c63 commit bad0f55

File tree

5 files changed

+166
-121
lines changed

5 files changed

+166
-121
lines changed

dist/index.js

Lines changed: 80 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/commenter.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ export const COMMENT_REPLY_TAG =
1818
export const SUMMARIZE_TAG =
1919
'<!-- This is an auto-generated comment: summarize by openai -->'
2020

21-
export const DESCRIPTION_START_TAG =
22-
'<!-- This is an auto-generated comment: release notes by openai -->'
21+
export const DESCRIPTION_START_TAG = `
22+
<!-- This is an auto-generated comment: release notes by openai -->`
2323
export const DESCRIPTION_END_TAG =
2424
'<!-- end of auto-generated comment: release notes by openai -->'
2525

@@ -134,7 +134,7 @@ ${tag}`
134134
DESCRIPTION_START_TAG,
135135
DESCRIPTION_END_TAG
136136
)
137-
const newDescription = `${description}\n${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
137+
const newDescription = `${description}${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
138138
await octokit.pulls.update({
139139
owner: repo.owner,
140140
repo: repo.repo,

src/limits.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ export class TokenLimits {
1313
this.maxTokens = 8000
1414
this.responseTokens = 2000
1515
} else {
16-
this.maxTokens = 3900
16+
this.maxTokens = 4000
1717
this.responseTokens = 1000
1818
}
19-
this.requestTokens = this.maxTokens - this.responseTokens
19+
// provide some margin for the request tokens
20+
this.requestTokens = this.maxTokens - this.responseTokens - 100
2021
}
2122

2223
string(): string {

0 commit comments

Comments
 (0)