tablefacts 0.2.0 → 0.3.0
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/.env.example +1 -1
- package/CHANGELOG.md +22 -0
- package/README.md +30 -10
- package/package.json +13 -2
- package/src/lib/types.mjs +9 -2
- package/src/menu/README.md +28 -6
- package/src/menu/lib/run.mjs +3 -0
- package/src/menu/raw/config.mjs +6 -2
- package/src/menu/raw/extract.mjs +36 -15
- package/src/menu/raw/images.mjs +109 -0
- package/src/menu/raw/import.mjs +327 -51
- package/src/menu/raw/normalize.mjs +15 -4
- package/src/menu/raw/pdf.mjs +330 -0
- package/src/menu/raw/pdfjs.mjs +57 -0
- package/src/menu/raw/source.mjs +9 -2
- package/src/menu/raw/vision.mjs +124 -65
- package/types/lib/types.d.mts +41 -3
- package/types/menu/lib/run.d.mts +3 -0
- package/types/menu/raw/config.d.mts +1 -0
- package/types/menu/raw/images.d.mts +27 -0
- package/types/menu/raw/import.d.mts +33 -7
- package/types/menu/raw/normalize.d.mts +7 -1
- package/types/menu/raw/pdf.d.mts +98 -0
- package/types/menu/raw/pdfjs.d.mts +12 -0
- package/types/menu/raw/source.d.mts +2 -0
- package/types/menu/raw/vision.d.mts +11 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
/** @type {Record<string, import('../../lib/types.mjs').VisionProvider>} */
|
|
2
2
|
export declare const providers: Record<string, import('../../lib/types.mjs').VisionProvider>;
|
|
3
3
|
export declare const defaultProvider = "anthropic";
|
|
4
|
-
/** `file` is a downloaded picture; returns `{ sections, notes }` as the schema above describes. */
|
|
4
|
+
/** `file` is a downloaded picture; returns `{ sections, notes }` as the schema above describes. `boxes` also asks for each item's printed photo rectangle. */
|
|
5
5
|
export declare function readPage({ file, mediaType }: {
|
|
6
6
|
file: any;
|
|
7
7
|
mediaType: any;
|
|
8
|
+
}, { provider, model, apiKey, env, boxes }?: {
|
|
9
|
+
boxes?: boolean | undefined;
|
|
10
|
+
provider?: string | undefined;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
sections: any;
|
|
13
|
+
notes: any;
|
|
14
|
+
}>;
|
|
15
|
+
/** `text` is one page's extracted text; returns the same `{ sections, notes }` the picture path does. */
|
|
16
|
+
export declare function readText({ text }: {
|
|
17
|
+
text: any;
|
|
8
18
|
}, { provider, model, apiKey, env }?: {
|
|
9
19
|
provider?: string | undefined;
|
|
10
20
|
}): Promise<{
|