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

don't send entire file when reviewing #263

Merged
merged 9 commits into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 80 additions & 60 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src/commenter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ export const COMMENT_REPLY_TAG =
export const SUMMARIZE_TAG =
'<!-- This is an auto-generated comment: summarize by openai -->'

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

Expand Down Expand Up @@ -134,7 +134,7 @@ ${tag}`
DESCRIPTION_START_TAG,
DESCRIPTION_END_TAG
)
const newDescription = `${description}\n${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
const newDescription = `${description}${DESCRIPTION_START_TAG}\n${messageClean}\n${DESCRIPTION_END_TAG}`
await octokit.pulls.update({
owner: repo.owner,
repo: repo.repo,
Expand Down
5 changes: 3 additions & 2 deletions src/limits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ export class TokenLimits {
this.maxTokens = 8000
this.responseTokens = 2000
} else {
this.maxTokens = 3900
this.maxTokens = 4000
this.responseTokens = 1000
}
harjotgill marked this conversation as resolved.
Show resolved Hide resolved
this.requestTokens = this.maxTokens - this.responseTokens
// provide some margin for the request tokens
this.requestTokens = this.maxTokens - this.responseTokens - 100
}

string(): string {
Expand Down
Loading