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