Skip to content

Commit

Permalink
send only 20 most recent messages to LLM (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
glowingjade authored Oct 24, 2024
1 parent 9336f70 commit 5626944
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/promptGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export class PromptGenerator {
const requestMessages: RequestMessage[] = [
systemMessage,
...(currentFileMessage ? [currentFileMessage] : []),
...compiledMessages.map((message): RequestMessage => {
...compiledMessages.slice(-20).map((message): RequestMessage => {
if (message.role === 'user') {
return {
role: 'user',
Expand Down

0 comments on commit 5626944

Please sign in to comment.