@genai-fi/nanogpt 0.2.4 → 0.2.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/dist/TeachableLLM.js +1 -0
- package/dist/data/docx.d.ts +1 -0
- package/dist/data/docx.js +15 -0
- package/dist/data/pdf.d.ts +1 -1
- package/dist/data/pdf.js +10 -8
- package/dist/data/textLoader.js +29 -24
- package/dist/{jszip.min-CAxN99oA.js → jszip.min-CjP2V1VV.js} +1 -1
- package/dist/utilities/load.js +5 -5
- package/dist/utilities/save.js +1 -1
- package/package.json +1 -1
package/dist/TeachableLLM.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function loadDOCX(file: Blob | Uint8Array): Promise<string[]>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { j as a } from "../jszip.min-CjP2V1VV.js";
|
|
2
|
+
async function c(n) {
|
|
3
|
+
const t = await (await a.loadAsync(n)).file("word/document.xml")?.async("string");
|
|
4
|
+
if (!t) throw new Error("Failed to load document.xml");
|
|
5
|
+
return s(t).split(`
|
|
6
|
+
`).filter((r) => r.trim().length > 10);
|
|
7
|
+
}
|
|
8
|
+
function s(n) {
|
|
9
|
+
const t = new DOMParser().parseFromString(n, "application/xml");
|
|
10
|
+
return Array.from(t.getElementsByTagName("w:t")).map((r) => r.textContent).join(`
|
|
11
|
+
`);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
c as loadDOCX
|
|
15
|
+
};
|
package/dist/data/pdf.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function loadPDF(file:
|
|
1
|
+
export declare function loadPDF(file: Blob | Uint8Array, maxSize?: number): Promise<string[]>;
|