Skip to content

Commit

Permalink
Disable message context limit when tool use is involved (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkor committed Jul 4, 2024
1 parent d33b4f6 commit 8c3622a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/convo.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export async function complete(convo, onupdate, onabort, ondirect) {
return msgOAI;
});

if (param.messagesContextLimit > 0) {
if (param.messagesContextLimit > 0 && !messages.some((msg) => msg.role === 'tool')) {
// Keep only the last messagesContextLimit pairs of messages, and always keep the first message if it's a system message
const firstMessage = messages[0];
const isFirstMessageSystem = firstMessage && firstMessage.role === 'system';
Expand Down

0 comments on commit 8c3622a

Please sign in to comment.