@langfuse/client 4.1.0 → 4.2.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/dist/index.d.cts CHANGED
@@ -68,7 +68,7 @@ type ExperimentTaskParams<Input = any, ExpectedOutput = any, Metadata extends Re
68
68
  * @since 4.1.0
69
69
  */
70
70
  type ExperimentTask<Input = any, ExpectedOutput = any, Metadata extends Record<string, any> = Record<string, any>> = (params: ExperimentTaskParams<Input, ExpectedOutput, Metadata>) => Promise<any>;
71
- type Evaluation = Pick<ScoreBody, "name" | "value" | "comment" | "metadata" | "dataType">;
71
+ type Evaluation = Pick<ScoreBody, "name" | "value" | "comment" | "metadata" | "dataType" | "configId">;
72
72
  type EvaluatorParams<Input = any, ExpectedOutput = any, Metadata extends Record<string, any> = Record<string, any>> = {
73
73
  /**
74
74
  * The original input data passed to the task.
@@ -621,7 +621,7 @@ declare class ExperimentManager {
621
621
  * @param config.task - Function that processes each data item and returns output
622
622
  * @param config.evaluators - Optional array of functions to evaluate each item's output
623
623
  * @param config.runEvaluators - Optional array of functions to evaluate the entire run
624
- * @param config.maxConcurrency - Maximum number of concurrent task executions (default: Infinity)
624
+ * @param config.maxConcurrency - Maximum number of concurrent task executions (default: 50)
625
625
  *
626
626
  * @returns Promise that resolves to experiment results including:
627
627
  * - runName: The experiment run name (either provided or generated)
package/dist/index.d.ts CHANGED
@@ -68,7 +68,7 @@ type ExperimentTaskParams<Input = any, ExpectedOutput = any, Metadata extends Re
68
68
  * @since 4.1.0
69
69
  */
70
70
  type ExperimentTask<Input = any, ExpectedOutput = any, Metadata extends Record<string, any> = Record<string, any>> = (params: ExperimentTaskParams<Input, ExpectedOutput, Metadata>) => Promise<any>;
71
- type Evaluation = Pick<ScoreBody, "name" | "value" | "comment" | "metadata" | "dataType">;
71
+ type Evaluation = Pick<ScoreBody, "name" | "value" | "comment" | "metadata" | "dataType" | "configId">;
72
72
  type EvaluatorParams<Input = any, ExpectedOutput = any, Metadata extends Record<string, any> = Record<string, any>> = {
73
73
  /**
74
74
  * The original input data passed to the task.
@@ -621,7 +621,7 @@ declare class ExperimentManager {
621
621
  * @param config.task - Function that processes each data item and returns output
622
622
  * @param config.evaluators - Optional array of functions to evaluate each item's output
623
623
  * @param config.runEvaluators - Optional array of functions to evaluate the entire run
624
- * @param config.maxConcurrency - Maximum number of concurrent task executions (default: Infinity)
624
+ * @param config.maxConcurrency - Maximum number of concurrent task executions (default: 50)
625
625
  *
626
626
  * @returns Promise that resolves to experiment results including:
627
627
  * - runName: The experiment run name (either provided or generated)
package/dist/index.mjs CHANGED
@@ -192,7 +192,7 @@ var ExperimentManager = class {
192
192
  * @param config.task - Function that processes each data item and returns output
193
193
  * @param config.evaluators - Optional array of functions to evaluate each item's output
194
194
  * @param config.runEvaluators - Optional array of functions to evaluate the entire run
195
- * @param config.maxConcurrency - Maximum number of concurrent task executions (default: Infinity)
195
+ * @param config.maxConcurrency - Maximum number of concurrent task executions (default: 50)
196
196
  *
197
197
  * @returns Promise that resolves to experiment results including:
198
198
  * - runName: The experiment run name (either provided or generated)
@@ -255,7 +255,7 @@ var ExperimentManager = class {
255
255
  runName: providedRunName,
256
256
  description,
257
257
  metadata,
258
- maxConcurrency: batchSize = Infinity,
258
+ maxConcurrency: batchSize = 50,
259
259
  runEvaluators
260
260
  } = config;
261
261
  const runName = this.createExperimentRunName({
@@ -451,11 +451,7 @@ ${JSON.stringify(params2)}
451
451
  for (const ev of evals) {
452
452
  this.langfuseClient.score.create({
453
453
  traceId,
454
- name: ev.name,
455
- comment: ev.comment,
456
- value: ev.value,
457
- metadata: ev.metadata,
458
- dataType: ev.dataType
454
+ ...ev
459
455
  });
460
456
  }
461
457
  return {
@@ -1217,10 +1213,10 @@ var ChatPromptClient = class _ChatPromptClient extends BasePromptClient {
1217
1213
  JSON.stringify(placeholderValue)
1218
1214
  );
1219
1215
  } else {
1220
- messagesWithPlaceholdersReplaced.push({
1221
- variableName: item.name,
1222
- optional: false
1223
- });
1216
+ messagesWithPlaceholdersReplaced.push([
1217
+ "placeholder",
1218
+ `{${item.name}}`
1219
+ ]);
1224
1220
  }
1225
1221
  } else if ("role" in item && "content" in item && item.type === "chatmessage" /* ChatMessage */) {
1226
1222
  messagesWithPlaceholdersReplaced.push({