mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-02 23:28:39 +08:00
fix: remove hard-coded token limit for OpenAI
This commit is contained in:
parent
2b505caf98
commit
8143e5700f
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user