llm-large-files 0.9.0 → 0.10.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/CHANGELOG.md +446 -0
- package/README.md +13 -7
- package/dist/access.d.ts +45 -3
- package/dist/access.d.ts.map +1 -1
- package/dist/access.js +106 -3
- package/dist/access.js.map +1 -1
- package/dist/aggregate.d.ts +6 -0
- package/dist/aggregate.d.ts.map +1 -1
- package/dist/aggregate.js +86 -13
- package/dist/aggregate.js.map +1 -1
- package/dist/analyze.d.ts +4 -0
- package/dist/analyze.d.ts.map +1 -1
- package/dist/analyze.js +2 -2
- package/dist/analyze.js.map +1 -1
- package/dist/answer-info.d.ts +26 -0
- package/dist/answer-info.d.ts.map +1 -0
- package/dist/answer-info.js +32 -0
- package/dist/answer-info.js.map +1 -0
- package/dist/anthropic/adapter.d.ts +5 -1
- package/dist/anthropic/adapter.d.ts.map +1 -1
- package/dist/anthropic/adapter.js +35 -10
- package/dist/anthropic/adapter.js.map +1 -1
- package/dist/ask.d.ts +115 -14
- package/dist/ask.d.ts.map +1 -1
- package/dist/ask.js +572 -103
- package/dist/ask.js.map +1 -1
- package/dist/citations.d.ts +36 -0
- package/dist/citations.d.ts.map +1 -0
- package/dist/citations.js +291 -0
- package/dist/citations.js.map +1 -0
- package/dist/error-info.d.ts +13 -0
- package/dist/error-info.d.ts.map +1 -1
- package/dist/error-info.js +37 -1
- package/dist/error-info.js.map +1 -1
- package/dist/errors.d.ts +3 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +3 -1
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +25 -7
- package/dist/events.d.ts.map +1 -1
- package/dist/events.js.map +1 -1
- package/dist/evidence.d.ts.map +1 -1
- package/dist/evidence.js +21 -2
- package/dist/evidence.js.map +1 -1
- package/dist/extract.d.ts.map +1 -1
- package/dist/extract.js +6 -1
- package/dist/extract.js.map +1 -1
- package/dist/gemini/adapter.d.ts +35 -4
- package/dist/gemini/adapter.d.ts.map +1 -1
- package/dist/gemini/adapter.js +68 -29
- package/dist/gemini/adapter.js.map +1 -1
- package/dist/gemini/chat.d.ts +28 -55
- package/dist/gemini/chat.d.ts.map +1 -1
- package/dist/gemini/chat.js +20 -27
- package/dist/gemini/chat.js.map +1 -1
- package/dist/gemini/endpoints.d.ts +59 -11
- package/dist/gemini/endpoints.d.ts.map +1 -1
- package/dist/gemini/endpoints.js +33 -7
- package/dist/gemini/endpoints.js.map +1 -1
- package/dist/gemini/errors.d.ts +39 -5
- package/dist/gemini/errors.d.ts.map +1 -1
- package/dist/gemini/errors.js +70 -9
- package/dist/gemini/errors.js.map +1 -1
- package/dist/gemini/generate.d.ts +53 -2
- package/dist/gemini/generate.d.ts.map +1 -1
- package/dist/gemini/generate.js +100 -50
- package/dist/gemini/generate.js.map +1 -1
- package/dist/gemini/index.d.ts +3 -3
- package/dist/gemini/index.d.ts.map +1 -1
- package/dist/http.d.ts +41 -3
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +40 -2
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/ingest.d.ts +9 -1
- package/dist/ingest.d.ts.map +1 -1
- package/dist/ingest.js +50 -25
- package/dist/ingest.js.map +1 -1
- package/dist/library.d.ts +129 -2
- package/dist/library.d.ts.map +1 -1
- package/dist/library.js +224 -149
- package/dist/library.js.map +1 -1
- package/dist/map-reduce.d.ts +176 -10
- package/dist/map-reduce.d.ts.map +1 -1
- package/dist/map-reduce.js +804 -58
- package/dist/map-reduce.js.map +1 -1
- package/dist/model.d.ts +36 -4
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +17 -1
- package/dist/model.js.map +1 -1
- package/dist/node/handlers.d.ts +29 -8
- package/dist/node/handlers.d.ts.map +1 -1
- package/dist/node/handlers.js +148 -126
- package/dist/node/handlers.js.map +1 -1
- package/dist/node/index.d.ts +1 -1
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/node/ingest-child.js +2 -2
- package/dist/node/ingest-child.js.map +1 -1
- package/dist/node/spool.d.ts +9 -5
- package/dist/node/spool.d.ts.map +1 -1
- package/dist/node/spool.js +28 -15
- package/dist/node/spool.js.map +1 -1
- package/dist/node/sse.d.ts +6 -5
- package/dist/node/sse.d.ts.map +1 -1
- package/dist/node/sse.js +8 -7
- package/dist/node/sse.js.map +1 -1
- package/dist/openai/adapter.d.ts +5 -1
- package/dist/openai/adapter.d.ts.map +1 -1
- package/dist/openai/adapter.js +53 -12
- package/dist/openai/adapter.js.map +1 -1
- package/dist/output-limit.d.ts +2 -1
- package/dist/output-limit.d.ts.map +1 -1
- package/dist/output-limit.js +5 -2
- package/dist/output-limit.js.map +1 -1
- package/dist/pdf-outline.d.ts +71 -0
- package/dist/pdf-outline.d.ts.map +1 -0
- package/dist/pdf-outline.js +414 -0
- package/dist/pdf-outline.js.map +1 -0
- package/dist/plan.d.ts +137 -7
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +248 -26
- package/dist/plan.js.map +1 -1
- package/dist/prepare.d.ts +50 -0
- package/dist/prepare.d.ts.map +1 -0
- package/dist/prepare.js +207 -0
- package/dist/prepare.js.map +1 -0
- package/dist/ranged.d.ts +2 -1
- package/dist/ranged.d.ts.map +1 -1
- package/dist/ranged.js +16 -3
- package/dist/ranged.js.map +1 -1
- package/dist/search.d.ts +7 -0
- package/dist/search.d.ts.map +1 -1
- package/dist/search.js +72 -10
- package/dist/search.js.map +1 -1
- package/dist/stores.d.ts +6 -0
- package/dist/stores.d.ts.map +1 -1
- package/dist/stores.js +82 -11
- package/dist/stores.js.map +1 -1
- package/dist/tools.d.ts +22 -2
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +323 -76
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +49 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/whole-cost.d.ts +37 -0
- package/dist/whole-cost.d.ts.map +1 -0
- package/dist/whole-cost.js +46 -0
- package/dist/whole-cost.js.map +1 -0
- package/docs/README.md +4 -0
- package/docs/guides/anthropic.md +5 -2
- package/docs/guides/conversations.md +1 -1
- package/docs/guides/costs-and-limits.md +132 -36
- package/docs/guides/deployment.md +106 -13
- package/docs/guides/errors-and-reliability.md +157 -45
- package/docs/guides/explorer-model.md +4 -1
- package/docs/guides/openai-compatible.md +47 -7
- package/docs/guides/own-adapter-and-loop.md +33 -6
- package/docs/guides/pdfs.md +96 -7
- package/docs/guides/storage.md +46 -3
- package/docs/guides/testing.md +71 -0
- package/docs/guides/vertex-and-gemini.md +159 -50
- package/docs/guides/web-app.md +10 -6
- package/docs/how-it-works.md +120 -22
- package/docs/measurements.md +172 -5
- package/docs/publishing.md +76 -4
- package/docs/reference/anthropic.md +12 -7
- package/docs/reference/ask.md +262 -35
- package/docs/reference/errors-and-retries.md +30 -2
- package/docs/reference/events.md +27 -10
- package/docs/reference/gemini.md +184 -68
- package/docs/reference/library.md +190 -23
- package/docs/reference/node.md +51 -17
- package/docs/reference/openai.md +21 -10
- package/docs/reference/tools.md +271 -26
- package/docs/security.md +101 -12
- package/docs/troubleshooting.md +14 -12
- package/docs/upgrading-0.10.md +472 -0
- package/package.json +5 -1
- package/src/access.ts +127 -4
- package/src/aggregate.ts +92 -14
- package/src/analyze.ts +2 -2
- package/src/answer-info.ts +45 -0
- package/src/anthropic/adapter.ts +40 -11
- package/src/ask.ts +646 -106
- package/src/citations.ts +294 -0
- package/src/error-info.ts +36 -1
- package/src/errors.ts +3 -1
- package/src/events.ts +29 -6
- package/src/evidence.ts +21 -2
- package/src/extract.ts +6 -1
- package/src/gemini/adapter.ts +99 -32
- package/src/gemini/chat.ts +53 -82
- package/src/gemini/endpoints.ts +89 -16
- package/src/gemini/errors.ts +74 -11
- package/src/gemini/generate.ts +147 -57
- package/src/gemini/index.ts +3 -3
- package/src/http.ts +65 -4
- package/src/index.ts +6 -4
- package/src/ingest.ts +58 -27
- package/src/library.ts +336 -142
- package/src/map-reduce.ts +855 -67
- package/src/model.ts +44 -4
- package/src/node/handlers.ts +159 -118
- package/src/node/index.ts +1 -0
- package/src/node/ingest-child.ts +2 -2
- package/src/node/spool.ts +28 -14
- package/src/node/sse.ts +8 -7
- package/src/openai/adapter.ts +56 -13
- package/src/output-limit.ts +5 -2
- package/src/pdf-outline.ts +400 -0
- package/src/plan.ts +287 -36
- package/src/prepare.ts +253 -0
- package/src/ranged.ts +16 -3
- package/src/search.ts +69 -13
- package/src/stores.ts +76 -11
- package/src/tools.ts +327 -75
- package/src/types.ts +45 -1
- package/src/whole-cost.ts +64 -0
package/dist/map-reduce.d.ts
CHANGED
|
@@ -1,6 +1,36 @@
|
|
|
1
1
|
import { type RetryOptions } from "./retry.js";
|
|
2
2
|
import { SearchableDocument, type DocumentSource } from "./search.js";
|
|
3
|
-
import type { Budget, GenerateText, ProgressListener, ToolCallHooks } from "./types.js";
|
|
3
|
+
import type { Budget, DocumentMeta, GenerateText, ProgressListener, ToolCallHooks } from "./types.js";
|
|
4
|
+
/** The output limit of a part read and of a merge of notes: the most tokens their notes may have. */
|
|
5
|
+
export declare const PART_OUTPUT_TOKENS = 4096;
|
|
6
|
+
/**
|
|
7
|
+
* The tokens of a request of a read besides the text it reads or the notes it merges: its system
|
|
8
|
+
* text, the task and the rules. By `estimateTokens`, the fixed words take 146 tokens in a part
|
|
9
|
+
* read, 81 in a merge and 94 in the answer of the read; the rest is room for a task of a few lines.
|
|
10
|
+
* A task of 160 characters takes 39 tokens in English and up to 74 in Hebrew: a part read of a file
|
|
11
|
+
* with a Hebrew name then frames 189 tokens with the English task and 218 to 224 with a Hebrew one.
|
|
12
|
+
* It only prices a read (`wholeReadCost`, `estimateMerges`): no text sent depends on it. The heading
|
|
13
|
+
* a part may start with is `PART_HEADING_TOKENS`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const REQUEST_FRAME_TOKENS = 240;
|
|
16
|
+
/**
|
|
17
|
+
* The same for a part read that lists items (`output: "items"`): its fixed words take 292 tokens
|
|
18
|
+
* with no label and 311 with two; with `MAX_ITEM_LABELS` labels of `MAX_LABEL_CHARACTERS`, 464 in
|
|
19
|
+
* English and 564 in Hebrew. The rest is room for a task of a few lines.
|
|
20
|
+
*/
|
|
21
|
+
export declare const ITEMS_FRAME_TOKENS = 650;
|
|
22
|
+
/** The tokens of the "### Lines a-b" heading of a part's notes, and of the blank line that joins notes. */
|
|
23
|
+
export declare const NOTE_HEADING_TOKENS = 25;
|
|
24
|
+
/** The most labels a read that lists items takes (`labels`), and the most characters of each. New in 0.10.0. */
|
|
25
|
+
export declare const MAX_ITEM_LABELS = 12;
|
|
26
|
+
export declare const MAX_LABEL_CHARACTERS = 40;
|
|
27
|
+
/**
|
|
28
|
+
* A store that did not answer within its time limit ("ETIMEDOUT"), or was not asked because too
|
|
29
|
+
* many store calls of the process are stuck ("STORE_STUCK"): the question ends, and the model is
|
|
30
|
+
* told nothing. A tool call that meets one throws it, and so does a part of a whole-file read,
|
|
31
|
+
* which would otherwise become a part that could not be read. New in 0.10.0.
|
|
32
|
+
*/
|
|
33
|
+
export declare function storeGaveUp(error: unknown): boolean;
|
|
4
34
|
export type WholeDocumentResult = {
|
|
5
35
|
answer: string;
|
|
6
36
|
parts: number;
|
|
@@ -18,6 +48,53 @@ export type WholeDocumentResult = {
|
|
|
18
48
|
* themselves: every part was paid for, and they hold what was found, with line citations.
|
|
19
49
|
*/
|
|
20
50
|
answerFailed?: string;
|
|
51
|
+
/**
|
|
52
|
+
* The read reached `maxRequests` before its last step: `answer` is the notes themselves, as when
|
|
53
|
+
* that step fails. New in 0.10.0 (N12).
|
|
54
|
+
*/
|
|
55
|
+
answerSkipped?: true;
|
|
56
|
+
/**
|
|
57
|
+
* The relevant parts whose notes are not in the answer: the read reached `maxRequests` before it
|
|
58
|
+
* could merge them, and wrote the answer from the notes that fit one request. New in 0.10.0 (N12).
|
|
59
|
+
*/
|
|
60
|
+
notesLeftOut?: number;
|
|
61
|
+
/** The model requests the read made: the parts, the merges and the answer. New in 0.10.0. */
|
|
62
|
+
requests: number;
|
|
63
|
+
};
|
|
64
|
+
/** An item a read with `output: "items"` found, checked against its line. New in 0.10.0 (M9). */
|
|
65
|
+
export type WholeItem = {
|
|
66
|
+
/** The line it is on. */
|
|
67
|
+
line: number;
|
|
68
|
+
/** One of the read's labels, when it was given some. */
|
|
69
|
+
label?: string;
|
|
70
|
+
/** The amount, date, name or figure it gives, as the model wrote it. */
|
|
71
|
+
value?: string;
|
|
72
|
+
/** The words of its line that state it, as the model copied them; found on that line. */
|
|
73
|
+
quote: string;
|
|
74
|
+
};
|
|
75
|
+
/** What a read with `output: "items"` found. New in 0.10.0 (M9). */
|
|
76
|
+
export type WholeItemsResult = {
|
|
77
|
+
/** The items, each once, in the order of the file: their count is `items.length`. */
|
|
78
|
+
items: WholeItem[];
|
|
79
|
+
/** The items by label, when they have labels. */
|
|
80
|
+
countsByLabel: Record<string, number>;
|
|
81
|
+
/**
|
|
82
|
+
* Items a part listed that are not counted: their quote is on no line of the part and not near the
|
|
83
|
+
* line they name (`quoteNearLine`), or on several lines of it but not on theirs.
|
|
84
|
+
*/
|
|
85
|
+
unverified: number;
|
|
86
|
+
/** The parts the file was read in, those that could not be read included; a halved part counts as its halves. */
|
|
87
|
+
parts: number;
|
|
88
|
+
failedParts: number;
|
|
89
|
+
/** Why the first part that could not be read failed. */
|
|
90
|
+
firstFailure?: string;
|
|
91
|
+
/** Parts whose list stopped at the output limit even in the smallest pieces read: items may be missing. */
|
|
92
|
+
truncatedParts: number;
|
|
93
|
+
/** The model requests the read made. */
|
|
94
|
+
requests: number;
|
|
95
|
+
/** The replies of the parts that were read, and their lines that were not a JSON object (skipped). */
|
|
96
|
+
replies: number;
|
|
97
|
+
skippedLines: number;
|
|
21
98
|
};
|
|
22
99
|
/**
|
|
23
100
|
* Why a model request of a whole-file read failed, as the model and `onStep` are told: by its
|
|
@@ -48,17 +125,17 @@ export declare function saysNothingRelevant(reply: string): boolean;
|
|
|
48
125
|
export declare function splitIntoParts(document: SearchableDocument, budget: Budget): Parts;
|
|
49
126
|
/** `splitIntoParts` for any document, worked out once per document object and budget. */
|
|
50
127
|
export declare function partsOf(source: DocumentSource, budget: Budget, signal?: AbortSignal): Promise<Parts>;
|
|
51
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* A whole-document read that was refused before any model call: the document has more parts than
|
|
130
|
+
* `maxMapChunks`, or (since 0.10.0) than the model requests the read may make (`maxRequests`).
|
|
131
|
+
*/
|
|
52
132
|
export declare class TooManyPartsError extends Error {
|
|
53
133
|
readonly parts: number;
|
|
54
134
|
readonly limit: number;
|
|
55
|
-
constructor(name: string, parts: number, limit: number);
|
|
135
|
+
constructor(name: string, parts: number, limit: number, of?: "parts" | "requests");
|
|
56
136
|
}
|
|
57
|
-
/**
|
|
58
|
-
|
|
59
|
-
* then the notes are combined ("reduce"), in several rounds if the notes are still too large.
|
|
60
|
-
*/
|
|
61
|
-
export declare function analyzeWholeDocument(options: {
|
|
137
|
+
/** What a whole-file read is given, in either output. */
|
|
138
|
+
type WholeReadOptions = {
|
|
62
139
|
document: DocumentSource;
|
|
63
140
|
task: string;
|
|
64
141
|
generate: GenerateText;
|
|
@@ -72,9 +149,98 @@ export declare function analyzeWholeDocument(options: {
|
|
|
72
149
|
retry?: RetryOptions;
|
|
73
150
|
/**
|
|
74
151
|
* The most model requests this read may make, when the question has a ceiling. A part read as two
|
|
75
|
-
* halves takes
|
|
152
|
+
* halves takes more than planned: it is halved only while this allows it. Since 0.10.0 the
|
|
153
|
+
* merges of notes stop when the next round would pass it (N12), and a read with more parts than
|
|
154
|
+
* this is refused before any request (`TooManyPartsError`): each part is one request.
|
|
76
155
|
*/
|
|
77
156
|
maxRequests?: number;
|
|
78
|
-
}
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* The tokens a part that starts under a heading takes for it (`partStart`), in either output: by
|
|
160
|
+
* `estimateTokens`, 28 for the words that say so and the heading's line number (of six digits),
|
|
161
|
+
* and a heading of `HEADING_CHARACTERS` takes 28 in English and 59 in Hebrew. A price counts it for
|
|
162
|
+
* every part after the first of a file whose parts may have one (`partsHaveHeadings`).
|
|
163
|
+
*/
|
|
164
|
+
export declare const PART_HEADING_TOKENS = 90;
|
|
165
|
+
/**
|
|
166
|
+
* Whether the parts of a whole-file read of a document may start with the heading they are under
|
|
167
|
+
* (`headingAbove`): a document with an outline, but not a log, JSON or CSV file, which have none.
|
|
168
|
+
*/
|
|
169
|
+
export declare function partsHaveHeadings(meta: Partial<Pick<DocumentMeta, "format" | "outline">>): boolean;
|
|
170
|
+
/**
|
|
171
|
+
* The merges of notes a whole-file read of `parts` parts makes, when the notes of each part, and
|
|
172
|
+
* each merge, take `noteTokens` (the output limit, at most): how many merge requests there are,
|
|
173
|
+
* their input tokens, and the tokens of the notes the answer of the read is written from. It
|
|
174
|
+
* follows the rounds of `analyzeWholeDocument`: while the notes do not fit `mapChunkTokens`
|
|
175
|
+
* together, they are merged in batches of up to `mapChunkTokens` (in pairs when no two fit one
|
|
176
|
+
* batch), for at most 8 rounds. A read prices its merges with it before it starts (N12); so does
|
|
177
|
+
* `wholeReadCost`.
|
|
178
|
+
*/
|
|
179
|
+
export declare function estimateMerges(parts: number, noteTokens: number, mapChunkTokens: number): {
|
|
180
|
+
requests: number;
|
|
181
|
+
inputTokens: number;
|
|
182
|
+
finalTokens: number;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Answers a task that needs the whole document: each part is read separately ("map"),
|
|
186
|
+
* then the notes are combined ("reduce"), in several rounds if the notes are still too large.
|
|
187
|
+
* Since 0.10.0 the prompts put the part first and the task last, and a read given `maxRequests`
|
|
188
|
+
* counts its requests: a round of merges that would pass it is not made (N12).
|
|
189
|
+
*/
|
|
190
|
+
export declare function analyzeWholeDocument(options: WholeReadOptions): Promise<WholeDocumentResult>;
|
|
191
|
+
/**
|
|
192
|
+
* The JSON objects of the reply of a part read that lists items, read leniently: one a line, or
|
|
193
|
+
* several on a line; a line may start with a list mark ("- ", "1. ") and end in a comma, code fences
|
|
194
|
+
* are passed over, a JSON array of them is read too, and so is an object that wraps their list
|
|
195
|
+
* (`{"items": […]}`); a backslash that starts no JSON escape is taken out. A line that is not a JSON
|
|
196
|
+
* object is skipped, and counted. A reply that says the part has nothing relevant has no item,
|
|
197
|
+
* unless it lists items after it: each is checked against its line as any other. New in 0.10.0.
|
|
198
|
+
*/
|
|
199
|
+
export declare function parseItemLines(reply: string): {
|
|
200
|
+
objects: Array<Record<string, unknown>>;
|
|
201
|
+
skipped: number;
|
|
202
|
+
};
|
|
203
|
+
/**
|
|
204
|
+
* A text as quotes are compared with their lines: composed (NFC), without format characters,
|
|
205
|
+
* folded as exact search folds it (case, quotes, dashes, spaces), without Hebrew points, final
|
|
206
|
+
* letters as plain ones, and runs of blanks as one space. "חוזה" then matches "חוֹזֶה", "כסף" a
|
|
207
|
+
* "כספ" cut before a final letter, and "5,000 ש"ח" a line with an RLM around the number.
|
|
208
|
+
*/
|
|
209
|
+
export declare function quoteForm(text: string): string;
|
|
210
|
+
/**
|
|
211
|
+
* Whether the quote of an item is on its line, in `quoteForm`: a line number copied with it ("12| ")
|
|
212
|
+
* and the quote marks and punctuation around it are left out, and a quote cut with "…" or "..."
|
|
213
|
+
* must have each of its pieces on the line, in order.
|
|
214
|
+
*/
|
|
215
|
+
export declare function quoteOnLine(quote: string, line: string): boolean;
|
|
216
|
+
/** The work of the near check of quotes: the cells of `nearestRun` it filled. For tests. */
|
|
217
|
+
export type NearWork = {
|
|
218
|
+
cells: number;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* Whether a quote is on its line with a few letters copied wrong, as Gemini Flash-Lite copies
|
|
222
|
+
* Hebrew quotes (השרים for השרתים, הניקוי for הניקיון, מקוזז for לקזז, ש"ץ for ש"ח): in
|
|
223
|
+
* `quoteForm`, it has at least `NEAR_QUOTE_CHARACTERS` characters, every number of it is a number of
|
|
224
|
+
* the line, and its pieces (a quote cut with "…" has several) are each a run of the line, or near
|
|
225
|
+
* one, with no more letters to change, add or take out in all than `NEAR_QUOTE_SHARE` of its
|
|
226
|
+
* characters. A quote with an amount other than the line's is not, nor one of the next clause of a
|
|
227
|
+
* contract written to the same pattern with another amount. On a line longer than ingest stores, a
|
|
228
|
+
* piece is looked for only around a few of its words (`nearestRunWithin`). `work` counts the cells
|
|
229
|
+
* measured, for tests. New in 0.10.0.
|
|
230
|
+
*/
|
|
231
|
+
export declare function quoteNearLine(quote: string, line: string, work?: NearWork): boolean;
|
|
232
|
+
/**
|
|
233
|
+
* Lists the items a task asks for across the whole document (`output: "items"`, new in 0.10.0,
|
|
234
|
+
* M9): each part replies with JSON lines, one an item, with its line, label, value and a quote of
|
|
235
|
+
* its line. Code reads them, checks each against its line, drops the same item listed twice (by
|
|
236
|
+
* line, label and value, or, for an item moved to another line than it named, by line and label),
|
|
237
|
+
* and counts them: no merge, no final request, and no count made by a
|
|
238
|
+
* model. A part whose list stops at the output limit is read again as two halves, two levels at
|
|
239
|
+
* most, while `maxRequests` allows it (without it, while the halves take no more than
|
|
240
|
+
* `maxMapChunks` requests). A part the model refuses as too large is halved the same way.
|
|
241
|
+
*/
|
|
242
|
+
export declare function listWholeDocumentItems(options: WholeReadOptions & {
|
|
243
|
+
labels?: readonly string[];
|
|
244
|
+
}): Promise<WholeItemsResult>;
|
|
79
245
|
export {};
|
|
80
246
|
//# sourceMappingURL=map-reduce.d.ts.map
|
package/dist/map-reduce.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"map-reduce.d.ts","sourceRoot":"","sources":["../src/map-reduce.ts"],"names":[],"mappings":"AAIA,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAEpE,OAAO,EAA2B,kBAAkB,EAAE,KAAK,cAAc,EAAkB,MAAM,aAAa,CAAC;AAC/G,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAiB,g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