Skip to content

Commit 8143e57

Browse files
committed
fix: remove hard-coded token limit for OpenAI
1 parent 2b505ca commit 8143e57

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

src/backend/src/modules/puterai/OpenAICompletionService.js

-11
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,6 @@ class OpenAICompletionService extends BaseService {
354354
}
355355
}
356356

357-
const max_tokens = 4096 - token_count;
358-
console.log('MAX TOKENS ???', max_tokens);
359-
360-
const svc_apiErrpr = this.services.get('api-error');
361-
if ( max_tokens <= 8 ) {
362-
throw svc_apiErrpr.create('max_tokens_exceeded', {
363-
input_tokens: token_count,
364-
max_tokens: 4096 - 8,
365-
});
366-
}
367-
368357
const completion = await this.openai.chat.completions.create({
369358
user: user_private_uid,
370359
messages: messages,

0 commit comments

Comments
 (0)