mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
feat: add file monitoring guidelines to settings with provider-specific instructions
Add a new "File Monitoring Guidelines" section in plugin settings that displays provider-specific information about uploaded file retention and cleanup. The section includes a help button that opens the Plugin Guide modal and updates dynamically based on the selected AI provider (Claude, Gemini, or OpenAI). Also update help modal content with file monitoring information and fix example template link.
This commit is contained in:
parent
4d72bba087
commit
2420cec7bf
2 changed files with 64 additions and 2 deletions
|
|
@ -41,6 +41,7 @@ export enum Copy {
|
|||
SettingContext = "Context",
|
||||
SettingSearchResultsLimit = "Search Results Limit",
|
||||
SettingSnippetSizeLimit = "Snippet Size Limit",
|
||||
SettingFileMonitoringHeading = "File Monitoring Guidelines",
|
||||
|
||||
// Settings Descriptions
|
||||
SettingModelDesc = "Select the AI model to use.",
|
||||
|
|
@ -48,6 +49,9 @@ export enum Copy {
|
|||
SettingFileExclusionsDesc = "Set which directories and files the AI should ignore. Enter one path per line - supports glob patterns like folder/**, *.md",
|
||||
SettingSearchResultsLimitDesc = "Set the maximum number of results provided to the AI when it searches through files in your vault. Higher values provide more context but increase search time.",
|
||||
SettingSnippetSizeLimitDesc = "Set the character limit of search previews provided to the AI when it searches through files in your vault. Higher values provide more context per result.",
|
||||
SettingFileMonitoringGemini = "Files uploaded to Gemini are automatically deleted after 48 hours and will be re-uploaded during conversations as needed. No manual cleanup is typically required.",
|
||||
SettingFileMonitoringClaude = "Files uploaded to Claude remain stored indefinitely. Periodically check the Anthropic Console (https://console.anthropic.com/) to review and remove old files that are no longer needed.",
|
||||
SettingFileMonitoringOpenAI = "Files uploaded to OpenAI remain stored indefinitely. Periodically check the OpenAI Platform (https://platform.openai.com/) to review and remove old files that are no longer needed.",
|
||||
|
||||
// Settings Placeholders
|
||||
PlaceholderEnterApiKey = "Enter your API key",
|
||||
|
|
@ -56,6 +60,7 @@ export enum Copy {
|
|||
// Settings Tooltips
|
||||
TooltipShowApiKey = "Show API Key",
|
||||
TooltipHideApiKey = "Hide API Key",
|
||||
TooltipLearnMoreFileMonitoring = "Learn more in Plugin Guide",
|
||||
|
||||
AIThoughtMessage = "Thinking...",
|
||||
|
||||
|
|
@ -108,7 +113,21 @@ Customize AI behavior for specific workflows:
|
|||
3. Select your instruction set
|
||||
4. The AI follows these instructions for all interactions
|
||||
|
||||
See [Example Template](#/page/Vault%20AI%2FUser%20Instructions%2FEXAMPLE_INSTRUCTIONS) for help getting started.`,
|
||||
See [Example Template](#/page/Vaultkeeper%20AI%2FUser%20Instructions%2FEXAMPLE_INSTRUCTIONS) for help getting started.
|
||||
|
||||
##### File Monitoring
|
||||
|
||||
When you upload files (PDFs, images) to conversations, they are stored by your AI provider. The plugin automatically attempts to delete these files when you delete conversations, but this may occasionally fail due to network issues or API rate limits.
|
||||
|
||||
**What to do:**
|
||||
- Periodically check your provider's dashboard for uploaded files
|
||||
- Remove any old files that are no longer needed
|
||||
- Provider-specific details can be found in the plugin settings
|
||||
|
||||
**Provider Dashboards:**
|
||||
- Claude: [Anthropic Console](https://console.anthropic.com/)
|
||||
- Gemini: [Google AI Studio](https://aistudio.google.com/)
|
||||
- OpenAI: [OpenAI Platform](https://platform.openai.com/)`,
|
||||
|
||||
HelpModalTroubleshootTitle = "Troubleshooting",
|
||||
HelpModalTroubleshootContent = `#### Common Issues & Solutions
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
import { AIProviderModel, fromModel } from "Enums/ApiProvider";
|
||||
import { AIProvider, AIProviderModel, fromModel } from "Enums/ApiProvider";
|
||||
import { Copy } from "Enums/Copy";
|
||||
import { Selector } from "Enums/Selector";
|
||||
import type VaultkeeperAIPlugin from "main";
|
||||
import { HelpModal } from "Modals/HelpModal";
|
||||
import { PluginSettingTab, Setting, setIcon, setTooltip } from "obsidian";
|
||||
import { Resolve } from "Services/DependencyService";
|
||||
import type { SettingsService } from "Services/SettingsService";
|
||||
|
|
@ -13,6 +14,7 @@ export class VaultkeeperAISettingTab extends PluginSettingTab {
|
|||
|
||||
private apiKeySetting: Setting | null = null;
|
||||
private apiKeyInputEl: HTMLInputElement | null = null;
|
||||
private fileDisclaimerSetting: Setting | null = null;
|
||||
|
||||
constructor() {
|
||||
const plugin = Resolve<VaultkeeperAIPlugin>(Services.VaultkeeperAIPlugin);
|
||||
|
|
@ -129,6 +131,7 @@ export class VaultkeeperAISettingTab extends PluginSettingTab {
|
|||
this.apiKeyInputEl.value = this.settingsService.getApiKeyForCurrentModel();
|
||||
this.highlightApiKey();
|
||||
}
|
||||
this.updateFileDisclaimer();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
@ -214,6 +217,25 @@ export class VaultkeeperAISettingTab extends PluginSettingTab {
|
|||
await this.settingsService.saveSettings();
|
||||
});
|
||||
});
|
||||
|
||||
/* File Monitoring Guidelines */
|
||||
new Setting(containerEl)
|
||||
.setHeading()
|
||||
.setName(Copy.SettingFileMonitoringHeading);
|
||||
|
||||
this.fileDisclaimerSetting = new Setting(containerEl)
|
||||
.setDesc(Copy.SettingFileMonitoringClaude)
|
||||
.addExtraButton(button => {
|
||||
button
|
||||
.setTooltip(Copy.TooltipLearnMoreFileMonitoring)
|
||||
.onClick(() => {
|
||||
const modal = Resolve<HelpModal>(Services.HelpModal);
|
||||
modal.open(2); // Opens HelpModal to "Plugin Guide" (topic 2)
|
||||
});
|
||||
setIcon(button.extraSettingsEl, "help-circle");
|
||||
});
|
||||
|
||||
this.updateFileDisclaimer();
|
||||
}
|
||||
|
||||
private highlightApiKey() {
|
||||
|
|
@ -228,4 +250,25 @@ export class VaultkeeperAISettingTab extends PluginSettingTab {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
private updateFileDisclaimer() {
|
||||
if (this.fileDisclaimerSetting) {
|
||||
const provider = fromModel(this.settingsService.settings.model);
|
||||
let disclaimerText;
|
||||
|
||||
switch(provider) {
|
||||
case AIProvider.Gemini:
|
||||
disclaimerText = Copy.SettingFileMonitoringGemini;
|
||||
break;
|
||||
case AIProvider.Claude:
|
||||
disclaimerText = Copy.SettingFileMonitoringClaude;
|
||||
break;
|
||||
case AIProvider.OpenAI:
|
||||
disclaimerText = Copy.SettingFileMonitoringOpenAI;
|
||||
break;
|
||||
}
|
||||
|
||||
this.fileDisclaimerSetting.setDesc(disclaimerText);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue