You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 23f20e9
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+15-1Lines changed: 15 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,7 +114,7 @@ const results = await ctx.query('How to configure a line chart', { library: 'g2'
114
114
115
115
In read-only mode, `Context` opens existing `${library}.zvec` files with `ZVecOpen`. It does not create missing stores, and `load()` will throw because it would mutate the zvec file.
116
116
117
-
### `ctx.load(library, pattern)`
117
+
### `ctx.load(library, pattern, options?)`
118
118
119
119
Load files into a specified library with automatic batch vectorization. Documents are embedded in batches and inserted into the vector store. A content-hash change detection mechanism re-embeds files whose content has changed since the last load.
120
120
@@ -124,12 +124,26 @@ Document IDs are derived from file paths relative to `basePath` for cross-machin
124
124
|-----------|------|-------------|
125
125
|`library`|`string`| Library name for organizing documents |
126
126
|`pattern`|`string \| string[]`| Glob pattern(s) matching files to load |
127
+
|`options.buildIndexContent`|`(document, context) => string \| Promise<string>`| Build derived text used for embedding and the `indexContent` FTS field while preserving the original returned content |
Copy file name to clipboardExpand all lines: package.json
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
{
2
2
"name": "@antv/context",
3
-
"version": "0.1.1",
3
+
"version": "0.1.2",
4
4
"description": "A local context retrieval library that enables semantic search over your documentation. It loads documents (Markdown, JSON, Text), vectorizes them using [Transformers.js](https://huggingface.co/transformers.js), and stores vectors locally in `.zvec` files for fast semantic querying. ",
5
5
"main": "dist/index.js",
6
6
"types": "dist/index.d.ts",
7
7
"scripts": {
8
-
"build": "tsc",
8
+
"build": "rm -rf dist && tsc",
9
9
"test": "HF_ENDPOINT=https://hf-mirror.com vitest run --coverage",
0 commit comments