Add user context notes field to timeline tool

Adds an optional textarea below the main text input where users can provide
clarifications to guide the LLM — e.g. year anchors, actor aliases, or focus
instructions. Notes are injected into the prompt as a clearly delimited block
and translated across all four UI languages (en/no/uk/pl).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-19 12:36:37 +02:00
parent dfb9692f45
commit 28932297b3
4 changed files with 28 additions and 3 deletions
+7 -2
View File
@@ -289,7 +289,8 @@ PROMPT;
string $focus = 'all',
string $confidenceFilter = 'all',
bool $includeRelative = true,
bool $includeBackground = true
bool $includeBackground = true,
string $userNotes = ''
): array {
$text = $this->requirePasteText($text);
$engine = in_array($engine, ['azure_mini', 'azure_full', 'gpu'], true) ? $engine : 'azure_mini';
@@ -316,8 +317,12 @@ PROMPT;
? ''
: "\nDo NOT extract relative, recurring, or conditional date references — extract only events with determinable absolute dates (date_type=absolute).";
$userNotesBlock = $userNotes !== ''
? "\n\nUser-provided context notes (use these to resolve ambiguities, not as source events):\n---\n" . $userNotes . "\n---"
: '';
$prompt = <<<PROMPT
Build a chronological timeline from the pasted text in {$locale}.
Build a chronological timeline from the pasted text in {$locale}.{$userNotesBlock}
Extract ALL dates, deadlines, milestones, and temporal references.{$focusInstruction}{$backgroundInstruction}{$relativeInstruction}