chat-agent-toolkit 1.2.111 → 1.2.112
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chat-agent-toolkit",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.112",
|
|
4
4
|
"description": "Multi-provider AI agent toolkit: generate language responses, search the web, extract content, and manage memory across 10+ LLM providers.",
|
|
5
5
|
"author": "vtempest <grokthiscontact@gmail.com>",
|
|
6
6
|
"license": "rights.institute/PROSPER",
|
|
@@ -112,19 +112,24 @@ export async function rerankDocs(
|
|
|
112
112
|
filesData = results.filter((r) => r !== null);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
// Uploaded files must always reach the LLM. Build their docs up front so
|
|
116
|
+
// every return path below keeps them in the answer context.
|
|
117
|
+
const fileDocs: Document[] = filesData.map((fileData) => ({
|
|
118
|
+
pageContent: fileData.content,
|
|
119
|
+
metadata: { title: fileData.title, url: "File" },
|
|
120
|
+
}));
|
|
121
|
+
|
|
115
122
|
if (query.toLocaleLowerCase() === "summarize") {
|
|
116
|
-
|
|
123
|
+
// Skip web-result reranking for an explicit "summarize" request, but keep
|
|
124
|
+
// the uploaded file content — otherwise attachments are silently dropped
|
|
125
|
+
// and never analysed.
|
|
126
|
+
return [...fileDocs, ...docs].slice(0, 15);
|
|
117
127
|
}
|
|
118
128
|
|
|
119
129
|
const docsWithContent = docs.filter(
|
|
120
130
|
(doc) => doc.pageContent && doc.pageContent.length > 0,
|
|
121
131
|
);
|
|
122
132
|
|
|
123
|
-
const fileDocs: Document[] = filesData.map((fileData) => ({
|
|
124
|
-
pageContent: fileData.content,
|
|
125
|
-
metadata: { title: fileData.title, url: "File" },
|
|
126
|
-
}));
|
|
127
|
-
|
|
128
133
|
// Combine file docs with web results, cap at 15
|
|
129
134
|
return [...fileDocs, ...docsWithContent].slice(0, 15);
|
|
130
135
|
}
|