@langfuse/client 4.4.10-alpha.1 → 4.4.10-alpha.3

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
@@ -1394,6 +1394,40 @@ var PromptManager = class {
1394
1394
  this.cache.invalidate(name);
1395
1395
  return newPrompt;
1396
1396
  }
1397
+ /**
1398
+ * Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
1399
+ *
1400
+ * The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
1401
+ *
1402
+ * @param name - Name of the prompt to delete
1403
+ * @param options - Optional deletion configuration
1404
+ * @param options.version - Optional version to delete. If specified, deletes only this specific version
1405
+ * @param options.label - Optional label to filter deletion. If specified, deletes all prompt versions with this label
1406
+ *
1407
+ * @returns Promise that resolves when deletion is complete
1408
+ *
1409
+ * @throws {LangfuseAPI.NotFoundError} If the prompt does not exist
1410
+ * @throws {LangfuseAPI.Error} If the API request fails
1411
+ *
1412
+ * @example
1413
+ * ```typescript
1414
+ * // Delete all versions of a prompt
1415
+ * await langfuse.prompt.delete("my-prompt");
1416
+ *
1417
+ * // Delete specific version
1418
+ * await langfuse.prompt.delete("my-prompt", { version: 2 });
1419
+ *
1420
+ * // Delete all versions with a specific label
1421
+ * await langfuse.prompt.delete("my-prompt", { label: "staging" });
1422
+ * ```
1423
+ */
1424
+ async delete(name, options) {
1425
+ await this.apiClient.prompts.delete(name, {
1426
+ version: options == null ? void 0 : options.version,
1427
+ label: options == null ? void 0 : options.label
1428
+ });
1429
+ this.cache.invalidate(name);
1430
+ }
1397
1431
  /**
1398
1432
  * Retrieves a prompt by name with intelligent caching.
1399
1433
  *