@langfuse/client 4.5.1 → 4.6.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/LICENSE CHANGED
@@ -1,5 +1,8 @@
1
- Copyright (c) 2023 Finto Technologies GmbH
1
+ MIT License
2
2
 
3
+ This repository is licensed under the MIT License. Portions of this codebase are derived from posthog/posthog-js-lite by PostHog, which is also licensed under the MIT License.
4
+
5
+ Copyright (c) 2023-2026 Langfuse GmbH
3
6
  Copyright (c) 2022 PostHog (part of Hiberly Inc)
4
7
 
5
8
  Permission is hereby granted, free of charge, to any person obtaining a copy
package/dist/index.cjs CHANGED
@@ -143,7 +143,8 @@ var DatasetManager = class {
143
143
  const itemsResponse = await this.langfuseClient.api.datasetItems.list({
144
144
  datasetName: name,
145
145
  limit: (_a = options == null ? void 0 : options.fetchItemsPageSize) != null ? _a : 50,
146
- page
146
+ page,
147
+ ...(options == null ? void 0 : options.version) && { version: options.version }
147
148
  });
148
149
  items.push(...itemsResponse.data);
149
150
  if (itemsResponse.meta.totalPages <= page) {
@@ -158,12 +159,14 @@ var DatasetManager = class {
158
159
  const runExperiment = (params) => {
159
160
  return this.langfuseClient.experiment.run({
160
161
  data: items,
162
+ datasetVersion: options == null ? void 0 : options.version,
161
163
  ...params
162
164
  });
163
165
  };
164
166
  const returnDataset = {
165
167
  ...dataset,
166
168
  items: itemsWithLinkMethod,
169
+ version: options == null ? void 0 : options.version,
167
170
  runExperiment
168
171
  };
169
172
  return returnDataset;
@@ -318,7 +321,8 @@ var ExperimentManager = class {
318
321
  experimentName: name,
319
322
  experimentRunName: runName,
320
323
  experimentDescription: description,
321
- experimentMetadata: metadata
324
+ experimentMetadata: metadata,
325
+ datasetVersion: config.datasetVersion
322
326
  });
323
327
  });
324
328
  const settledResults = await Promise.allSettled(promises);
@@ -442,7 +446,10 @@ var ExperimentManager = class {
442
446
  metadata: params.experimentMetadata,
443
447
  datasetItemId,
444
448
  traceId: traceId2,
445
- observationId: observationId2
449
+ observationId: observationId2,
450
+ ...params.datasetVersion && {
451
+ datasetVersion: params.datasetVersion
452
+ }
446
453
  }
447
454
  );
448
455
  datasetRunId2 = result.datasetRunId;
@@ -1665,10 +1672,12 @@ var ScoreManager = class {
1665
1672
  return;
1666
1673
  }
1667
1674
  this.eventQueue.push(scoreIngestionEvent);
1668
- this.logger.debug(
1669
- "Added score event to queue:\n",
1670
- JSON.stringify(scoreIngestionEvent, null, 2)
1671
- );
1675
+ if (this.logger.isLevelEnabled(import_core5.LogLevel.DEBUG)) {
1676
+ this.logger.debug(
1677
+ "Added score event to queue:\n",
1678
+ JSON.stringify(scoreIngestionEvent, null, 2)
1679
+ );
1680
+ }
1672
1681
  if (this.eventQueue.length >= this.flushAtCount) {
1673
1682
  this.flushPromise = this.flush();
1674
1683
  } else if (!this.flushTimer) {