@langfuse/client 4.1.0-alpha.1 → 4.1.0-alpha.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/dist/index.cjs +20 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +19 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ __export(index_exports, {
|
|
|
39
39
|
PromptManager: () => PromptManager,
|
|
40
40
|
ScoreManager: () => ScoreManager,
|
|
41
41
|
TextPromptClient: () => TextPromptClient,
|
|
42
|
-
|
|
42
|
+
createEvaluatorFromAutoevals: () => createEvaluatorFromAutoevals
|
|
43
43
|
});
|
|
44
44
|
module.exports = __toCommonJS(index_exports);
|
|
45
45
|
|
|
@@ -312,7 +312,21 @@ var ExperimentManager = class {
|
|
|
312
312
|
experimentMetadata: metadata
|
|
313
313
|
});
|
|
314
314
|
});
|
|
315
|
-
const
|
|
315
|
+
const settledResults = await Promise.allSettled(promises);
|
|
316
|
+
const results = settledResults.reduce(
|
|
317
|
+
(acc, settledResult) => {
|
|
318
|
+
if (settledResult.status === "fulfilled") {
|
|
319
|
+
acc.push(settledResult.value);
|
|
320
|
+
} else {
|
|
321
|
+
const errorMessage = settledResult.reason instanceof Error ? settledResult.reason.message : String(settledResult.reason);
|
|
322
|
+
this.logger.error(
|
|
323
|
+
`Task failed with error: ${errorMessage}. Skipping item.`
|
|
324
|
+
);
|
|
325
|
+
}
|
|
326
|
+
return acc;
|
|
327
|
+
},
|
|
328
|
+
[]
|
|
329
|
+
);
|
|
316
330
|
itemResults.push(...results);
|
|
317
331
|
}
|
|
318
332
|
const datasetRunId = itemResults.length > 0 ? itemResults[0].datasetRunId : void 0;
|
|
@@ -408,8 +422,8 @@ var ExperimentManager = class {
|
|
|
408
422
|
...experimentMetadata,
|
|
409
423
|
...(_a = item.metadata) != null ? _a : {},
|
|
410
424
|
..."id" in item && "datasetId" in item ? {
|
|
411
|
-
|
|
412
|
-
|
|
425
|
+
dataset_id: item["datasetId"],
|
|
426
|
+
dataset_item_id: item["id"]
|
|
413
427
|
} : {}
|
|
414
428
|
}
|
|
415
429
|
});
|
|
@@ -1880,7 +1894,7 @@ var LangfuseClient = class {
|
|
|
1880
1894
|
};
|
|
1881
1895
|
|
|
1882
1896
|
// src/experiment/adapters.ts
|
|
1883
|
-
function
|
|
1897
|
+
function createEvaluatorFromAutoevals(autoevalEvaluator, params) {
|
|
1884
1898
|
const langfuseEvaluator = async (langfuseEvaluatorParams) => {
|
|
1885
1899
|
var _a;
|
|
1886
1900
|
const score = await autoevalEvaluator({
|
|
@@ -1908,6 +1922,6 @@ function autoevalsToLangfuseEvaluator(autoevalEvaluator, params) {
|
|
|
1908
1922
|
PromptManager,
|
|
1909
1923
|
ScoreManager,
|
|
1910
1924
|
TextPromptClient,
|
|
1911
|
-
|
|
1925
|
+
createEvaluatorFromAutoevals
|
|
1912
1926
|
});
|
|
1913
1927
|
//# sourceMappingURL=index.cjs.map
|