@o-lang/semantic-doc-search 1.0.29 → 1.0.30
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/package.json +1 -1
- package/src/embeddings/local.js +7 -0
package/package.json
CHANGED
package/src/embeddings/local.js
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* - No silent failures
|
|
7
7
|
* - No zero vectors
|
|
8
8
|
* - Deterministic behavior
|
|
9
|
+
* - DEFENSIVE against method detaching
|
|
9
10
|
*/
|
|
10
11
|
|
|
11
12
|
class LocalEmbedding {
|
|
@@ -13,6 +14,12 @@ class LocalEmbedding {
|
|
|
13
14
|
this.dim = 384;
|
|
14
15
|
this.model = null;
|
|
15
16
|
this.loading = null;
|
|
17
|
+
|
|
18
|
+
// 🔒 CRITICAL: bind methods to prevent resolver breakage
|
|
19
|
+
this.loadModel = this.loadModel.bind(this);
|
|
20
|
+
this.embed = this.embed.bind(this);
|
|
21
|
+
this.embedBatch = this.embedBatch.bind(this);
|
|
22
|
+
this.getDimension = this.getDimension.bind(this);
|
|
16
23
|
}
|
|
17
24
|
|
|
18
25
|
/* ---------------- INTERNAL ---------------- */
|