@semiont/make-meaning 0.5.16 → 0.5.18
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/index.js +38 -8
- package/dist/index.js.map +1 -1
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -12798,9 +12798,31 @@ async function createJobQueue(project, eventBus, logger) {
|
|
|
12798
12798
|
});
|
|
12799
12799
|
return { jobQueue, jobStatusSubscription };
|
|
12800
12800
|
}
|
|
12801
|
+
var STARTUP_CONNECT_TIMEOUT_MS = 6e4;
|
|
12802
|
+
async function withStartupTimeout(what, work) {
|
|
12803
|
+
let timer2;
|
|
12804
|
+
try {
|
|
12805
|
+
return await Promise.race([
|
|
12806
|
+
work,
|
|
12807
|
+
new Promise((_resolve, reject) => {
|
|
12808
|
+
timer2 = setTimeout(
|
|
12809
|
+
() => reject(
|
|
12810
|
+
new Error(
|
|
12811
|
+
`${what} did not become available within ${STARTUP_CONNECT_TIMEOUT_MS / 1e3}s. Exiting so the container restart policy can retry \u2014 it is normal for a dependency to be slow when every service restarts at once.`
|
|
12812
|
+
)
|
|
12813
|
+
),
|
|
12814
|
+
STARTUP_CONNECT_TIMEOUT_MS
|
|
12815
|
+
);
|
|
12816
|
+
})
|
|
12817
|
+
]);
|
|
12818
|
+
} finally {
|
|
12819
|
+
if (timer2 !== void 0) clearTimeout(timer2);
|
|
12820
|
+
}
|
|
12821
|
+
}
|
|
12801
12822
|
async function createKnowledgeSystemFromConfig(project, config, eventBus, logger, skipRebuild) {
|
|
12802
12823
|
const graphConfig = config.services.graph;
|
|
12803
|
-
|
|
12824
|
+
logger.info("Connecting to graph database", { type: graphConfig.type });
|
|
12825
|
+
const graphDb = await withStartupTimeout("Graph database", getGraphDatabase(graphConfig));
|
|
12804
12826
|
const eventStore = createEventStore(project, eventBus, logger.child({ component: "event-store" }));
|
|
12805
12827
|
let vectorStore;
|
|
12806
12828
|
let embeddingProvider;
|
|
@@ -12808,13 +12830,21 @@ async function createKnowledgeSystemFromConfig(project, config, eventBus, logger
|
|
|
12808
12830
|
const embeddingConfig = config.services.embedding;
|
|
12809
12831
|
if (vectorsConfig && embeddingConfig) {
|
|
12810
12832
|
const { createVectorStore, createEmbeddingProvider } = await import('@semiont/vectors');
|
|
12811
|
-
|
|
12812
|
-
|
|
12813
|
-
|
|
12814
|
-
|
|
12815
|
-
|
|
12816
|
-
|
|
12817
|
-
|
|
12833
|
+
logger.info("Connecting to embedding provider", { type: embeddingConfig.type, model: embeddingConfig.model });
|
|
12834
|
+
embeddingProvider = await withStartupTimeout(
|
|
12835
|
+
"Embedding provider",
|
|
12836
|
+
createEmbeddingProvider(embeddingConfig)
|
|
12837
|
+
);
|
|
12838
|
+
logger.info("Connecting to vector store", { type: vectorsConfig.type ?? "qdrant" });
|
|
12839
|
+
vectorStore = await withStartupTimeout(
|
|
12840
|
+
"Vector store",
|
|
12841
|
+
createVectorStore({
|
|
12842
|
+
type: vectorsConfig.type ?? "qdrant",
|
|
12843
|
+
host: vectorsConfig.host,
|
|
12844
|
+
port: vectorsConfig.port,
|
|
12845
|
+
dimensions: embeddingProvider.dimensions()
|
|
12846
|
+
})
|
|
12847
|
+
);
|
|
12818
12848
|
logger.info("Vector search initialized", {
|
|
12819
12849
|
store: vectorsConfig.type,
|
|
12820
12850
|
embedding: embeddingConfig.type,
|