@eltjs/embedding 0.0.0-stage → 0.1.1
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/LICENSE +202 -0
- package/README.md +75 -2
- package/dist/embedding.d.ts +28 -0
- package/dist/embedding.js +77 -0
- package/package.json +50 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 ezzabuzaid
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,76 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Embedding
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`Embedding` is a rule of a computed dataset. It gives each loaded row a vector of its text, made by an AI SDK embedding model, so that a vector search can find rows by meaning.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { createOpenAICompatible } from '@ai-sdk/openai-compatible';
|
|
7
|
+
|
|
8
|
+
import { ComputedDataset } from '@eltjs/elt-sqlite';
|
|
9
|
+
import { Embedding } from '@eltjs/embedding';
|
|
10
|
+
|
|
11
|
+
const model = createOpenAICompatible({
|
|
12
|
+
name: 'llama.cpp',
|
|
13
|
+
baseURL: 'http://127.0.0.1:8080/v1',
|
|
14
|
+
}).embeddingModel('embeddinggemma-2');
|
|
15
|
+
|
|
16
|
+
new ComputedDataset({
|
|
17
|
+
into: destination,
|
|
18
|
+
name: 'listing_vectors',
|
|
19
|
+
description: 'The vector of each listing.',
|
|
20
|
+
from: [listings],
|
|
21
|
+
compute: new Embedding({
|
|
22
|
+
model,
|
|
23
|
+
key: 'id',
|
|
24
|
+
fields: ['title', 'description'],
|
|
25
|
+
}),
|
|
26
|
+
});
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- `key` is the column that identifies a row. It is the key of the output row.
|
|
30
|
+
- `fields` are the columns whose text makes the vector. The rule joins their text with line breaks. A row with no text in these columns has no vector.
|
|
31
|
+
- The output column `vector` holds a unit vector of float32 values in the byte order of the platform. This is the form that `VectorSearch` of `@zukhruf/embeddings` reads, so the cosine similarity of two vectors is their dot product.
|
|
32
|
+
- The identity of each row is the provider and the id of the model. When you change the model, the next refresh makes every vector again.
|
|
33
|
+
- The rule sends 64 rows to `embedMany` at a time. When the model refuses a call, each row of that call is stored as `failed` with the error, and the next refresh asks again. The load does not fail.
|
|
34
|
+
- To search, declare a view that gives `id` and `vector`, and give its name to `VectorSearch`. A search by publish date, such as `nearest`, also needs `published_at`. A query without a date range does not.
|
|
35
|
+
|
|
36
|
+
## Give the model its prompts
|
|
37
|
+
|
|
38
|
+
Some models want a prompt before each text, and a different prompt for a document and for a search text. EmbeddingGemma wants `title: none | text: …` before a document and `task: search result | query: …` before a search text. The rule does not know the model, so it adds no prompt. Wrap the model with `wrapEmbeddingModel` of the AI SDK, one time for documents and one time for search texts:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
import { embed, wrapEmbeddingModel } from 'ai';
|
|
42
|
+
|
|
43
|
+
const gemma = local.embeddingModel('embeddinggemma-2');
|
|
44
|
+
const prompted = (modelId: string, prompt: string) =>
|
|
45
|
+
wrapEmbeddingModel({
|
|
46
|
+
model: gemma,
|
|
47
|
+
modelId,
|
|
48
|
+
middleware: {
|
|
49
|
+
transformParams: async ({ params }) => ({
|
|
50
|
+
...params,
|
|
51
|
+
values: params.values.map((text) => `${prompt}${text}`),
|
|
52
|
+
}),
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
const documents = prompted('embeddinggemma-2/document', 'title: none | text: ');
|
|
57
|
+
const searches = prompted(
|
|
58
|
+
'embeddinggemma-2/query',
|
|
59
|
+
'task: search result | query: ',
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
new Embedding({
|
|
63
|
+
model: documents,
|
|
64
|
+
key: 'id',
|
|
65
|
+
fields: ['title', 'description'],
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const { embedding } = await embed({ model: searches, value: 'family sedan' });
|
|
69
|
+
new VectorSearch({ database, table: 'listing_vectors' }).query(embedding);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Give each wrapped model its own `modelId`. The identity of a row is the provider and the id of the model, so a new prompt with a new `modelId` makes every vector again.
|
|
73
|
+
|
|
74
|
+
On 2026-10-27, 42 OpenSooq listings that `source-opensooq-web` crawled got their vectors from EmbeddingGemma 2 in one run. `nearest` of a bicycle listing gave other bicycle listings first. A second run made no vector again.
|
|
75
|
+
|
|
76
|
+
The package does not start a model or a server. Give it a model that is ready. See [when the pipeline refreshes](../elt/README.md#when-the-pipeline-refreshes) for how a pipeline refreshes the rows.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type EmbeddingModel } from 'ai';
|
|
2
|
+
import { type LoadedRow, Rule, type RuleResult } from '@eltjs/elt';
|
|
3
|
+
export declare class Embedding extends Rule<string, Uint8Array> {
|
|
4
|
+
#private;
|
|
5
|
+
readonly key: {
|
|
6
|
+
readonly name: string;
|
|
7
|
+
readonly description: string;
|
|
8
|
+
};
|
|
9
|
+
readonly output: {
|
|
10
|
+
readonly vector: {
|
|
11
|
+
readonly type: 'blob';
|
|
12
|
+
readonly description: 'The unit vector of the row text, float32 values in the byte order of the platform. NULL unless status is computed.';
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly batch = 64;
|
|
16
|
+
readonly concurrency = 1;
|
|
17
|
+
constructor({ model, key, fields, }: {
|
|
18
|
+
model: EmbeddingModel;
|
|
19
|
+
key: string;
|
|
20
|
+
fields: readonly string[];
|
|
21
|
+
});
|
|
22
|
+
read(row: LoadedRow): {
|
|
23
|
+
readonly key: string;
|
|
24
|
+
readonly input: string;
|
|
25
|
+
} | null;
|
|
26
|
+
identity(): Promise<string>;
|
|
27
|
+
compute(texts: readonly string[], signal?: AbortSignal): Promise<readonly RuleResult<Readonly<Record<string, Uint8Array>>>[]>;
|
|
28
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { embedMany } from 'ai';
|
|
2
|
+
import { Rule, errorMessage, } from '@eltjs/elt';
|
|
3
|
+
// The vector of each loaded row's text, made by an embedding model, so a
|
|
4
|
+
// vector search finds rows by meaning, as pgai's vectorizer and LanceDB's
|
|
5
|
+
// embedding functions keep one beside each row. A vector is stored as a unit
|
|
6
|
+
// vector of float32 values in the platform's byte order, the form
|
|
7
|
+
// @zukhruf/embeddings' VectorSearch reads (its ADR 0005): cosine similarity
|
|
8
|
+
// is then a dot product.
|
|
9
|
+
export class Embedding extends Rule {
|
|
10
|
+
key;
|
|
11
|
+
output = {
|
|
12
|
+
vector: {
|
|
13
|
+
type: 'blob',
|
|
14
|
+
description: 'The unit vector of the row text, float32 values in the byte order of the platform. NULL unless status is computed.',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
// Rows embedded and committed together; the model's own limit on values in
|
|
18
|
+
// one call splits a batch further inside embedMany.
|
|
19
|
+
batch = 64;
|
|
20
|
+
// One call at a time: a local model server answers one call at a time.
|
|
21
|
+
concurrency = 1;
|
|
22
|
+
#model;
|
|
23
|
+
#fields;
|
|
24
|
+
// key: the column that identifies a row, such as id. fields: the columns
|
|
25
|
+
// whose text makes the vector, joined by line breaks; a row with none has
|
|
26
|
+
// no vector.
|
|
27
|
+
constructor({ model, key, fields, }) {
|
|
28
|
+
super();
|
|
29
|
+
this.#model = model;
|
|
30
|
+
this.key = {
|
|
31
|
+
name: key,
|
|
32
|
+
description: `The ${key} of the row the vector is made from.`,
|
|
33
|
+
};
|
|
34
|
+
this.#fields = Object.freeze([...fields]);
|
|
35
|
+
Object.freeze(this);
|
|
36
|
+
}
|
|
37
|
+
read(row) {
|
|
38
|
+
const key = row[this.key.name];
|
|
39
|
+
if (typeof key !== 'string' && typeof key !== 'number')
|
|
40
|
+
return null;
|
|
41
|
+
const text = this.#fields
|
|
42
|
+
.map((field) => row[field])
|
|
43
|
+
.filter((value) => typeof value === 'string' && value.trim() !== '')
|
|
44
|
+
.join('\n');
|
|
45
|
+
return text === '' ? null : { key: String(key), input: text };
|
|
46
|
+
}
|
|
47
|
+
// The model makes every vector, so its provider and id name them all.
|
|
48
|
+
async identity() {
|
|
49
|
+
return typeof this.#model === 'string'
|
|
50
|
+
? this.#model
|
|
51
|
+
: `${this.#model.provider}/${this.#model.modelId}`;
|
|
52
|
+
}
|
|
53
|
+
async compute(texts, signal) {
|
|
54
|
+
try {
|
|
55
|
+
const { embeddings } = await embedMany({
|
|
56
|
+
model: this.#model,
|
|
57
|
+
values: [...texts],
|
|
58
|
+
abortSignal: signal,
|
|
59
|
+
});
|
|
60
|
+
return embeddings.map((embedding) => ({
|
|
61
|
+
value: { vector: unitVector(embedding) },
|
|
62
|
+
}));
|
|
63
|
+
}
|
|
64
|
+
catch (failure) {
|
|
65
|
+
if (signal?.aborted)
|
|
66
|
+
return texts.map(() => ({ gone: true }));
|
|
67
|
+
// A model that refuses a call fails each row of it; the next refresh
|
|
68
|
+
// asks again.
|
|
69
|
+
const error = errorMessage(failure);
|
|
70
|
+
return texts.map(() => ({ error }));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
function unitVector(embedding) {
|
|
75
|
+
const length = Math.hypot(...embedding);
|
|
76
|
+
return new Uint8Array(Float32Array.from(embedding, (value) => value / length).buffer);
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eltjs/embedding",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A rule of an elt computed dataset: it gives each loaded row a vector of its text, made by an AI SDK embedding model, so a search can find rows by meaning.",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/ezzabuzaid/elt",
|
|
9
|
+
"directory": "packages/embedding"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ezzabuzaid/elt/issues"
|
|
13
|
+
},
|
|
14
|
+
"homepage": "https://github.com/ezzabuzaid/elt/tree/main/packages/embedding#readme",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"elt",
|
|
17
|
+
"embedding",
|
|
18
|
+
"vector",
|
|
19
|
+
"ai-sdk",
|
|
20
|
+
"semantic-search"
|
|
21
|
+
],
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": "./package.json",
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/embedding.d.ts",
|
|
27
|
+
"default": "./dist/embedding.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"!dist/spec/**",
|
|
33
|
+
"!**/*.tsbuildinfo",
|
|
34
|
+
"!**/*.test.*"
|
|
35
|
+
],
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=24"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"@eltjs/elt": "^0.1.1",
|
|
44
|
+
"ai": "^7.0.165"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@ai-sdk/provider": "^4.0.37",
|
|
48
|
+
"@eltjs/elt-sqlite": "^0.1.1",
|
|
49
|
+
"@zukhruf/sqlite-open": "^0.8.10",
|
|
50
|
+
"@zukhruf/testing": "^0.8.10"
|
|
51
|
+
}
|
|
52
|
+
}
|