This repository was archived by the owner on Mar 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Expand file tree Collapse file tree 4 files changed +26
-19
lines changed Original file line number Diff line number Diff line change @@ -146,11 +146,11 @@ export class TokenLimits {
146
146
147
147
constructor ( model = 'gpt-3.5-turbo' ) {
148
148
if ( model === 'gpt-4-32k' ) {
149
- this . max_tokens = 32000
149
+ this . max_tokens = 32700
150
150
this . response_tokens = 4000
151
151
} else if ( model === 'gpt-4' ) {
152
- this . max_tokens = 5000
153
- this . response_tokens = 1500
152
+ this . max_tokens = 8100
153
+ this . response_tokens = 2000
154
154
} else {
155
155
this . max_tokens = 4000
156
156
this . response_tokens = 1000
Original file line number Diff line number Diff line change @@ -147,8 +147,9 @@ export const handleReviewComment = async (
147
147
prompts . summarize_file_diff . split ( '$file_content' ) . length - 1
148
148
const file_content_tokens = tokenizer . get_token_count ( file_content )
149
149
if (
150
+ file_content_count > 0 &&
150
151
tokens + file_content_tokens * file_content_count <=
151
- options . heavy_token_limits . request_tokens
152
+ options . heavy_token_limits . request_tokens
152
153
) {
153
154
tokens += file_content_tokens * file_content_count
154
155
inputs . file_content = file_content
@@ -165,8 +166,9 @@ export const handleReviewComment = async (
165
166
prompts . summarize_file_diff . split ( '$file_diff' ) . length - 1
166
167
const file_diff_tokens = tokenizer . get_token_count ( file_diff )
167
168
if (
169
+ file_diff_count > 0 &&
168
170
tokens + file_diff_tokens * file_diff_count <=
169
- options . heavy_token_limits . request_tokens
171
+ options . heavy_token_limits . request_tokens
170
172
) {
171
173
tokens += file_diff_tokens * file_diff_count
172
174
inputs . file_diff = file_diff
Original file line number Diff line number Diff line change @@ -198,8 +198,9 @@ ${hunks.old_hunk}
198
198
prompts . summarize_file_diff . split ( '$file_content' ) . length - 1
199
199
const file_content_tokens = tokenizer . get_token_count ( file_content )
200
200
if (
201
+ file_content_count > 0 &&
201
202
tokens + file_content_tokens * file_content_count <=
202
- options . light_token_limits . request_tokens
203
+ options . light_token_limits . request_tokens
203
204
) {
204
205
tokens += file_content_tokens * file_content_count
205
206
ins . file_content = file_content
381
382
const file_content_count =
382
383
prompts . summarize_file_diff . split ( '$file_content' ) . length - 1
383
384
const file_content_tokens = tokenizer . get_token_count ( file_content )
384
-
385
385
if (
386
+ file_content_count > 0 &&
386
387
tokens + file_content_tokens * file_content_count <=
387
- options . heavy_token_limits . request_tokens
388
+ options . heavy_token_limits . request_tokens
388
389
) {
389
390
ins . file_content = file_content
390
391
tokens += file_content_tokens * file_content_count
You can’t perform that action at this time.
0 commit comments