@langfuse/client 4.4.10-alpha.2 → 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.cjs +34 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.mjs +34 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1421,6 +1421,40 @@ var PromptManager = class {
|
|
|
1421
1421
|
this.cache.invalidate(name);
|
|
1422
1422
|
return newPrompt;
|
|
1423
1423
|
}
|
|
1424
|
+
/**
|
|
1425
|
+
* Delete prompt versions. If neither version nor label is specified, all versions of the prompt are deleted.
|
|
1426
|
+
*
|
|
1427
|
+
* The Langfuse SDK prompt cache is invalidated for all cached versions with the specified name.
|
|
1428
|
+
*
|
|
1429
|
+
* @param name - Name of the prompt to delete
|
|
1430
|
+
* @param options - Optional deletion configuration
|
|
1431
|
+
* @param options.version - Optional version to delete. If specified, deletes only this specific version
|
|
1432
|
+
* @param options.label - Optional label to filter deletion. If specified, deletes all prompt versions with this label
|
|
1433
|
+
*
|
|
1434
|
+
* @returns Promise that resolves when deletion is complete
|
|
1435
|
+
*
|
|
1436
|
+
* @throws {LangfuseAPI.NotFoundError} If the prompt does not exist
|
|
1437
|
+
* @throws {LangfuseAPI.Error} If the API request fails
|
|
1438
|
+
*
|
|
1439
|
+
* @example
|
|
1440
|
+
* ```typescript
|
|
1441
|
+
* // Delete all versions of a prompt
|
|
1442
|
+
* await langfuse.prompt.delete("my-prompt");
|
|
1443
|
+
*
|
|
1444
|
+
* // Delete specific version
|
|
1445
|
+
* await langfuse.prompt.delete("my-prompt", { version: 2 });
|
|
1446
|
+
*
|
|
1447
|
+
* // Delete all versions with a specific label
|
|
1448
|
+
* await langfuse.prompt.delete("my-prompt", { label: "staging" });
|
|
1449
|
+
* ```
|
|
1450
|
+
*/
|
|
1451
|
+
async delete(name, options) {
|
|
1452
|
+
await this.apiClient.prompts.delete(name, {
|
|
1453
|
+
version: options == null ? void 0 : options.version,
|
|
1454
|
+
label: options == null ? void 0 : options.label
|
|
1455
|
+
});
|
|
1456
|
+
this.cache.invalidate(name);
|
|
1457
|
+
}
|
|
1424
1458
|
/**
|
|
1425
1459
|
* Retrieves a prompt by name with intelligent caching.
|
|
1426
1460
|
*
|