fix: remove hard-coded token limit for OpenAI

This commit is contained in:
KernelDeimos 2025-01-22 17:28:18 -05:00
parent 2b505caf98
commit 8143e5700f

View File

@ -354,17 +354,6 @@ class OpenAICompletionService extends BaseService {
}
}
const max_tokens = 4096 - token_count;
console.log('MAX TOKENS ???', max_tokens);
const svc_apiErrpr = this.services.get('api-error');
if ( max_tokens <= 8 ) {
throw svc_apiErrpr.create('max_tokens_exceeded', {
input_tokens: token_count,
max_tokens: 4096 - 8,
});
}
const completion = await this.openai.chat.completions.create({
user: user_private_uid,
messages: messages,