doc2vec 1.0.1 → 1.0.2
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/Dockerfile +8 -17
- package/Dockerfile.old +19 -0
- package/dist/doc2vec.js +3 -7
- package/package.json +4 -2
package/Dockerfile
CHANGED
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
FROM node:20-slim
|
|
1
|
+
FROM node:20-slim
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
RUN apt-get update && \
|
|
5
|
-
apt-get install -y curl unzip git && \
|
|
6
|
-
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
|
|
7
|
-
unzip awscliv2.zip && \
|
|
8
|
-
./aws/install && \
|
|
9
|
-
rm -rf awscliv2.zip aws && \
|
|
10
|
-
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
3
|
+
WORKDIR /app
|
|
11
4
|
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
RUN npm install
|
|
5
|
+
# Install Python and build tools
|
|
6
|
+
RUN apt-get update && apt-get install -y \
|
|
7
|
+
python3 \
|
|
8
|
+
make \
|
|
9
|
+
g++ \
|
|
10
|
+
&& apt-get clean
|
package/Dockerfile.old
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
FROM node:20-slim AS base
|
|
2
|
+
|
|
3
|
+
# Install AWS CLI
|
|
4
|
+
RUN apt-get update && \
|
|
5
|
+
apt-get install -y curl unzip git && \
|
|
6
|
+
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \
|
|
7
|
+
unzip awscliv2.zip && \
|
|
8
|
+
./aws/install && \
|
|
9
|
+
rm -rf awscliv2.zip aws && \
|
|
10
|
+
apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
11
|
+
|
|
12
|
+
# Copy project files
|
|
13
|
+
COPY package.json /usr/src/app/
|
|
14
|
+
COPY package-lock.json /usr/src/app/
|
|
15
|
+
COPY tsconfig.json /usr/src/app/
|
|
16
|
+
COPY *.ts /usr/src/app/
|
|
17
|
+
WORKDIR /usr/src/app
|
|
18
|
+
|
|
19
|
+
RUN npm install
|
package/dist/doc2vec.js
CHANGED
|
@@ -690,16 +690,13 @@ class Doc2Vec {
|
|
|
690
690
|
logger.error(`Error during chunking or embedding for ${filePath}:`, error);
|
|
691
691
|
}
|
|
692
692
|
}, logger);
|
|
693
|
-
// 3. Update cleanup logic for URL rewriting
|
|
694
693
|
logger.section('CLEANUP');
|
|
695
694
|
if (dbConnection.type === 'sqlite') {
|
|
696
695
|
logger.info(`Running SQLite cleanup for local directory ${config.path}`);
|
|
697
|
-
// Pass the config object directly to our consolidated function
|
|
698
696
|
this.removeObsoleteFilesSQLite(dbConnection.db, processedFiles, config, logger);
|
|
699
697
|
}
|
|
700
698
|
else if (dbConnection.type === 'qdrant') {
|
|
701
699
|
logger.info(`Running Qdrant cleanup for local directory ${config.path} in collection ${dbConnection.collectionName}`);
|
|
702
|
-
// Pass the config object directly to our consolidated function
|
|
703
700
|
await this.removeObsoleteFilesQdrant(dbConnection, processedFiles, config, logger);
|
|
704
701
|
}
|
|
705
702
|
logger.info(`Finished processing local directory: ${config.path}`);
|
|
@@ -790,12 +787,11 @@ class Doc2Vec {
|
|
|
790
787
|
logger.error(`Error reading directory ${dirPath}:`, error);
|
|
791
788
|
}
|
|
792
789
|
}
|
|
793
|
-
// SQLite consolidated function
|
|
794
790
|
removeObsoleteFilesSQLite(db, processedFiles, pathConfig, logger) {
|
|
795
791
|
const getChunksForPathStmt = db.prepare(`
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
792
|
+
SELECT chunk_id, url FROM vec_items
|
|
793
|
+
WHERE url LIKE ? || '%'
|
|
794
|
+
`);
|
|
799
795
|
const deleteChunkStmt = db.prepare(`DELETE FROM vec_items WHERE chunk_id = ?`);
|
|
800
796
|
// Determine if we're using URL rewriting or direct file paths
|
|
801
797
|
const isRewriteMode = typeof pathConfig === 'object' && pathConfig.url_rewrite_prefix;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "doc2vec",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "doc2vec.ts",
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc && chmod 755 dist/doc2vec.js",
|
|
16
|
-
"start": "node dist/doc2vec.js"
|
|
16
|
+
"start": "node dist/doc2vec.js",
|
|
17
|
+
"prepublishOnly": "npm run build",
|
|
18
|
+
"prepare": "npm run build"
|
|
17
19
|
},
|
|
18
20
|
"keywords": [],
|
|
19
21
|
"author": "",
|