mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-01 21:05:31 +02:00
fix as described in https://github.com/kolbytn/mindcraft/issues/306
This commit is contained in:
parent
a6edd8fc44
commit
bd8f911637
1 changed files with 1 additions and 1 deletions
|
@ -44,7 +44,7 @@ export class GPT {
|
||||||
catch (err) {
|
catch (err) {
|
||||||
if ((err.message == 'Context length exceeded' || err.code == 'context_length_exceeded') && turns.length > 1) {
|
if ((err.message == 'Context length exceeded' || err.code == 'context_length_exceeded') && turns.length > 1) {
|
||||||
console.log('Context length exceeded, trying again with shorter context.');
|
console.log('Context length exceeded, trying again with shorter context.');
|
||||||
return await sendRequest(turns.slice(1), systemMessage, stop_seq);
|
return await this.sendRequest(turns.slice(1), systemMessage, stop_seq);
|
||||||
} else {
|
} else {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
res = 'My brain disconnected, try again.';
|
res = 'My brain disconnected, try again.';
|
||||||
|
|
Loading…
Add table
Reference in a new issue