langsmith 0.3.84 → 0.3.85
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/client.cjs +13 -3
- package/dist/client.d.ts +9 -1
- package/dist/client.js +13 -3
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -48,7 +48,10 @@ const prompts_js_1 = require("./utils/prompts.cjs");
|
|
|
48
48
|
const error_js_1 = require("./utils/error.cjs");
|
|
49
49
|
const fetch_js_1 = require("./singletons/fetch.cjs");
|
|
50
50
|
const index_js_2 = require("./utils/fast-safe-stringify/index.cjs");
|
|
51
|
-
function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
|
|
51
|
+
function mergeRuntimeEnvIntoRun(run, cachedEnvVars, omitTracedRuntimeInfo) {
|
|
52
|
+
if (omitTracedRuntimeInfo) {
|
|
53
|
+
return run;
|
|
54
|
+
}
|
|
52
55
|
const runtimeEnv = (0, env_js_1.getRuntimeEnvironment)();
|
|
53
56
|
const envVars = cachedEnvVars ?? (0, env_js_1.getLangSmithEnvVarsMetadata)();
|
|
54
57
|
const extra = run.extra ?? {};
|
|
@@ -292,6 +295,12 @@ class Client {
|
|
|
292
295
|
writable: true,
|
|
293
296
|
value: void 0
|
|
294
297
|
});
|
|
298
|
+
Object.defineProperty(this, "omitTracedRuntimeInfo", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
configurable: true,
|
|
301
|
+
writable: true,
|
|
302
|
+
value: void 0
|
|
303
|
+
});
|
|
295
304
|
Object.defineProperty(this, "tracingSampleRate", {
|
|
296
305
|
enumerable: true,
|
|
297
306
|
configurable: true,
|
|
@@ -452,6 +461,7 @@ class Client {
|
|
|
452
461
|
config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
|
|
453
462
|
this.hideOutputs =
|
|
454
463
|
config.hideOutputs ?? config.anonymizer ?? defaultConfig.hideOutputs;
|
|
464
|
+
this.omitTracedRuntimeInfo = config.omitTracedRuntimeInfo ?? false;
|
|
455
465
|
this.autoBatchTracing = config.autoBatchTracing ?? this.autoBatchTracing;
|
|
456
466
|
this.autoBatchQueue = new AutoBatchQueue(maxMemory);
|
|
457
467
|
this.blockOnRootRunFinalization =
|
|
@@ -821,7 +831,7 @@ class Client {
|
|
|
821
831
|
async processRunOperation(item) {
|
|
822
832
|
clearTimeout(this.autoBatchTimeout);
|
|
823
833
|
this.autoBatchTimeout = undefined;
|
|
824
|
-
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
|
|
834
|
+
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
|
|
825
835
|
const itemPromise = this.autoBatchQueue.push(item);
|
|
826
836
|
if (this.manualFlushMode) {
|
|
827
837
|
// Rely on manual flushing in serverless environments
|
|
@@ -943,7 +953,7 @@ class Client {
|
|
|
943
953
|
}).catch(console.error);
|
|
944
954
|
return;
|
|
945
955
|
}
|
|
946
|
-
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
|
|
956
|
+
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
|
|
947
957
|
if (options?.apiKey !== undefined) {
|
|
948
958
|
headers["x-api-key"] = options.apiKey;
|
|
949
959
|
}
|
package/dist/client.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export interface ClientConfig {
|
|
|
11
11
|
anonymizer?: (values: KVMap) => KVMap | Promise<KVMap>;
|
|
12
12
|
hideInputs?: boolean | ((inputs: KVMap) => KVMap | Promise<KVMap>);
|
|
13
13
|
hideOutputs?: boolean | ((outputs: KVMap) => KVMap | Promise<KVMap>);
|
|
14
|
+
/**
|
|
15
|
+
* Whether to omit runtime information from traced runs.
|
|
16
|
+
* If true, runtime information (SDK version, platform, etc.) and
|
|
17
|
+
* LangChain environment variable metadata will not be stored in runs.
|
|
18
|
+
* Defaults to false.
|
|
19
|
+
*/
|
|
20
|
+
omitTracedRuntimeInfo?: boolean;
|
|
14
21
|
autoBatchTracing?: boolean;
|
|
15
22
|
/** Maximum size of a batch of runs in bytes. */
|
|
16
23
|
batchSizeBytesLimit?: number;
|
|
@@ -280,7 +287,7 @@ type Thread = {
|
|
|
280
287
|
last_outputs: string;
|
|
281
288
|
last_error: string | null;
|
|
282
289
|
};
|
|
283
|
-
export declare function mergeRuntimeEnvIntoRun<T extends RunCreate | RunUpdate>(run: T, cachedEnvVars?: Record<string, string
|
|
290
|
+
export declare function mergeRuntimeEnvIntoRun<T extends RunCreate | RunUpdate>(run: T, cachedEnvVars?: Record<string, string>, omitTracedRuntimeInfo?: boolean): T;
|
|
284
291
|
export declare const DEFAULT_UNCOMPRESSED_BATCH_SIZE_LIMIT_BYTES: number;
|
|
285
292
|
/** Default maximum memory (1GB) for queue size limits. */
|
|
286
293
|
export declare const DEFAULT_MAX_SIZE_BYTES: number;
|
|
@@ -325,6 +332,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
325
332
|
private _tenantId;
|
|
326
333
|
private hideInputs?;
|
|
327
334
|
private hideOutputs?;
|
|
335
|
+
private omitTracedRuntimeInfo?;
|
|
328
336
|
private tracingSampleRate?;
|
|
329
337
|
private filteredPostUuids;
|
|
330
338
|
private autoBatchTracing;
|
package/dist/client.js
CHANGED
|
@@ -11,7 +11,10 @@ import { parsePromptIdentifier } from "./utils/prompts.js";
|
|
|
11
11
|
import { raiseForStatus } from "./utils/error.js";
|
|
12
12
|
import { _globalFetchImplementationIsNodeFetch, _getFetchImplementation, } from "./singletons/fetch.js";
|
|
13
13
|
import { serialize as serializePayloadForTracing } from "./utils/fast-safe-stringify/index.js";
|
|
14
|
-
export function mergeRuntimeEnvIntoRun(run, cachedEnvVars) {
|
|
14
|
+
export function mergeRuntimeEnvIntoRun(run, cachedEnvVars, omitTracedRuntimeInfo) {
|
|
15
|
+
if (omitTracedRuntimeInfo) {
|
|
16
|
+
return run;
|
|
17
|
+
}
|
|
15
18
|
const runtimeEnv = getRuntimeEnvironment();
|
|
16
19
|
const envVars = cachedEnvVars ?? getLangSmithEnvVarsMetadata();
|
|
17
20
|
const extra = run.extra ?? {};
|
|
@@ -254,6 +257,12 @@ export class Client {
|
|
|
254
257
|
writable: true,
|
|
255
258
|
value: void 0
|
|
256
259
|
});
|
|
260
|
+
Object.defineProperty(this, "omitTracedRuntimeInfo", {
|
|
261
|
+
enumerable: true,
|
|
262
|
+
configurable: true,
|
|
263
|
+
writable: true,
|
|
264
|
+
value: void 0
|
|
265
|
+
});
|
|
257
266
|
Object.defineProperty(this, "tracingSampleRate", {
|
|
258
267
|
enumerable: true,
|
|
259
268
|
configurable: true,
|
|
@@ -414,6 +423,7 @@ export class Client {
|
|
|
414
423
|
config.hideInputs ?? config.anonymizer ?? defaultConfig.hideInputs;
|
|
415
424
|
this.hideOutputs =
|
|
416
425
|
config.hideOutputs ?? config.anonymizer ?? defaultConfig.hideOutputs;
|
|
426
|
+
this.omitTracedRuntimeInfo = config.omitTracedRuntimeInfo ?? false;
|
|
417
427
|
this.autoBatchTracing = config.autoBatchTracing ?? this.autoBatchTracing;
|
|
418
428
|
this.autoBatchQueue = new AutoBatchQueue(maxMemory);
|
|
419
429
|
this.blockOnRootRunFinalization =
|
|
@@ -783,7 +793,7 @@ export class Client {
|
|
|
783
793
|
async processRunOperation(item) {
|
|
784
794
|
clearTimeout(this.autoBatchTimeout);
|
|
785
795
|
this.autoBatchTimeout = undefined;
|
|
786
|
-
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata);
|
|
796
|
+
item.item = mergeRuntimeEnvIntoRun(item.item, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
|
|
787
797
|
const itemPromise = this.autoBatchQueue.push(item);
|
|
788
798
|
if (this.manualFlushMode) {
|
|
789
799
|
// Rely on manual flushing in serverless environments
|
|
@@ -905,7 +915,7 @@ export class Client {
|
|
|
905
915
|
}).catch(console.error);
|
|
906
916
|
return;
|
|
907
917
|
}
|
|
908
|
-
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata);
|
|
918
|
+
const mergedRunCreateParam = mergeRuntimeEnvIntoRun(runCreate, this.cachedLSEnvVarsForMetadata, this.omitTracedRuntimeInfo);
|
|
909
919
|
if (options?.apiKey !== undefined) {
|
|
910
920
|
headers["x-api-key"] = options.apiKey;
|
|
911
921
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -13,4 +13,4 @@ var uuid_js_1 = require("./uuid.cjs");
|
|
|
13
13
|
Object.defineProperty(exports, "uuid7", { enumerable: true, get: function () { return uuid_js_1.uuid7; } });
|
|
14
14
|
Object.defineProperty(exports, "uuid7FromTime", { enumerable: true, get: function () { return uuid_js_1.uuid7FromTime; } });
|
|
15
15
|
// Update using yarn bump-version
|
|
16
|
-
exports.__version__ = "0.3.
|
|
16
|
+
exports.__version__ = "0.3.85";
|
package/dist/index.d.ts
CHANGED
|
@@ -4,4 +4,4 @@ export { RunTree, type RunTreeConfig } from "./run_trees.js";
|
|
|
4
4
|
export { overrideFetchImplementation } from "./singletons/fetch.js";
|
|
5
5
|
export { getDefaultProjectName } from "./utils/project.js";
|
|
6
6
|
export { uuid7, uuid7FromTime } from "./uuid.js";
|
|
7
|
-
export declare const __version__ = "0.3.
|
|
7
|
+
export declare const __version__ = "0.3.85";
|
package/dist/index.js
CHANGED
|
@@ -4,4 +4,4 @@ export { overrideFetchImplementation } from "./singletons/fetch.js";
|
|
|
4
4
|
export { getDefaultProjectName } from "./utils/project.js";
|
|
5
5
|
export { uuid7, uuid7FromTime } from "./uuid.js";
|
|
6
6
|
// Update using yarn bump-version
|
|
7
|
-
export const __version__ = "0.3.
|
|
7
|
+
export const __version__ = "0.3.85";
|