treedex 0.1.2 → 0.1.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/README.md +22 -4
- package/package.json +1 -1
- package/dist/index.cjs +0 -1253
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -426
- package/dist/index.d.ts +0 -426
- package/dist/index.js +0 -1177
- package/dist/index.js.map +0 -1
package/dist/index.d.ts
DELETED
|
@@ -1,426 +0,0 @@
|
|
|
1
|
-
/** Shared type definitions for TreeDex. */
|
|
2
|
-
interface Page {
|
|
3
|
-
page_num: number;
|
|
4
|
-
text: string;
|
|
5
|
-
token_count: number;
|
|
6
|
-
}
|
|
7
|
-
interface TreeNode {
|
|
8
|
-
structure: string;
|
|
9
|
-
title: string;
|
|
10
|
-
physical_index: number;
|
|
11
|
-
nodes: TreeNode[];
|
|
12
|
-
start_index?: number;
|
|
13
|
-
end_index?: number;
|
|
14
|
-
node_id?: string;
|
|
15
|
-
text?: string;
|
|
16
|
-
[key: string]: unknown;
|
|
17
|
-
}
|
|
18
|
-
interface IndexData {
|
|
19
|
-
version: string;
|
|
20
|
-
framework: string;
|
|
21
|
-
tree: TreeNode[];
|
|
22
|
-
pages: Page[];
|
|
23
|
-
}
|
|
24
|
-
interface Stats {
|
|
25
|
-
total_pages: number;
|
|
26
|
-
total_tokens: number;
|
|
27
|
-
total_nodes: number;
|
|
28
|
-
leaf_nodes: number;
|
|
29
|
-
root_sections: number;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* LLM backends for TreeDex.
|
|
34
|
-
*
|
|
35
|
-
* Hierarchy:
|
|
36
|
-
* BaseLLM — abstract base, subclass for custom LLMs
|
|
37
|
-
* ├── GeminiLLM — Google Gemini (lazy SDK)
|
|
38
|
-
* ├── OpenAILLM — OpenAI (lazy SDK)
|
|
39
|
-
* ├── ClaudeLLM — Anthropic Claude (lazy SDK)
|
|
40
|
-
* ├── MistralLLM — Mistral AI (lazy SDK)
|
|
41
|
-
* ├── CohereLLM — Cohere (lazy SDK)
|
|
42
|
-
* ├── OpenAICompatibleLLM — Any OpenAI-compatible endpoint (fetch)
|
|
43
|
-
* │ ├── GroqLLM — Groq (pre-configured URL)
|
|
44
|
-
* │ ├── TogetherLLM — Together AI (pre-configured URL)
|
|
45
|
-
* │ ├── FireworksLLM — Fireworks AI (pre-configured URL)
|
|
46
|
-
* │ ├── OpenRouterLLM — OpenRouter (pre-configured URL)
|
|
47
|
-
* │ ├── DeepSeekLLM — DeepSeek (pre-configured URL)
|
|
48
|
-
* │ ├── CerebrasLLM — Cerebras (pre-configured URL)
|
|
49
|
-
* │ └── SambanovaLLM — SambaNova (pre-configured URL)
|
|
50
|
-
* ├── HuggingFaceLLM — HuggingFace Inference API (fetch)
|
|
51
|
-
* ├── OllamaLLM — Ollama native /api/generate (fetch)
|
|
52
|
-
* ├── LiteLLM — litellm wrapper (100+ providers)
|
|
53
|
-
* └── FunctionLLM — Wrap any callable(str) -> str
|
|
54
|
-
*
|
|
55
|
-
* Named providers lazy-import their SDKs.
|
|
56
|
-
* OpenAICompatibleLLM, HuggingFaceLLM, OllamaLLM use only fetch.
|
|
57
|
-
*/
|
|
58
|
-
/** Base class for all LLM backends. Subclass and implement generate(). */
|
|
59
|
-
declare abstract class BaseLLM {
|
|
60
|
-
abstract generate(prompt: string): Promise<string>;
|
|
61
|
-
toString(): string;
|
|
62
|
-
}
|
|
63
|
-
/** Google Gemini via @google/generative-ai SDK. */
|
|
64
|
-
declare class GeminiLLM extends BaseLLM {
|
|
65
|
-
readonly apiKey: string;
|
|
66
|
-
readonly modelName: string;
|
|
67
|
-
private _client;
|
|
68
|
-
constructor(apiKey: string, model?: string);
|
|
69
|
-
private getClient;
|
|
70
|
-
generate(prompt: string): Promise<string>;
|
|
71
|
-
toString(): string;
|
|
72
|
-
}
|
|
73
|
-
/** OpenAI via openai SDK. */
|
|
74
|
-
declare class OpenAILLM extends BaseLLM {
|
|
75
|
-
readonly apiKey: string;
|
|
76
|
-
readonly modelName: string;
|
|
77
|
-
private _client;
|
|
78
|
-
constructor(apiKey: string, model?: string);
|
|
79
|
-
private getClient;
|
|
80
|
-
generate(prompt: string): Promise<string>;
|
|
81
|
-
toString(): string;
|
|
82
|
-
}
|
|
83
|
-
/** Anthropic Claude via @anthropic-ai/sdk. */
|
|
84
|
-
declare class ClaudeLLM extends BaseLLM {
|
|
85
|
-
readonly apiKey: string;
|
|
86
|
-
readonly modelName: string;
|
|
87
|
-
private _client;
|
|
88
|
-
constructor(apiKey: string, model?: string);
|
|
89
|
-
private getClient;
|
|
90
|
-
generate(prompt: string): Promise<string>;
|
|
91
|
-
toString(): string;
|
|
92
|
-
}
|
|
93
|
-
/** Mistral AI via @mistralai/mistralai SDK. */
|
|
94
|
-
declare class MistralLLM extends BaseLLM {
|
|
95
|
-
readonly apiKey: string;
|
|
96
|
-
readonly modelName: string;
|
|
97
|
-
private _client;
|
|
98
|
-
constructor(apiKey: string, model?: string);
|
|
99
|
-
private getClient;
|
|
100
|
-
generate(prompt: string): Promise<string>;
|
|
101
|
-
toString(): string;
|
|
102
|
-
}
|
|
103
|
-
/** Cohere via cohere-ai SDK. */
|
|
104
|
-
declare class CohereLLM extends BaseLLM {
|
|
105
|
-
readonly apiKey: string;
|
|
106
|
-
readonly modelName: string;
|
|
107
|
-
private _client;
|
|
108
|
-
constructor(apiKey: string, model?: string);
|
|
109
|
-
private getClient;
|
|
110
|
-
generate(prompt: string): Promise<string>;
|
|
111
|
-
toString(): string;
|
|
112
|
-
}
|
|
113
|
-
/**
|
|
114
|
-
* Universal backend for any OpenAI-compatible API endpoint.
|
|
115
|
-
*
|
|
116
|
-
* Works with: Groq, Together AI, Fireworks, vLLM, LM Studio,
|
|
117
|
-
* OpenRouter, DeepSeek, Cerebras, SambaNova, Ollama (OpenAI mode),
|
|
118
|
-
* and any other compatible service.
|
|
119
|
-
*/
|
|
120
|
-
declare class OpenAICompatibleLLM extends BaseLLM {
|
|
121
|
-
baseUrl: string;
|
|
122
|
-
readonly model: string;
|
|
123
|
-
readonly apiKey: string | null;
|
|
124
|
-
readonly maxTokens: number;
|
|
125
|
-
readonly temperature: number;
|
|
126
|
-
readonly extraHeaders: Record<string, string>;
|
|
127
|
-
readonly timeout: number;
|
|
128
|
-
constructor(options: {
|
|
129
|
-
baseUrl: string;
|
|
130
|
-
model: string;
|
|
131
|
-
apiKey?: string | null;
|
|
132
|
-
maxTokens?: number;
|
|
133
|
-
temperature?: number;
|
|
134
|
-
extraHeaders?: Record<string, string>;
|
|
135
|
-
timeout?: number;
|
|
136
|
-
});
|
|
137
|
-
private buildHeaders;
|
|
138
|
-
generate(prompt: string): Promise<string>;
|
|
139
|
-
toString(): string;
|
|
140
|
-
}
|
|
141
|
-
/** Groq — fast LLM inference via groq SDK. */
|
|
142
|
-
declare class GroqLLM extends BaseLLM {
|
|
143
|
-
readonly apiKey: string;
|
|
144
|
-
readonly model: string;
|
|
145
|
-
private _client;
|
|
146
|
-
constructor(apiKey: string, model?: string);
|
|
147
|
-
private getClient;
|
|
148
|
-
generate(prompt: string): Promise<string>;
|
|
149
|
-
toString(): string;
|
|
150
|
-
}
|
|
151
|
-
/** Together AI — open-source models. Zero SDK dependencies. */
|
|
152
|
-
declare class TogetherLLM extends OpenAICompatibleLLM {
|
|
153
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
154
|
-
maxTokens?: number;
|
|
155
|
-
temperature?: number;
|
|
156
|
-
});
|
|
157
|
-
toString(): string;
|
|
158
|
-
}
|
|
159
|
-
/** Fireworks AI — fast open-source inference. Zero SDK dependencies. */
|
|
160
|
-
declare class FireworksLLM extends OpenAICompatibleLLM {
|
|
161
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
162
|
-
maxTokens?: number;
|
|
163
|
-
temperature?: number;
|
|
164
|
-
});
|
|
165
|
-
toString(): string;
|
|
166
|
-
}
|
|
167
|
-
/** OpenRouter — access any model via one API. Zero SDK dependencies. */
|
|
168
|
-
declare class OpenRouterLLM extends OpenAICompatibleLLM {
|
|
169
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
170
|
-
maxTokens?: number;
|
|
171
|
-
temperature?: number;
|
|
172
|
-
});
|
|
173
|
-
toString(): string;
|
|
174
|
-
}
|
|
175
|
-
/** DeepSeek — powerful reasoning models. Zero SDK dependencies. */
|
|
176
|
-
declare class DeepSeekLLM extends OpenAICompatibleLLM {
|
|
177
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
178
|
-
maxTokens?: number;
|
|
179
|
-
temperature?: number;
|
|
180
|
-
});
|
|
181
|
-
toString(): string;
|
|
182
|
-
}
|
|
183
|
-
/** Cerebras — ultra-fast inference. Zero SDK dependencies. */
|
|
184
|
-
declare class CerebrasLLM extends OpenAICompatibleLLM {
|
|
185
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
186
|
-
maxTokens?: number;
|
|
187
|
-
temperature?: number;
|
|
188
|
-
});
|
|
189
|
-
toString(): string;
|
|
190
|
-
}
|
|
191
|
-
/** SambaNova — fast AI inference. Zero SDK dependencies. */
|
|
192
|
-
declare class SambanovaLLM extends OpenAICompatibleLLM {
|
|
193
|
-
constructor(apiKey: string, model?: string, options?: {
|
|
194
|
-
maxTokens?: number;
|
|
195
|
-
temperature?: number;
|
|
196
|
-
});
|
|
197
|
-
toString(): string;
|
|
198
|
-
}
|
|
199
|
-
/** HuggingFace Inference API. Zero SDK dependencies. */
|
|
200
|
-
declare class HuggingFaceLLM extends BaseLLM {
|
|
201
|
-
readonly apiKey: string;
|
|
202
|
-
readonly model: string;
|
|
203
|
-
readonly maxTokens: number;
|
|
204
|
-
constructor(apiKey: string, model?: string, maxTokens?: number);
|
|
205
|
-
generate(prompt: string): Promise<string>;
|
|
206
|
-
toString(): string;
|
|
207
|
-
}
|
|
208
|
-
/** Ollama native backend using /api/generate endpoint. */
|
|
209
|
-
declare class OllamaLLM extends BaseLLM {
|
|
210
|
-
readonly model: string;
|
|
211
|
-
baseUrl: string;
|
|
212
|
-
constructor(model?: string, baseUrl?: string);
|
|
213
|
-
generate(prompt: string): Promise<string>;
|
|
214
|
-
toString(): string;
|
|
215
|
-
}
|
|
216
|
-
/** Wrap any async or sync function as an LLM backend. */
|
|
217
|
-
declare class FunctionLLM extends BaseLLM {
|
|
218
|
-
private readonly _fn;
|
|
219
|
-
constructor(fn: (prompt: string) => string | Promise<string>);
|
|
220
|
-
generate(prompt: string): Promise<string>;
|
|
221
|
-
toString(): string;
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
/** TreeDex: Tree-based document RAG framework. */
|
|
225
|
-
|
|
226
|
-
/** Result of a TreeDex query. */
|
|
227
|
-
declare class QueryResult {
|
|
228
|
-
readonly context: string;
|
|
229
|
-
readonly nodeIds: string[];
|
|
230
|
-
readonly pageRanges: [number, number][];
|
|
231
|
-
readonly reasoning: string;
|
|
232
|
-
readonly answer: string;
|
|
233
|
-
constructor(context: string, nodeIds: string[], pageRanges: [number, number][], reasoning: string, answer?: string);
|
|
234
|
-
/** Human-readable page ranges like 'pages 5-8, 12-15'. */
|
|
235
|
-
get pagesStr(): string;
|
|
236
|
-
toString(): string;
|
|
237
|
-
}
|
|
238
|
-
/** Tree-based document index for RAG retrieval. */
|
|
239
|
-
declare class TreeDex {
|
|
240
|
-
readonly tree: TreeNode[];
|
|
241
|
-
readonly pages: Page[];
|
|
242
|
-
llm: BaseLLM | null;
|
|
243
|
-
private _nodeMap;
|
|
244
|
-
constructor(tree: TreeNode[], pages: Page[], llm?: BaseLLM | null);
|
|
245
|
-
/**
|
|
246
|
-
* Build a TreeDex index from a file.
|
|
247
|
-
*
|
|
248
|
-
* @param path - Path to document (PDF, TXT, HTML, DOCX)
|
|
249
|
-
* @param llm - LLM backend with .generate(prompt) method
|
|
250
|
-
* @param options - Optional configuration
|
|
251
|
-
*/
|
|
252
|
-
static fromFile(path: string, llm: BaseLLM, options?: {
|
|
253
|
-
loader?: {
|
|
254
|
-
load(path: string): Promise<Page[]>;
|
|
255
|
-
};
|
|
256
|
-
maxTokens?: number;
|
|
257
|
-
overlap?: number;
|
|
258
|
-
verbose?: boolean;
|
|
259
|
-
}): Promise<TreeDex>;
|
|
260
|
-
/** Build a TreeDex index from pre-extracted pages. */
|
|
261
|
-
static fromPages(pages: Page[], llm: BaseLLM, options?: {
|
|
262
|
-
maxTokens?: number;
|
|
263
|
-
overlap?: number;
|
|
264
|
-
verbose?: boolean;
|
|
265
|
-
}): Promise<TreeDex>;
|
|
266
|
-
/** Create a TreeDex from an existing tree and pages. */
|
|
267
|
-
static fromTree(tree: TreeNode[], pages: Page[], llm?: BaseLLM | null): TreeDex;
|
|
268
|
-
/**
|
|
269
|
-
* Query the index and return relevant context.
|
|
270
|
-
*
|
|
271
|
-
* @param question - The user's question
|
|
272
|
-
* @param options - Optional LLM override or agentic mode
|
|
273
|
-
*/
|
|
274
|
-
query(question: string, options?: BaseLLM | {
|
|
275
|
-
llm?: BaseLLM;
|
|
276
|
-
agentic?: boolean;
|
|
277
|
-
}): Promise<QueryResult>;
|
|
278
|
-
/** Save the index to a JSON file. */
|
|
279
|
-
save(path: string): Promise<string>;
|
|
280
|
-
/** Load a TreeDex index from a JSON file. */
|
|
281
|
-
static load(path: string, llm?: BaseLLM | null): Promise<TreeDex>;
|
|
282
|
-
/** Pretty-print the tree structure. */
|
|
283
|
-
showTree(): void;
|
|
284
|
-
/** Return index statistics. */
|
|
285
|
-
stats(): Stats;
|
|
286
|
-
/** Find sections that exceed size thresholds. */
|
|
287
|
-
findLargeSections(options?: {
|
|
288
|
-
maxPages?: number;
|
|
289
|
-
maxTokens?: number;
|
|
290
|
-
}): TreeNode[];
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Document loaders for multiple file formats.
|
|
295
|
-
*
|
|
296
|
-
* Each loader returns a list of objects: [{page_num, text, token_count}]
|
|
297
|
-
* matching the format used by pdf-parser extractPages().
|
|
298
|
-
*/
|
|
299
|
-
|
|
300
|
-
/** Split plain text into synthetic pages by character count. */
|
|
301
|
-
declare function textToPages(text: string, charsPerPage?: number): Page[];
|
|
302
|
-
/** Load PDF files using pdfjs-dist. */
|
|
303
|
-
declare class PDFLoader {
|
|
304
|
-
load(path: string): Promise<Page[]>;
|
|
305
|
-
}
|
|
306
|
-
/** Load plain text or markdown files. */
|
|
307
|
-
declare class TextLoader {
|
|
308
|
-
readonly charsPerPage: number;
|
|
309
|
-
constructor(charsPerPage?: number);
|
|
310
|
-
load(path: string): Promise<Page[]>;
|
|
311
|
-
}
|
|
312
|
-
/** Load HTML files, stripping tags to plain text. */
|
|
313
|
-
declare class HTMLLoader {
|
|
314
|
-
readonly charsPerPage: number;
|
|
315
|
-
constructor(charsPerPage?: number);
|
|
316
|
-
load(path: string): Promise<Page[]>;
|
|
317
|
-
private stripHtml;
|
|
318
|
-
}
|
|
319
|
-
/** Load DOCX files using mammoth. */
|
|
320
|
-
declare class DOCXLoader {
|
|
321
|
-
readonly charsPerPage: number;
|
|
322
|
-
constructor(charsPerPage?: number);
|
|
323
|
-
load(path: string): Promise<Page[]>;
|
|
324
|
-
}
|
|
325
|
-
/** Auto-detect file format and load pages. */
|
|
326
|
-
declare function autoLoader(filePath: string): Promise<Page[]>;
|
|
327
|
-
|
|
328
|
-
/** Tree construction utilities. */
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Convert a flat list with `structure` fields into a hierarchical tree.
|
|
332
|
-
*
|
|
333
|
-
* Each item must have a `structure` field like "1", "1.1", "1.2.3".
|
|
334
|
-
* Parent of "1.2.3" is "1.2", parent of "1.2" is "1", "1" is root.
|
|
335
|
-
* Output nodes get a `nodes: []` field for children.
|
|
336
|
-
*/
|
|
337
|
-
declare function listToTree(flatList: Array<{
|
|
338
|
-
structure: string;
|
|
339
|
-
title: string;
|
|
340
|
-
physical_index: number;
|
|
341
|
-
[key: string]: unknown;
|
|
342
|
-
}>): TreeNode[];
|
|
343
|
-
/**
|
|
344
|
-
* Set start_index and end_index on each node.
|
|
345
|
-
*
|
|
346
|
-
* - start_index = node's physical_index
|
|
347
|
-
* - end_index = next sibling's physical_index - 1, or parent's end,
|
|
348
|
-
* or total_pages - 1 for the last root node
|
|
349
|
-
*/
|
|
350
|
-
declare function assignPageRanges(tree: TreeNode[], totalPages: number): TreeNode[];
|
|
351
|
-
/** DFS traversal, assigns sequential IDs: '0001', '0002', etc. */
|
|
352
|
-
declare function assignNodeIds(tree: TreeNode[]): TreeNode[];
|
|
353
|
-
/** Return nodes that exceed page or token thresholds. */
|
|
354
|
-
declare function findLargeNodes(tree: TreeNode[], options?: {
|
|
355
|
-
maxPages?: number;
|
|
356
|
-
maxTokens?: number;
|
|
357
|
-
pages?: Page[] | null;
|
|
358
|
-
}): TreeNode[];
|
|
359
|
-
/** Add `text` field to each node by concatenating page text for its range. */
|
|
360
|
-
declare function embedTextInTree(tree: TreeNode[], pages: Page[]): TreeNode[];
|
|
361
|
-
|
|
362
|
-
/** Tree manipulation and utility functions. */
|
|
363
|
-
|
|
364
|
-
/** Flatten tree into {node_id: node_dict} for O(1) lookups. */
|
|
365
|
-
declare function createNodeMapping(tree: TreeNode[]): Record<string, TreeNode>;
|
|
366
|
-
/** Return a deep copy of the tree with all `text` fields removed. */
|
|
367
|
-
declare function stripTextFromTree(tree: TreeNode[]): TreeNode[];
|
|
368
|
-
/**
|
|
369
|
-
* Gather and concatenate text from a list of node IDs.
|
|
370
|
-
*
|
|
371
|
-
* Format:
|
|
372
|
-
* [Section: Title]
|
|
373
|
-
* text
|
|
374
|
-
*
|
|
375
|
-
* [Section: Title2]
|
|
376
|
-
* text2
|
|
377
|
-
*/
|
|
378
|
-
declare function collectNodeTexts(nodeIds: string[], nodeMap: Record<string, TreeNode>): string;
|
|
379
|
-
/** Recursively count total nodes in the tree. */
|
|
380
|
-
declare function countNodes(tree: TreeNode[]): number;
|
|
381
|
-
/** Return all nodes with empty `nodes` list. */
|
|
382
|
-
declare function getLeafNodes(tree: TreeNode[]): TreeNode[];
|
|
383
|
-
/** Flatten hierarchy back to a list in DFS order. */
|
|
384
|
-
declare function treeToFlatList(tree: TreeNode[]): Array<Omit<TreeNode, "nodes">>;
|
|
385
|
-
/**
|
|
386
|
-
* Robust JSON extraction from LLM responses.
|
|
387
|
-
*
|
|
388
|
-
* Handles raw JSON, ```json code blocks, and minor formatting issues
|
|
389
|
-
* like trailing commas.
|
|
390
|
-
*/
|
|
391
|
-
declare function extractJson(text: string): unknown;
|
|
392
|
-
/** Pretty-print tree structure for debugging. */
|
|
393
|
-
declare function printTree(tree: TreeNode[], indent?: number): void;
|
|
394
|
-
|
|
395
|
-
/** PDF extraction and page grouping. */
|
|
396
|
-
|
|
397
|
-
/** Count tokens using cl100k_base-compatible encoding. */
|
|
398
|
-
declare function countTokens(text: string): number;
|
|
399
|
-
/**
|
|
400
|
-
* Extract text from each page of a PDF.
|
|
401
|
-
*
|
|
402
|
-
* Returns a list of objects with page_num, text, and token_count.
|
|
403
|
-
*/
|
|
404
|
-
declare function extractPages(pdfPath: string): Promise<Page[]>;
|
|
405
|
-
/**
|
|
406
|
-
* Combine pages[start:end+1] into a string with physical index tags.
|
|
407
|
-
*
|
|
408
|
-
* Each page is wrapped like:
|
|
409
|
-
* <physical_index_0>page text</physical_index_0>
|
|
410
|
-
* where the number is the page's page_num.
|
|
411
|
-
*/
|
|
412
|
-
declare function pagesToTaggedText(pages: Page[], start: number, end: number): string;
|
|
413
|
-
/**
|
|
414
|
-
* Split pages into token-budget groups, each returned as tagged text.
|
|
415
|
-
*
|
|
416
|
-
* Groups overlap by `overlap` pages for continuity.
|
|
417
|
-
*/
|
|
418
|
-
declare function groupPages(pages: Page[], maxTokens?: number, overlap?: number): string[];
|
|
419
|
-
|
|
420
|
-
/** Prompt templates for structure extraction and retrieval. */
|
|
421
|
-
declare function structureExtractionPrompt(text: string): string;
|
|
422
|
-
declare function structureContinuePrompt(previousStructure: string, text: string): string;
|
|
423
|
-
declare function answerPrompt(context: string, query: string): string;
|
|
424
|
-
declare function retrievalPrompt(treeStructure: string, query: string): string;
|
|
425
|
-
|
|
426
|
-
export { BaseLLM, CerebrasLLM, ClaudeLLM, CohereLLM, DOCXLoader, DeepSeekLLM, FireworksLLM, FunctionLLM, GeminiLLM, GroqLLM, HTMLLoader, HuggingFaceLLM, type IndexData, MistralLLM, OllamaLLM, OpenAICompatibleLLM, OpenAILLM, OpenRouterLLM, PDFLoader, type Page, QueryResult, SambanovaLLM, type Stats, TextLoader, TogetherLLM, TreeDex, type TreeNode, answerPrompt, assignNodeIds, assignPageRanges, autoLoader, collectNodeTexts, countNodes, countTokens, createNodeMapping, embedTextInTree, extractJson, extractPages, findLargeNodes, getLeafNodes, groupPages, listToTree, pagesToTaggedText, printTree, retrievalPrompt, stripTextFromTree, structureContinuePrompt, structureExtractionPrompt, textToPages, treeToFlatList };
|