Add evaluation operations and reporting
This commit is contained in:
1 parent
60f33b8f4b
commit
6f09408423
57 files changed
+7060
-142
No files matched your search
@@ -21,6 +21,7 @@ const { getRawSecret } = await import("../common/secret-manager.js");
|
||||
const { ConversationStore } = await import("../conversation/index.js");
|
||||
const { ShadowWorker } = await import("../eval/shadow-worker.js");
|
||||
const { AlertService } = await import("../observability/alert.js");
|
||||
const { initMongoDB, closeMongoDB } = await import("../common/mongodb.js");
|
||||
|
||||
function firstNonEmpty(
|
||||
...values: Array<string | null | undefined>
|
||||
@@ -175,15 +176,30 @@ async function bootstrap(): Promise<void> {
|
||||
});
|
||||
const conversationStore = new ConversationStore(garnetClient);
|
||||
const alertService = new AlertService(garnetClient, natsClient);
|
||||
const mongoConnectionString = firstNonEmpty(
|
||||
getRawSecret("MONGODB_CONNECTION_STRING"),
|
||||
process.env["MONGODB_CONNECTION_STRING"],
|
||||
);
|
||||
const mongoConnection = mongoConnectionString
|
||||
? await initMongoDB(mongoConnectionString)
|
||||
: undefined;
|
||||
if (!mongoConnection) {
|
||||
logger.warn(
|
||||
"[Background] MongoDB connection string missing; eval archive/drift/promote disabled",
|
||||
);
|
||||
}
|
||||
const worker = new ShadowWorker(
|
||||
garnetClient,
|
||||
llmClient,
|
||||
conversationStore,
|
||||
alertService,
|
||||
undefined,
|
||||
mongoConnection,
|
||||
);
|
||||
|
||||
installShutdownHooks(async () => {
|
||||
await worker.stop();
|
||||
await closeMongoDB();
|
||||
await natsClient.close();
|
||||
await garnetClient.close();
|
||||
await shutdownTracing();
|
||||
|
||||
Reference in new issue
Block a user