@lancedb/lancedb 0.4.13 → 0.4.15
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 +35 -3
- package/package.json +7 -7
- package/typedoc.json +10 -0
package/README.md
CHANGED
|
@@ -1,12 +1,44 @@
|
|
|
1
|
-
#
|
|
1
|
+
# LanceDB JavaScript SDK
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A JavaScript library for [LanceDB](https://github.com/lancedb/lancedb).
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @lancedb/lancedb
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will download the appropriate native library for your platform. We currently
|
|
12
|
+
support:
|
|
13
|
+
|
|
14
|
+
- Linux (x86_64 and aarch64)
|
|
15
|
+
- MacOS (Intel and ARM/M1/M2)
|
|
16
|
+
- Windows (x86_64 only)
|
|
17
|
+
|
|
18
|
+
We do not yet support musl-based Linux (such as Alpine Linux) or aarch64 Windows.
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
### Basic Example
|
|
23
|
+
|
|
24
|
+
```javascript
|
|
25
|
+
import * as lancedb from "@lancedb/lancedb";
|
|
26
|
+
const db = await lancedb.connect("data/sample-lancedb");
|
|
27
|
+
const table = await db.createTable("my_table", [
|
|
28
|
+
{ id: 1, vector: [0.1, 1.0], item: "foo", price: 10.0 },
|
|
29
|
+
{ id: 2, vector: [3.9, 0.5], item: "bar", price: 20.0 },
|
|
30
|
+
]);
|
|
31
|
+
const results = await table.vectorSearch([0.1, 0.3]).limit(20).toArray();
|
|
32
|
+
console.log(results);
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The [quickstart](../basic.md) contains a more complete example.
|
|
4
36
|
|
|
5
37
|
## Development
|
|
6
38
|
|
|
7
39
|
```sh
|
|
8
40
|
npm run build
|
|
9
|
-
npm
|
|
41
|
+
npm run test
|
|
10
42
|
```
|
|
11
43
|
|
|
12
44
|
### Running lint / format
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lancedb/lancedb",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.15",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"types": "./dist/index.d.ts",
|
|
6
6
|
"napi": {
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"build": "npm run build:debug && tsc -b && shx cp lancedb/native.d.ts dist/native.d.ts",
|
|
60
60
|
"build-release": "npm run build:release && tsc -b && shx cp lancedb/native.d.ts dist/native.d.ts",
|
|
61
61
|
"chkformat": "prettier . --check",
|
|
62
|
-
"docs": "typedoc --plugin typedoc-plugin-markdown lancedb/index.ts",
|
|
62
|
+
"docs": "typedoc --plugin typedoc-plugin-markdown --out ../docs/src/js lancedb/index.ts",
|
|
63
63
|
"lint": "eslint lancedb && eslint __test__",
|
|
64
64
|
"prepublishOnly": "napi prepublish -t npm",
|
|
65
65
|
"test": "npm run build && jest --verbose",
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"version": "napi version"
|
|
68
68
|
},
|
|
69
69
|
"optionalDependencies": {
|
|
70
|
-
"@lancedb/lancedb-darwin-arm64": "0.4.
|
|
71
|
-
"@lancedb/lancedb-linux-arm64-gnu": "0.4.
|
|
72
|
-
"@lancedb/lancedb-darwin-x64": "0.4.
|
|
73
|
-
"@lancedb/lancedb-linux-x64-gnu": "0.4.
|
|
74
|
-
"@lancedb/lancedb-win32-x64-msvc": "0.4.
|
|
70
|
+
"@lancedb/lancedb-darwin-arm64": "0.4.15",
|
|
71
|
+
"@lancedb/lancedb-linux-arm64-gnu": "0.4.15",
|
|
72
|
+
"@lancedb/lancedb-darwin-x64": "0.4.15",
|
|
73
|
+
"@lancedb/lancedb-linux-x64-gnu": "0.4.15",
|
|
74
|
+
"@lancedb/lancedb-win32-x64-msvc": "0.4.15"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"openai": "^4.29.2",
|
package/typedoc.json
ADDED