langsmith 0.3.80-rc.1 → 0.3.81
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 +1 -1
- package/dist/client.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/run_trees.cjs +0 -9
- package/dist/run_trees.js +1 -10
- package/dist/utils/async_caller.cjs +3 -2
- package/dist/utils/async_caller.d.ts +1 -1
- package/dist/utils/async_caller.js +3 -2
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -441,7 +441,7 @@ class Client {
|
|
|
441
441
|
// Use maxIngestMemoryBytes for both queues
|
|
442
442
|
const maxMemory = config.maxIngestMemoryBytes ?? exports.DEFAULT_MAX_SIZE_BYTES;
|
|
443
443
|
this.batchIngestCaller = new async_caller_js_1.AsyncCaller({
|
|
444
|
-
maxRetries:
|
|
444
|
+
maxRetries: 4,
|
|
445
445
|
maxConcurrency: this.traceBatchConcurrency,
|
|
446
446
|
maxQueueSizeBytes: maxMemory,
|
|
447
447
|
...(config.callerOptions ?? {}),
|
package/dist/client.js
CHANGED
|
@@ -403,7 +403,7 @@ export class Client {
|
|
|
403
403
|
// Use maxIngestMemoryBytes for both queues
|
|
404
404
|
const maxMemory = config.maxIngestMemoryBytes ?? DEFAULT_MAX_SIZE_BYTES;
|
|
405
405
|
this.batchIngestCaller = new AsyncCaller({
|
|
406
|
-
maxRetries:
|
|
406
|
+
maxRetries: 4,
|
|
407
407
|
maxConcurrency: this.traceBatchConcurrency,
|
|
408
408
|
maxQueueSizeBytes: maxMemory,
|
|
409
409
|
...(config.callerOptions ?? {}),
|
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.81";
|
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.81";
|
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.81";
|
package/dist/run_trees.cjs
CHANGED
|
@@ -293,9 +293,6 @@ class RunTree {
|
|
|
293
293
|
if (!this.id) {
|
|
294
294
|
this.id = (0, _uuid_js_1.uuid7FromTime)(this._serialized_start_time ?? this.start_time);
|
|
295
295
|
}
|
|
296
|
-
if (config.id) {
|
|
297
|
-
(0, _uuid_js_1.warnIfNotUuidV7)(config.id, "run_id");
|
|
298
|
-
}
|
|
299
296
|
if (!this.trace_id) {
|
|
300
297
|
if (this.parent_run) {
|
|
301
298
|
this.trace_id = this.parent_run.trace_id ?? this.id;
|
|
@@ -304,12 +301,6 @@ class RunTree {
|
|
|
304
301
|
this.trace_id = this.id;
|
|
305
302
|
}
|
|
306
303
|
}
|
|
307
|
-
else if (config.trace_id) {
|
|
308
|
-
(0, _uuid_js_1.warnIfNotUuidV7)(config.trace_id, "trace_id");
|
|
309
|
-
}
|
|
310
|
-
if (config.parent_run_id) {
|
|
311
|
-
(0, _uuid_js_1.warnIfNotUuidV7)(config.parent_run_id, "parent_run_id");
|
|
312
|
-
}
|
|
313
304
|
this.replicas = _ensureWriteReplicas(this.replicas);
|
|
314
305
|
// Now set the dotted order with the actual ID
|
|
315
306
|
if (!this.dotted_order) {
|
package/dist/run_trees.js
CHANGED
|
@@ -6,7 +6,7 @@ import { getEnvironmentVariable, getRuntimeEnvironment, } from "./utils/env.js";
|
|
|
6
6
|
import { getDefaultProjectName } from "./utils/project.js";
|
|
7
7
|
import { getLangSmithEnvironmentVariable } from "./utils/env.js";
|
|
8
8
|
import { warnOnce } from "./utils/warn.js";
|
|
9
|
-
import {
|
|
9
|
+
import { uuid7FromTime } from "./utils/_uuid.js";
|
|
10
10
|
function stripNonAlphanumeric(input) {
|
|
11
11
|
return input.replace(/[-:.]/g, "");
|
|
12
12
|
}
|
|
@@ -287,9 +287,6 @@ export class RunTree {
|
|
|
287
287
|
if (!this.id) {
|
|
288
288
|
this.id = uuid7FromTime(this._serialized_start_time ?? this.start_time);
|
|
289
289
|
}
|
|
290
|
-
if (config.id) {
|
|
291
|
-
warnIfNotUuidV7(config.id, "run_id");
|
|
292
|
-
}
|
|
293
290
|
if (!this.trace_id) {
|
|
294
291
|
if (this.parent_run) {
|
|
295
292
|
this.trace_id = this.parent_run.trace_id ?? this.id;
|
|
@@ -298,12 +295,6 @@ export class RunTree {
|
|
|
298
295
|
this.trace_id = this.id;
|
|
299
296
|
}
|
|
300
297
|
}
|
|
301
|
-
else if (config.trace_id) {
|
|
302
|
-
warnIfNotUuidV7(config.trace_id, "trace_id");
|
|
303
|
-
}
|
|
304
|
-
if (config.parent_run_id) {
|
|
305
|
-
warnIfNotUuidV7(config.parent_run_id, "parent_run_id");
|
|
306
|
-
}
|
|
307
298
|
this.replicas = _ensureWriteReplicas(this.replicas);
|
|
308
299
|
// Now set the dotted order with the actual ID
|
|
309
300
|
if (!this.dotted_order) {
|
|
@@ -7,6 +7,8 @@ exports.AsyncCaller = void 0;
|
|
|
7
7
|
const p_retry_1 = __importDefault(require("p-retry"));
|
|
8
8
|
const p_queue_1 = __importDefault(require("p-queue"));
|
|
9
9
|
const STATUS_RETRYABLE = [
|
|
10
|
+
408, // Request Timeout
|
|
11
|
+
425, // Too Early
|
|
10
12
|
429, // Too Many Requests
|
|
11
13
|
500, // Internal Server Error
|
|
12
14
|
502, // Bad Gateway
|
|
@@ -66,7 +68,7 @@ class AsyncCaller {
|
|
|
66
68
|
});
|
|
67
69
|
this.maxConcurrency = params.maxConcurrency ?? Infinity;
|
|
68
70
|
this.maxRetries = params.maxRetries ?? 6;
|
|
69
|
-
this.maxQueueSizeBytes = params.maxQueueSizeBytes
|
|
71
|
+
this.maxQueueSizeBytes = params.maxQueueSizeBytes;
|
|
70
72
|
if ("default" in p_queue_1.default) {
|
|
71
73
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
74
|
this.queue = new p_queue_1.default.default({
|
|
@@ -88,7 +90,6 @@ class AsyncCaller {
|
|
|
88
90
|
const sizeBytes = options.sizeBytes ?? 0;
|
|
89
91
|
// Check if adding this call would exceed the byte size limit
|
|
90
92
|
if (this.maxQueueSizeBytes !== undefined &&
|
|
91
|
-
this.maxQueueSizeBytes !== Infinity &&
|
|
92
93
|
sizeBytes > 0 &&
|
|
93
94
|
this.queueSizeBytes + sizeBytes > this.maxQueueSizeBytes) {
|
|
94
95
|
return Promise.reject(new Error(`Queue size limit (${this.maxQueueSizeBytes} bytes) exceeded. ` +
|
|
@@ -13,7 +13,7 @@ export interface AsyncCallerParams {
|
|
|
13
13
|
/**
|
|
14
14
|
* The maximum size of the queue buffer in bytes. When the queue reaches this size,
|
|
15
15
|
* new calls will be dropped instead of queued.
|
|
16
|
-
*
|
|
16
|
+
* If not specified, no limit is enforced.
|
|
17
17
|
*/
|
|
18
18
|
maxQueueSizeBytes?: number;
|
|
19
19
|
onFailedResponseHook?: ResponseCallback;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import pRetry from "p-retry";
|
|
2
2
|
import PQueueMod from "p-queue";
|
|
3
3
|
const STATUS_RETRYABLE = [
|
|
4
|
+
408, // Request Timeout
|
|
5
|
+
425, // Too Early
|
|
4
6
|
429, // Too Many Requests
|
|
5
7
|
500, // Internal Server Error
|
|
6
8
|
502, // Bad Gateway
|
|
@@ -60,7 +62,7 @@ export class AsyncCaller {
|
|
|
60
62
|
});
|
|
61
63
|
this.maxConcurrency = params.maxConcurrency ?? Infinity;
|
|
62
64
|
this.maxRetries = params.maxRetries ?? 6;
|
|
63
|
-
this.maxQueueSizeBytes = params.maxQueueSizeBytes
|
|
65
|
+
this.maxQueueSizeBytes = params.maxQueueSizeBytes;
|
|
64
66
|
if ("default" in PQueueMod) {
|
|
65
67
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
68
|
this.queue = new PQueueMod.default({
|
|
@@ -82,7 +84,6 @@ export class AsyncCaller {
|
|
|
82
84
|
const sizeBytes = options.sizeBytes ?? 0;
|
|
83
85
|
// Check if adding this call would exceed the byte size limit
|
|
84
86
|
if (this.maxQueueSizeBytes !== undefined &&
|
|
85
|
-
this.maxQueueSizeBytes !== Infinity &&
|
|
86
87
|
sizeBytes > 0 &&
|
|
87
88
|
this.queueSizeBytes + sizeBytes > this.maxQueueSizeBytes) {
|
|
88
89
|
return Promise.reject(new Error(`Queue size limit (${this.maxQueueSizeBytes} bytes) exceeded. ` +
|