Enhances code documentation and structure for plugin #3

Merged
AlexKucera merged 20 commits from docstrings into master 2025-10-25 10:50:22 +02:00
2 changed files with 20 additions and 6 deletions
Showing only changes of commit 4efa8a1282 - Show all commits

No files matched your search

+1 -1
View File
@@ -235,7 +235,7 @@ export class FreewritingCleanupSettingTab extends PluginSettingTab {
const limits = usageDiv.createEl('p'); const limits = usageDiv.createEl('p');
limits.createEl('strong', { text: 'Limits: ' }); limits.createEl('strong', { text: 'Limits: ' });
limits.appendText(`Maximum ${ANTHROPIC_LIMITS.MAX_CHARACTERS.toLocaleString()} characters per cleanup (~${Math.floor(ANTHROPIC_LIMITS.MAX_TOKENS / 4).toLocaleString()} words estimated)`); limits.appendText(`Maximum ${ANTHROPIC_LIMITS.MAX_TOKENS.toLocaleString()} tokens per cleanup (~${ANTHROPIC_LIMITS.MAX_CHARACTERS.toLocaleString()} characters, varies by language)`);
const format = usageDiv.createEl('p'); const format = usageDiv.createEl('p');
format.createEl('strong', { text: 'Format: ' }); format.createEl('strong', { text: 'Format: ' });
+19 -5
View File
3
@@ -231,10 +231,24 @@ export const COMMENTARY_PRESETS: Record<Exclude<CommentaryStyle, 'custom'>, stri
* Used for validation before making API calls. * Used for validation before making API calls.
*/ */
export const ANTHROPIC_LIMITS = { export const ANTHROPIC_LIMITS = {
/** Maximum input tokens */ /** Maximum input tokens allowed by Claude API */
MAX_TOKENS: 200000, MAX_TOKENS: 200000,
/** Maximum input characters */ /**
MAX_CHARACTERS: 680000, * Approximate maximum input characters
/** Default maximum output tokens per request */ *
DEFAULT_MAX_OUTPUT_TOKENS: 4000 * Character count is approximate and depends on tokenization.
* Uses rough estimate of ≈ 4 characters per token, which varies by language
* and text structure. Actual token count may differ from this estimation.
*/
MAX_CHARACTERS: 800000, // Derived from MAX_TOKENS * 4 (conservative estimate)
/**
* Default maximum output tokens per request
*
* Set to 8192 which works for most current Claude models:
* - Claude 3 Haiku: 4096 tokens (will be capped by API)
* - Claude 3.5 Sonnet: 8192 tokens
* - Claude 3.5 Haiku: 8192 tokens
* - Future models may support higher limits
*/
DEFAULT_MAX_OUTPUT_TOKENS: 8192
} as const; } as const;