@postalsys/email-ai-tools 1.4.0 → 1.4.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/CHANGELOG.md +7 -0
- package/examples/emeddings.js +5 -0
- package/lib/generate-embeddings.js +7 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.4.1](https://github.com/postalsys/email-ai-tools/compare/v1.4.0...v1.4.1) (2023-09-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **embeddings:** remove quoted lines ([fb5dd92](https://github.com/postalsys/email-ai-tools/commit/fb5dd92b834249a0290113df4c42b2f01eb22e84))
|
|
9
|
+
|
|
3
10
|
## [1.4.0](https://github.com/postalsys/email-ai-tools/compare/v1.3.4...v1.4.0) (2023-09-20)
|
|
4
11
|
|
|
5
12
|
|
package/examples/emeddings.js
CHANGED
|
@@ -151,7 +151,13 @@ class Embedder {
|
|
|
151
151
|
|
|
152
152
|
let textChunks = [];
|
|
153
153
|
if (this.text) {
|
|
154
|
-
let
|
|
154
|
+
let preparedText = this.text
|
|
155
|
+
.replace(/\r?\n/g, '\n')
|
|
156
|
+
.replace(/^\s*>.*$/gm, '')
|
|
157
|
+
.replace(/^\s*>$/gm)
|
|
158
|
+
.replace(/\n\n+/g, '\n\n');
|
|
159
|
+
|
|
160
|
+
let textTokens = tokenizer.encode(preparedText);
|
|
155
161
|
|
|
156
162
|
let pos = 0;
|
|
157
163
|
while (pos < textTokens.bpe.length) {
|