Timeline: document upload, upgraded prompt, CSV export, date_type badge
This commit is contained in:
+19
-6
@@ -286,7 +286,20 @@ PROMPT;
|
||||
|
||||
$locale = $language === 'no' ? 'Norwegian' : 'English';
|
||||
$prompt = <<<PROMPT
|
||||
Build a chronological timeline from this pasted text in {$locale}. Keep uncertain dates explicit.
|
||||
Build a chronological timeline from the pasted text in {$locale}.
|
||||
|
||||
Extract ALL dates, deadlines, milestones, and temporal references.
|
||||
For each temporal reference provide:
|
||||
- "date": ISO 8601 date (YYYY-MM-DD) if determinable, otherwise a human-readable description
|
||||
- "date_type": one of absolute | relative | recurring | conditional | period
|
||||
- "actor": person, institution, or party involved — or "unknown"
|
||||
- "event": concise description of what happened or is due
|
||||
- "source_excerpt": the verbatim phrase from the text that grounds this event (≤ 30 words)
|
||||
- "confidence": high | medium | low
|
||||
|
||||
Sort events chronologically (absolute dates first, then relative, then recurring).
|
||||
Keep uncertain dates explicit — do not invent dates not in the text.
|
||||
If multiple documents are separated by "--- Document: … ---" markers, note the source document in the event description where helpful.
|
||||
|
||||
Pasted text:
|
||||
{$text}
|
||||
@@ -294,14 +307,14 @@ Pasted text:
|
||||
Return JSON only:
|
||||
{
|
||||
"what_we_found": "short overview",
|
||||
"events": [{"date":"YYYY-MM-DD, month/year, or unknown","actor":"actor or unknown","event":"event","source_excerpt":"short excerpt","confidence":"high|medium|low"}],
|
||||
"evidence_trail": [{"title":"Pasted text","excerpt":"short relevant excerpt"}],
|
||||
"what_remains_uncertain": ["uncertainty"],
|
||||
"next_practical_step": "one concrete next action"
|
||||
"events": [{"date":"...","date_type":"absolute","actor":"...","event":"...","source_excerpt":"...","confidence":"high|medium|low"}],
|
||||
"evidence_trail": [{"title":"...","excerpt":"..."}],
|
||||
"what_remains_uncertain": ["..."],
|
||||
"next_practical_step": "..."
|
||||
}
|
||||
PROMPT;
|
||||
|
||||
$json = $this->runJsonTool($prompt, $language, 1600);
|
||||
$json = $this->runJsonTool($prompt, $language, 4000);
|
||||
$events = is_array($json['events'] ?? null) ? $json['events'] : [];
|
||||
$trace = [
|
||||
$this->trace('Query interpretation', 'Extract dated events from pasted text without saving the text or output.', 'complete'),
|
||||
|
||||
Reference in New Issue
Block a user