@langfuse/client 4.4.10-alpha.2 → 4.4.10

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
@@ -1194,6 +1194,39 @@ declare class PromptManager {
1194
1194
  version: number;
1195
1195
  newLabels: string[];
1196
1196
  }): Promise<Prompt>;
1197
+ /**
1198
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
1199
+ *
1200
+ * The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
1201
+ *
1202
+ * @param name - Name of the prompt to delete
1203
+ * @param options - Optional deletion configuration
1204
+ * @param options.version - Optional version to delete. If specified, deletes only this specific version
1205
+ * @param options.label - Optional label to filter deletion. If specified, deletes all prompt versions with this label
1206
+ *
1207
+ * @returns Promise that resolves when deletion is complete
1208
+ *
1209
+ * @throws {LangfuseAPI.NotFoundError} If the prompt does not exist
1210
+ * @throws {LangfuseAPI.Error} If the API request fails
1211
+ *
1212
+ * @example
1213
+ * ```typescript
1214
+ * // Delete all versions of a prompt
1215
+ * await langfuse.prompt.delete("my-prompt");
1216
+ *
1217
+ * // Delete specific version
1218
+ * await langfuse.prompt.delete("my-prompt", { version: 2 });
1219
+ *
1220
+ * // Delete all versions with a specific label
1221
+ * await langfuse.prompt.delete("my-prompt", { label: "staging" });
1222
+ * ```
1223
+ */
1224
+ delete(name: string, options?: {
1225
+ /** Optional version to delete. If specified, deletes only this specific version */
1226
+ version?: number;
1227
+ /** Optional label to filter deletion. If specified, deletes all prompt versions with this label */
1228
+ label?: string;
1229
+ }): Promise<void>;
1197
1230
  /**
1198
1231
  * Retrieves a text prompt by name.
1199
1232
  *
package/dist/index.d.ts CHANGED
@@ -1194,6 +1194,39 @@ declare class PromptManager {
1194
1194
  version: number;
1195
1195
  newLabels: string[];
1196
1196
  }): Promise<Prompt>;
1197
+ /**
1198
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
1199
+ *
1200
+ * The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
1201
+ *
1202
+ * @param name - Name of the prompt to delete
1203
+ * @param options - Optional deletion configuration
1204
+ * @param options.version - Optional version to delete. If specified, deletes only this specific version
1205
+ * @param options.label - Optional label to filter deletion. If specified, deletes all prompt versions with this label
1206
+ *
1207
+ * @returns Promise that resolves when deletion is complete
1208
+ *
1209
+ * @throws {LangfuseAPI.NotFoundError} If the prompt does not exist
1210
+ * @throws {LangfuseAPI.Error} If the API request fails
1211
+ *
1212
+ * @example
1213
+ * ```typescript
1214
+ * // Delete all versions of a prompt
1215
+ * await langfuse.prompt.delete("my-prompt");
1216
+ *
1217
+ * // Delete specific version
1218
+ * await langfuse.prompt.delete("my-prompt", { version: 2 });
1219
+ *
1220
+ * // Delete all versions with a specific label
1221
+ * await langfuse.prompt.delete("my-prompt", { label: "staging" });
1222
+ * ```
1223
+ */
1224
+ delete(name: string, options?: {
1225
+ /** Optional version to delete. If specified, deletes only this specific version */
1226
+ version?: number;
1227
+ /** Optional label to filter deletion. If specified, deletes all prompt versions with this label */
1228
+ label?: string;
1229
+ }): Promise<void>;
1197
1230
  /**
1198
1231
  * Retrieves a text prompt by name.
1199
1232
  *
package/dist/index.mjs CHANGED
@@ -473,7 +473,8 @@ var ExperimentManager = class {
473
473
  const params2 = {
474
474
  input: item.input,
475
475
  expectedOutput: item.expectedOutput,
476
- output
476
+ output,
477
+ metadata: item.metadata
477
478
  };
478
479
  return evaluator(params2).then((result) => {
479
480
  return Array.isArray(result) ? result : [result];
@@ -1394,6 +1395,40 @@ var PromptManager = class {
1394
1395
  this.cache.invalidate(name);
1395
1396
  return newPrompt;
1396
1397
  }
1398
+ /**
1399
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
1400
+ *
1401
+ * The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
1402
+ *
1403
+ * @param name - Name of the prompt to delete
1404
+ * @param options - Optional deletion configuration
1405
+ * @param options.version - Optional version to delete. If specified, deletes only this specific version
1406
+ * @param options.label - Optional label to filter deletion. If specified, deletes all prompt versions with this label
1407
+ *
1408
+ * @returns Promise that resolves when deletion is complete
1409
+ *
1410
+ * @throws {LangfuseAPI.NotFoundError} If the prompt does not exist
1411
+ * @throws {LangfuseAPI.Error} If the API request fails
1412
+ *
1413
+ * @example
1414
+ * ```typescript
1415
+ * // Delete all versions of a prompt
1416
+ * await langfuse.prompt.delete("my-prompt");
1417
+ *
1418
+ * // Delete specific version
1419
+ * await langfuse.prompt.delete("my-prompt", { version: 2 });
1420
+ *
1421
+ * // Delete all versions with a specific label
1422
+ * await langfuse.prompt.delete("my-prompt", { label: "staging" });
1423
+ * ```
1424
+ */
1425
+ async delete(name, options) {
1426
+ await this.apiClient.prompts.delete(name, {
1427
+ version: options == null ? void 0 : options.version,
1428
+ label: options == null ? void 0 : options.label
1429
+ });
1430
+ this.cache.invalidate(name);
1431
+ }
1397
1432
  /**
1398
1433
  * Retrieves a prompt by name with intelligent caching.
1399
1434
  *