orchestrated 0.1.13 → 0.1.14
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/index.d.ts +1 -1
- package/index.js +8 -7
- package/index.js.map +4 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -80,7 +80,7 @@ declare class BatchClient {
|
|
|
80
80
|
* - "static": Filter by both name AND checksum (fixed dataset)
|
|
81
81
|
* - "dataset": Filter by name only (dynamic dataset)
|
|
82
82
|
*/
|
|
83
|
-
initialize(name: string, checksum: string, dataSourceType?: "static" | "dataset"): Promise<void>;
|
|
83
|
+
initialize(name: string, checksum: string, dataSourceType?: "static" | "dataset", maxAgeDays?: number): Promise<void>;
|
|
84
84
|
generateRequestId(body: BatchRequest["body"]): string;
|
|
85
85
|
/**
|
|
86
86
|
* Adds a request to the batch
|
package/index.js
CHANGED
|
@@ -117019,10 +117019,15 @@ class BatchClient {
|
|
|
117019
117019
|
fs.mkdirSync(this.tempDir, { recursive: true });
|
|
117020
117020
|
}
|
|
117021
117021
|
}
|
|
117022
|
-
async initialize(name, checksum, dataSourceType) {
|
|
117022
|
+
async initialize(name, checksum, dataSourceType, maxAgeDays = 3) {
|
|
117023
117023
|
this.metadata = { name, checksum };
|
|
117024
117024
|
const batches = await this.listBatches(100);
|
|
117025
|
+
const maxAgeMs = maxAgeDays * 24 * 60 * 60 * 1000;
|
|
117026
|
+
const cutoff = Date.now() - maxAgeMs;
|
|
117025
117027
|
const matchingBatches = batches.filter((batch) => {
|
|
117028
|
+
if (batch.created_at * 1000 < cutoff) {
|
|
117029
|
+
return false;
|
|
117030
|
+
}
|
|
117026
117031
|
const nameMatches = batch.metadata?.name === this.metadata?.name;
|
|
117027
117032
|
if (dataSourceType === "static") {
|
|
117028
117033
|
return nameMatches && batch.metadata?.checksum === this.metadata?.checksum;
|
|
@@ -117308,10 +117313,6 @@ async function serializeScorer(scorer, evalName, index) {
|
|
|
117308
117313
|
}
|
|
117309
117314
|
if (typeof scorer === "function") {
|
|
117310
117315
|
const scorerName = scorer.name;
|
|
117311
|
-
console.log({
|
|
117312
|
-
scorerName,
|
|
117313
|
-
scorer
|
|
117314
|
-
});
|
|
117315
117316
|
const definition = scorer.definition;
|
|
117316
117317
|
if (definition && typeof definition === "object" && definition.type) {
|
|
117317
117318
|
const alreadyRegistered = registry2.scorers.find((s) => s.name === definition.name);
|
|
@@ -117319,7 +117320,7 @@ async function serializeScorer(scorer, evalName, index) {
|
|
|
117319
117320
|
registry2.scorers.push(definition);
|
|
117320
117321
|
}
|
|
117321
117322
|
return {
|
|
117322
|
-
type:
|
|
117323
|
+
type: definition.type,
|
|
117323
117324
|
slug: definition.slug || definition.name.toLowerCase(),
|
|
117324
117325
|
fingerprint: definition.fingerprint
|
|
117325
117326
|
};
|
|
@@ -118823,4 +118824,4 @@ export {
|
|
|
118823
118824
|
Behavioral
|
|
118824
118825
|
};
|
|
118825
118826
|
|
|
118826
|
-
//# debugId=
|
|
118827
|
+
//# debugId=79A02573B1D5CABA64756E2164756E21
|