pi-read-chunks 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/read-chunks.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-read-chunks",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "A Pi Agent extension that uses a subagent to enhance `read` functionality for large text files to reduce context bloat, rot and lost in the middle issues.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|
package/read-chunks.ts
CHANGED
|
@@ -268,9 +268,14 @@ function buildSummarisePrompt(
|
|
|
268
268
|
hasPriorSummary
|
|
269
269
|
? "Include any relevant context from the prior summary below, but the summary should be focused on the new chunk. Do NOT repeat or echo the prior summary. Write a fresh summary of the CURRENT chunk."
|
|
270
270
|
: `Write a fresh summary of the CURRENT chunk. Be concise and factual. ${FACT_GUARD}`,
|
|
271
|
-
'If this chunk contains information that answers the query, begin your reply with exactly "| ANSWER:" ' +
|
|
271
|
+
'If this chunk contains information that FULLY answers the query, begin your reply with exactly "| ANSWER:" ' +
|
|
272
272
|
'followed by the precise answer passage, then a newline, then "---", then your NEW summary of this chunk.',
|
|
273
273
|
"Otherwise reply with ONLY your NEW summary of this chunk (no marker, no separator).",
|
|
274
|
+
|
|
275
|
+
"CRITICAL: Only emit the \"| ANSWER:\" marker if the chunk alone provides the COMPLETE answer to the query.",
|
|
276
|
+
"If the query requires information from multiple parts of the file (e.g., a synopsis, comparison, timeline),",
|
|
277
|
+
"do NOT mark individual chunks as answers. Continue reading until either the complete answer is found",
|
|
278
|
+
"or the file has been fully read.",
|
|
274
279
|
FACT_GUARD,
|
|
275
280
|
);
|
|
276
281
|
parts.push("", `Query: "${query}`);
|