feat: increase vault context limits and make them configurable
- Replace hardcoded 2000-char context limit with configurable maxContextLength setting (default: 8000 characters) - Increase vaultSearchLimit default from 3 to 5 notes - Add 'Max Context Length' setting to plugin settings UI - Update README with new defaults - Update chat-view tests for new setting
This commit is contained in:
+2
-2
@@ -434,7 +434,7 @@ export class ChatView extends ItemView {
|
||||
return;
|
||||
}
|
||||
|
||||
const MAX_CONTEXT_LENGTH = 2000;
|
||||
const maxContextLength = this.settings.maxContextLength;
|
||||
const tools = this.getTools();
|
||||
const messageId = crypto.randomUUID();
|
||||
const userMessageId = `${messageId}-user`;
|
||||
@@ -490,7 +490,7 @@ export class ChatView extends ItemView {
|
||||
return parts.join('\n');
|
||||
})
|
||||
.join('\n\n')
|
||||
.slice(0, MAX_CONTEXT_LENGTH);
|
||||
.slice(0, maxContextLength);
|
||||
const userMessageWithContext = context
|
||||
? `Relevant vault context:\n${context}\n\nUser question:\n${userMessage}`
|
||||
: userMessage;
|
||||
|
||||
Reference in New Issue
Block a user