doc2vec 2.9.0 → 2.9.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/dist/content-processor.js +4 -1
- package/dist/doc2vec.js +4 -2
- package/package.json +1 -1
|
@@ -1707,7 +1707,10 @@ class ContentProcessor {
|
|
|
1707
1707
|
if (lang) {
|
|
1708
1708
|
try {
|
|
1709
1709
|
const codeChunker = await this.getCodeChunker(lang, sourceConfig.chunk_size);
|
|
1710
|
-
chunks = await
|
|
1710
|
+
chunks = await Promise.race([
|
|
1711
|
+
codeChunker.chunk(code),
|
|
1712
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error(`CodeChunker timed out after 30s for ${normalizedPath || url}`)), 30000))
|
|
1713
|
+
]);
|
|
1711
1714
|
}
|
|
1712
1715
|
catch (error) {
|
|
1713
1716
|
logger.warn(`CodeChunker failed for ${normalizedPath || url}, falling back to token chunking:`, error);
|
package/dist/doc2vec.js
CHANGED
|
@@ -1530,7 +1530,7 @@ class Doc2Vec {
|
|
|
1530
1530
|
const response = await this.openai.embeddings.create({
|
|
1531
1531
|
model: this.embeddingModel,
|
|
1532
1532
|
input: safeTexts,
|
|
1533
|
-
});
|
|
1533
|
+
}, { timeout: 60000 });
|
|
1534
1534
|
logger.debug(`Successfully created ${response.data.length} embeddings`);
|
|
1535
1535
|
return response.data.map(d => d.embedding);
|
|
1536
1536
|
}
|
|
@@ -1555,5 +1555,7 @@ if (require.main === module) {
|
|
|
1555
1555
|
process.exit(1);
|
|
1556
1556
|
}
|
|
1557
1557
|
const doc2Vec = new Doc2Vec(configPath);
|
|
1558
|
-
doc2Vec.run()
|
|
1558
|
+
doc2Vec.run()
|
|
1559
|
+
.then(() => process.exit(0))
|
|
1560
|
+
.catch((err) => { console.error(err); process.exit(1); });
|
|
1559
1561
|
}
|