langsmith 0.1.33 → 0.1.34
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/anonymizer/index.cjs +2 -7
- package/dist/anonymizer/index.d.ts +0 -1
- package/dist/anonymizer/index.js +2 -7
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -37,19 +37,14 @@ function extractStringNodes(data, options) {
|
|
|
37
37
|
return result;
|
|
38
38
|
}
|
|
39
39
|
function deepClone(data) {
|
|
40
|
-
if ("structuredClone" in globalThis) {
|
|
41
|
-
return globalThis.structuredClone(data);
|
|
42
|
-
}
|
|
43
40
|
return JSON.parse(JSON.stringify(data));
|
|
44
41
|
}
|
|
45
42
|
function createAnonymizer(replacer, options) {
|
|
46
43
|
return (data) => {
|
|
47
|
-
|
|
44
|
+
let mutateValue = deepClone(data);
|
|
45
|
+
const nodes = extractStringNodes(mutateValue, {
|
|
48
46
|
maxDepth: options?.maxDepth,
|
|
49
47
|
});
|
|
50
|
-
// by default we opt-in to mutate the value directly
|
|
51
|
-
// to improve performance
|
|
52
|
-
let mutateValue = options?.deepClone ? deepClone(data) : data;
|
|
53
48
|
const processor = Array.isArray(replacer)
|
|
54
49
|
? (() => {
|
|
55
50
|
const replacers = replacer.map(({ pattern, type, replace }) => {
|
|
@@ -13,5 +13,4 @@ export interface StringNodeRule {
|
|
|
13
13
|
export type ReplacerType = ((value: string, path?: string) => string) | StringNodeRule[] | StringNodeProcessor;
|
|
14
14
|
export declare function createAnonymizer(replacer: ReplacerType, options?: {
|
|
15
15
|
maxDepth?: number;
|
|
16
|
-
deepClone?: boolean;
|
|
17
16
|
}): <T>(data: T) => T;
|
package/dist/anonymizer/index.js
CHANGED
|
@@ -31,19 +31,14 @@ function extractStringNodes(data, options) {
|
|
|
31
31
|
return result;
|
|
32
32
|
}
|
|
33
33
|
function deepClone(data) {
|
|
34
|
-
if ("structuredClone" in globalThis) {
|
|
35
|
-
return globalThis.structuredClone(data);
|
|
36
|
-
}
|
|
37
34
|
return JSON.parse(JSON.stringify(data));
|
|
38
35
|
}
|
|
39
36
|
export function createAnonymizer(replacer, options) {
|
|
40
37
|
return (data) => {
|
|
41
|
-
|
|
38
|
+
let mutateValue = deepClone(data);
|
|
39
|
+
const nodes = extractStringNodes(mutateValue, {
|
|
42
40
|
maxDepth: options?.maxDepth,
|
|
43
41
|
});
|
|
44
|
-
// by default we opt-in to mutate the value directly
|
|
45
|
-
// to improve performance
|
|
46
|
-
let mutateValue = options?.deepClone ? deepClone(data) : data;
|
|
47
42
|
const processor = Array.isArray(replacer)
|
|
48
43
|
? (() => {
|
|
49
44
|
const replacers = replacer.map(({ pattern, type, replace }) => {
|
package/dist/index.cjs
CHANGED
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "Client", { enumerable: true, get: function () {
|
|
|
6
6
|
var run_trees_js_1 = require("./run_trees.cjs");
|
|
7
7
|
Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () { return run_trees_js_1.RunTree; } });
|
|
8
8
|
// Update using yarn bump-version
|
|
9
|
-
exports.__version__ = "0.1.
|
|
9
|
+
exports.__version__ = "0.1.34";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Client } from "./client.js";
|
|
2
2
|
export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
|
|
3
3
|
export { RunTree, type RunTreeConfig } from "./run_trees.js";
|
|
4
|
-
export declare const __version__ = "0.1.
|
|
4
|
+
export declare const __version__ = "0.1.34";
|
package/dist/index.js
CHANGED