Merge pull request #307 from keneo/patch-issue-306

fix as described in https://github.com/kolbytn/mindcraft/issues/306
This commit is contained in:
Max Robinson 2024-11-09 13:23:52 -06:00 committed by GitHub
commit d265409c55
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,7 @@ export class GPT {
catch (err) {
if ((err.message == 'Context length exceeded' || err.code == 'context_length_exceeded') && turns.length > 1) {
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 {
console.log(err);
res = 'My brain disconnected, try again.';