langsmith 0.8.1 → 0.8.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/_openapi_client/client.d.ts +2 -2
- package/dist/_openapi_client/resources/index.d.ts +1 -1
- package/dist/_openapi_client/resources/online-evaluators.d.ts +5 -0
- package/dist/_openapi_client/resources/runs.d.ts +5 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +1 -2
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +107 -6
- package/dist/_openapi_client/resources/sandboxes/boxes.js +1 -2
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +99 -4
- package/dist/_openapi_client/resources/threads.cjs +9 -6
- package/dist/_openapi_client/resources/threads.d.ts +216 -190
- package/dist/_openapi_client/resources/threads.js +9 -6
- package/dist/client.cjs +63 -8
- package/dist/client.d.ts +19 -3
- package/dist/client.js +63 -8
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas.d.ts +15 -0
- package/dist/utils/constants.cjs +1 -1
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +1 -1
- package/package.json +4 -2
package/dist/client.cjs
CHANGED
|
@@ -238,6 +238,7 @@ class AutoBatchQueue {
|
|
|
238
238
|
otelContext: item.otelContext,
|
|
239
239
|
apiKey: item.apiKey,
|
|
240
240
|
apiUrl: item.apiUrl,
|
|
241
|
+
workspaceId: item.workspaceId,
|
|
241
242
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
242
243
|
itemPromiseResolve: itemPromiseResolve,
|
|
243
244
|
itemPromise,
|
|
@@ -278,6 +279,7 @@ class AutoBatchQueue {
|
|
|
278
279
|
otelContext: it.otelContext,
|
|
279
280
|
apiKey: it.apiKey,
|
|
280
281
|
apiUrl: it.apiUrl,
|
|
282
|
+
workspaceId: it.workspaceId,
|
|
281
283
|
size: it.size,
|
|
282
284
|
})),
|
|
283
285
|
() => popped.forEach((it) => it.itemPromiseResolve()),
|
|
@@ -1256,8 +1258,13 @@ class Client {
|
|
|
1256
1258
|
const batchesByDestination = batch.reduce((acc, item) => {
|
|
1257
1259
|
const apiUrl = item.apiUrl ?? this.apiUrl;
|
|
1258
1260
|
const apiKey = item.apiKey ?? this.apiKey;
|
|
1259
|
-
const
|
|
1260
|
-
const
|
|
1261
|
+
const workspaceId = item.workspaceId ?? this.workspaceId;
|
|
1262
|
+
const isDefault = item.apiKey === this.apiKey &&
|
|
1263
|
+
item.apiUrl === this.apiUrl &&
|
|
1264
|
+
item.workspaceId === this.workspaceId;
|
|
1265
|
+
const batchKey = isDefault
|
|
1266
|
+
? "default"
|
|
1267
|
+
: `${apiUrl}|${apiKey}|${workspaceId ?? ""}`;
|
|
1261
1268
|
if (!acc[batchKey]) {
|
|
1262
1269
|
acc[batchKey] = [];
|
|
1263
1270
|
}
|
|
@@ -1266,9 +1273,13 @@ class Client {
|
|
|
1266
1273
|
}, {});
|
|
1267
1274
|
const batchPromises = [];
|
|
1268
1275
|
for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
|
|
1276
|
+
const isDefault = batchKey === "default";
|
|
1277
|
+
const parts = isDefault ? [] : batchKey.split("|");
|
|
1278
|
+
const workspaceIdPart = parts[2];
|
|
1269
1279
|
const batchPromise = this._processBatch(batch, {
|
|
1270
|
-
apiUrl:
|
|
1271
|
-
apiKey:
|
|
1280
|
+
apiUrl: isDefault ? undefined : parts[0],
|
|
1281
|
+
apiKey: isDefault ? undefined : parts[1],
|
|
1282
|
+
workspaceId: isDefault || !workspaceIdPart ? undefined : workspaceIdPart,
|
|
1272
1283
|
});
|
|
1273
1284
|
batchPromises.push(batchPromise);
|
|
1274
1285
|
}
|
|
@@ -1548,6 +1559,7 @@ class Client {
|
|
|
1548
1559
|
otelContext,
|
|
1549
1560
|
apiKey: options?.apiKey,
|
|
1550
1561
|
apiUrl: options?.apiUrl,
|
|
1562
|
+
workspaceId: options?.workspaceId,
|
|
1551
1563
|
}).catch(console.error);
|
|
1552
1564
|
return;
|
|
1553
1565
|
}
|
|
@@ -1642,6 +1654,9 @@ class Client {
|
|
|
1642
1654
|
if (options?.apiKey !== undefined) {
|
|
1643
1655
|
headers["x-api-key"] = options.apiKey;
|
|
1644
1656
|
}
|
|
1657
|
+
if (options?.workspaceId !== undefined) {
|
|
1658
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1659
|
+
}
|
|
1645
1660
|
await this.batchIngestCaller.callWithOptions({ sizeBytes: options?.sizeBytes }, async () => {
|
|
1646
1661
|
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
|
|
1647
1662
|
method: "POST",
|
|
@@ -1865,6 +1880,9 @@ class Client {
|
|
|
1865
1880
|
if (options?.apiKey !== undefined) {
|
|
1866
1881
|
headers["x-api-key"] = options.apiKey;
|
|
1867
1882
|
}
|
|
1883
|
+
if (options?.workspaceId !== undefined) {
|
|
1884
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1885
|
+
}
|
|
1868
1886
|
let transformedBody = body;
|
|
1869
1887
|
if (options?.useGzip &&
|
|
1870
1888
|
typeof body === "object" &&
|
|
@@ -1967,6 +1985,7 @@ class Client {
|
|
|
1967
1985
|
otelContext,
|
|
1968
1986
|
apiKey: options?.apiKey,
|
|
1969
1987
|
apiUrl: options?.apiUrl,
|
|
1988
|
+
workspaceId: options?.workspaceId,
|
|
1970
1989
|
}).catch(console.error);
|
|
1971
1990
|
return;
|
|
1972
1991
|
}
|
|
@@ -1977,6 +1996,7 @@ class Client {
|
|
|
1977
1996
|
otelContext,
|
|
1978
1997
|
apiKey: options?.apiKey,
|
|
1979
1998
|
apiUrl: options?.apiUrl,
|
|
1999
|
+
workspaceId: options?.workspaceId,
|
|
1980
2000
|
}).catch(console.error);
|
|
1981
2001
|
}
|
|
1982
2002
|
return;
|
|
@@ -4085,13 +4105,48 @@ class Client {
|
|
|
4085
4105
|
}
|
|
4086
4106
|
/**
|
|
4087
4107
|
* Add runs to an annotation queue with the specified queue ID.
|
|
4108
|
+
*
|
|
4109
|
+
* The second argument is either:
|
|
4110
|
+
* - `RunKey[]` (preferred): each entry carries the run's full lookup key, so
|
|
4111
|
+
* it can be located directly without a scan. Required for workspaces served
|
|
4112
|
+
* by SmithDB; routes to `POST /runs/by-key`.
|
|
4113
|
+
* - `string[]`: a plain list of run IDs. This path will be deprecated in a
|
|
4114
|
+
* future release; prefer the key form. Routes to `POST /runs`.
|
|
4115
|
+
*
|
|
4116
|
+
* If every element is a string (or the list is empty) it is treated as run
|
|
4117
|
+
* IDs; otherwise the list is treated as `RunKey` objects.
|
|
4118
|
+
*
|
|
4088
4119
|
* @param queueId - The ID of the annotation queue
|
|
4089
|
-
* @param
|
|
4120
|
+
* @param runs - Either a list of run IDs (deprecated) or a list of run keys.
|
|
4090
4121
|
*/
|
|
4091
|
-
async addRunsToAnnotationQueue(queueId,
|
|
4092
|
-
const
|
|
4122
|
+
async addRunsToAnnotationQueue(queueId, runs) {
|
|
4123
|
+
const base = `${this.apiUrl}/annotation-queues/${(0, _uuid_js_1.assertUuid)(queueId, "queueId")}/runs`;
|
|
4124
|
+
// All strings (including empty) -> legacy /runs; otherwise treat as run keys.
|
|
4125
|
+
const allStrings = runs.every((r) => typeof r === "string");
|
|
4126
|
+
let url;
|
|
4127
|
+
let body;
|
|
4128
|
+
if (!allStrings) {
|
|
4129
|
+
url = `${base}/by-key`;
|
|
4130
|
+
body = JSON.stringify(runs.map((run, i) => {
|
|
4131
|
+
const serialized = {
|
|
4132
|
+
run_id: (0, _uuid_js_1.assertUuid)(run.runId, `runs[${i}].runId`).toString(),
|
|
4133
|
+
session_id: (0, _uuid_js_1.assertUuid)(run.sessionId, `runs[${i}].sessionId`).toString(),
|
|
4134
|
+
start_time: typeof run.startTime === "string"
|
|
4135
|
+
? run.startTime
|
|
4136
|
+
: new Date(run.startTime).toISOString(),
|
|
4137
|
+
};
|
|
4138
|
+
if (run.sourceProposedExampleId != null) {
|
|
4139
|
+
serialized.source_proposed_example_id = (0, _uuid_js_1.assertUuid)(run.sourceProposedExampleId, `runs[${i}].sourceProposedExampleId`).toString();
|
|
4140
|
+
}
|
|
4141
|
+
return serialized;
|
|
4142
|
+
}));
|
|
4143
|
+
}
|
|
4144
|
+
else {
|
|
4145
|
+
url = base;
|
|
4146
|
+
body = JSON.stringify(runs.map((id, i) => (0, _uuid_js_1.assertUuid)(id, `runs[${i}]`).toString()));
|
|
4147
|
+
}
|
|
4093
4148
|
await this.caller.call(async () => {
|
|
4094
|
-
const res = await this._fetch(
|
|
4149
|
+
const res = await this._fetch(url, {
|
|
4095
4150
|
method: "POST",
|
|
4096
4151
|
headers: {
|
|
4097
4152
|
...this._mergedHeaders,
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { OTELContext } from "./experimental/otel/types.js";
|
|
2
2
|
import { AsyncCallerParams } from "./utils/async_caller.js";
|
|
3
|
-
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails, AnnotationQueueRubricItem, FeedbackConfigSchema, AgentContext, SkillContext, Entry } from "./schemas.js";
|
|
3
|
+
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails, AnnotationQueueRubricItem, RunKey, FeedbackConfigSchema, AgentContext, SkillContext, Entry } from "./schemas.js";
|
|
4
4
|
import { type TracingMode } from "./utils/env.js";
|
|
5
5
|
import { EvaluationResult, EvaluationResults } from "./evaluation/evaluator.js";
|
|
6
6
|
import { OnlineEvaluators as Evaluators } from "./_openapi_client/resources/online-evaluators.js";
|
|
@@ -373,6 +373,7 @@ type AutoBatchQueueItem = {
|
|
|
373
373
|
otelContext?: OTELContext;
|
|
374
374
|
apiKey?: string;
|
|
375
375
|
apiUrl?: string;
|
|
376
|
+
workspaceId?: string;
|
|
376
377
|
size?: number;
|
|
377
378
|
};
|
|
378
379
|
type Thread = {
|
|
@@ -409,6 +410,7 @@ export declare class AutoBatchQueue {
|
|
|
409
410
|
size: number;
|
|
410
411
|
apiKey?: string;
|
|
411
412
|
apiUrl?: string;
|
|
413
|
+
workspaceId?: string;
|
|
412
414
|
}[];
|
|
413
415
|
sizeBytes: number;
|
|
414
416
|
private maxSizeBytes;
|
|
@@ -422,6 +424,7 @@ export declare class AutoBatchQueue {
|
|
|
422
424
|
size: number;
|
|
423
425
|
apiKey?: string;
|
|
424
426
|
apiUrl?: string;
|
|
427
|
+
workspaceId?: string;
|
|
425
428
|
};
|
|
426
429
|
push(item: AutoBatchQueueItem): Promise<void>;
|
|
427
430
|
pop({ upToSizeBytes, upToSize, }: {
|
|
@@ -599,6 +602,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
599
602
|
}, options?: {
|
|
600
603
|
apiKey?: string;
|
|
601
604
|
apiUrl?: string;
|
|
605
|
+
workspaceId?: string;
|
|
602
606
|
sizeBytes?: number;
|
|
603
607
|
}): Promise<void>;
|
|
604
608
|
private _postBatchIngestRuns;
|
|
@@ -612,6 +616,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
612
616
|
}, options?: {
|
|
613
617
|
apiKey?: string;
|
|
614
618
|
apiUrl?: string;
|
|
619
|
+
workspaceId?: string;
|
|
615
620
|
useGzip?: boolean;
|
|
616
621
|
sizeBytes?: number;
|
|
617
622
|
}): Promise<void>;
|
|
@@ -1135,10 +1140,21 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
1135
1140
|
deleteAnnotationQueue(queueId: string): Promise<void>;
|
|
1136
1141
|
/**
|
|
1137
1142
|
* Add runs to an annotation queue with the specified queue ID.
|
|
1143
|
+
*
|
|
1144
|
+
* The second argument is either:
|
|
1145
|
+
* - `RunKey[]` (preferred): each entry carries the run's full lookup key, so
|
|
1146
|
+
* it can be located directly without a scan. Required for workspaces served
|
|
1147
|
+
* by SmithDB; routes to `POST /runs/by-key`.
|
|
1148
|
+
* - `string[]`: a plain list of run IDs. This path will be deprecated in a
|
|
1149
|
+
* future release; prefer the key form. Routes to `POST /runs`.
|
|
1150
|
+
*
|
|
1151
|
+
* If every element is a string (or the list is empty) it is treated as run
|
|
1152
|
+
* IDs; otherwise the list is treated as `RunKey` objects.
|
|
1153
|
+
*
|
|
1138
1154
|
* @param queueId - The ID of the annotation queue
|
|
1139
|
-
* @param
|
|
1155
|
+
* @param runs - Either a list of run IDs (deprecated) or a list of run keys.
|
|
1140
1156
|
*/
|
|
1141
|
-
addRunsToAnnotationQueue(queueId: string,
|
|
1157
|
+
addRunsToAnnotationQueue(queueId: string, runs: string[] | RunKey[]): Promise<void>;
|
|
1142
1158
|
/**
|
|
1143
1159
|
* Get a run from an annotation queue at the specified index.
|
|
1144
1160
|
* @param queueId - The ID of the annotation queue
|
package/dist/client.js
CHANGED
|
@@ -200,6 +200,7 @@ export class AutoBatchQueue {
|
|
|
200
200
|
otelContext: item.otelContext,
|
|
201
201
|
apiKey: item.apiKey,
|
|
202
202
|
apiUrl: item.apiUrl,
|
|
203
|
+
workspaceId: item.workspaceId,
|
|
203
204
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
204
205
|
itemPromiseResolve: itemPromiseResolve,
|
|
205
206
|
itemPromise,
|
|
@@ -240,6 +241,7 @@ export class AutoBatchQueue {
|
|
|
240
241
|
otelContext: it.otelContext,
|
|
241
242
|
apiKey: it.apiKey,
|
|
242
243
|
apiUrl: it.apiUrl,
|
|
244
|
+
workspaceId: it.workspaceId,
|
|
243
245
|
size: it.size,
|
|
244
246
|
})),
|
|
245
247
|
() => popped.forEach((it) => it.itemPromiseResolve()),
|
|
@@ -1217,8 +1219,13 @@ export class Client {
|
|
|
1217
1219
|
const batchesByDestination = batch.reduce((acc, item) => {
|
|
1218
1220
|
const apiUrl = item.apiUrl ?? this.apiUrl;
|
|
1219
1221
|
const apiKey = item.apiKey ?? this.apiKey;
|
|
1220
|
-
const
|
|
1221
|
-
const
|
|
1222
|
+
const workspaceId = item.workspaceId ?? this.workspaceId;
|
|
1223
|
+
const isDefault = item.apiKey === this.apiKey &&
|
|
1224
|
+
item.apiUrl === this.apiUrl &&
|
|
1225
|
+
item.workspaceId === this.workspaceId;
|
|
1226
|
+
const batchKey = isDefault
|
|
1227
|
+
? "default"
|
|
1228
|
+
: `${apiUrl}|${apiKey}|${workspaceId ?? ""}`;
|
|
1222
1229
|
if (!acc[batchKey]) {
|
|
1223
1230
|
acc[batchKey] = [];
|
|
1224
1231
|
}
|
|
@@ -1227,9 +1234,13 @@ export class Client {
|
|
|
1227
1234
|
}, {});
|
|
1228
1235
|
const batchPromises = [];
|
|
1229
1236
|
for (const [batchKey, batch] of Object.entries(batchesByDestination)) {
|
|
1237
|
+
const isDefault = batchKey === "default";
|
|
1238
|
+
const parts = isDefault ? [] : batchKey.split("|");
|
|
1239
|
+
const workspaceIdPart = parts[2];
|
|
1230
1240
|
const batchPromise = this._processBatch(batch, {
|
|
1231
|
-
apiUrl:
|
|
1232
|
-
apiKey:
|
|
1241
|
+
apiUrl: isDefault ? undefined : parts[0],
|
|
1242
|
+
apiKey: isDefault ? undefined : parts[1],
|
|
1243
|
+
workspaceId: isDefault || !workspaceIdPart ? undefined : workspaceIdPart,
|
|
1233
1244
|
});
|
|
1234
1245
|
batchPromises.push(batchPromise);
|
|
1235
1246
|
}
|
|
@@ -1509,6 +1520,7 @@ export class Client {
|
|
|
1509
1520
|
otelContext,
|
|
1510
1521
|
apiKey: options?.apiKey,
|
|
1511
1522
|
apiUrl: options?.apiUrl,
|
|
1523
|
+
workspaceId: options?.workspaceId,
|
|
1512
1524
|
}).catch(console.error);
|
|
1513
1525
|
return;
|
|
1514
1526
|
}
|
|
@@ -1603,6 +1615,9 @@ export class Client {
|
|
|
1603
1615
|
if (options?.apiKey !== undefined) {
|
|
1604
1616
|
headers["x-api-key"] = options.apiKey;
|
|
1605
1617
|
}
|
|
1618
|
+
if (options?.workspaceId !== undefined) {
|
|
1619
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1620
|
+
}
|
|
1606
1621
|
await this.batchIngestCaller.callWithOptions({ sizeBytes: options?.sizeBytes }, async () => {
|
|
1607
1622
|
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/batch`, {
|
|
1608
1623
|
method: "POST",
|
|
@@ -1826,6 +1841,9 @@ export class Client {
|
|
|
1826
1841
|
if (options?.apiKey !== undefined) {
|
|
1827
1842
|
headers["x-api-key"] = options.apiKey;
|
|
1828
1843
|
}
|
|
1844
|
+
if (options?.workspaceId !== undefined) {
|
|
1845
|
+
headers["x-tenant-id"] = options.workspaceId;
|
|
1846
|
+
}
|
|
1829
1847
|
let transformedBody = body;
|
|
1830
1848
|
if (options?.useGzip &&
|
|
1831
1849
|
typeof body === "object" &&
|
|
@@ -1928,6 +1946,7 @@ export class Client {
|
|
|
1928
1946
|
otelContext,
|
|
1929
1947
|
apiKey: options?.apiKey,
|
|
1930
1948
|
apiUrl: options?.apiUrl,
|
|
1949
|
+
workspaceId: options?.workspaceId,
|
|
1931
1950
|
}).catch(console.error);
|
|
1932
1951
|
return;
|
|
1933
1952
|
}
|
|
@@ -1938,6 +1957,7 @@ export class Client {
|
|
|
1938
1957
|
otelContext,
|
|
1939
1958
|
apiKey: options?.apiKey,
|
|
1940
1959
|
apiUrl: options?.apiUrl,
|
|
1960
|
+
workspaceId: options?.workspaceId,
|
|
1941
1961
|
}).catch(console.error);
|
|
1942
1962
|
}
|
|
1943
1963
|
return;
|
|
@@ -4046,13 +4066,48 @@ export class Client {
|
|
|
4046
4066
|
}
|
|
4047
4067
|
/**
|
|
4048
4068
|
* Add runs to an annotation queue with the specified queue ID.
|
|
4069
|
+
*
|
|
4070
|
+
* The second argument is either:
|
|
4071
|
+
* - `RunKey[]` (preferred): each entry carries the run's full lookup key, so
|
|
4072
|
+
* it can be located directly without a scan. Required for workspaces served
|
|
4073
|
+
* by SmithDB; routes to `POST /runs/by-key`.
|
|
4074
|
+
* - `string[]`: a plain list of run IDs. This path will be deprecated in a
|
|
4075
|
+
* future release; prefer the key form. Routes to `POST /runs`.
|
|
4076
|
+
*
|
|
4077
|
+
* If every element is a string (or the list is empty) it is treated as run
|
|
4078
|
+
* IDs; otherwise the list is treated as `RunKey` objects.
|
|
4079
|
+
*
|
|
4049
4080
|
* @param queueId - The ID of the annotation queue
|
|
4050
|
-
* @param
|
|
4081
|
+
* @param runs - Either a list of run IDs (deprecated) or a list of run keys.
|
|
4051
4082
|
*/
|
|
4052
|
-
async addRunsToAnnotationQueue(queueId,
|
|
4053
|
-
const
|
|
4083
|
+
async addRunsToAnnotationQueue(queueId, runs) {
|
|
4084
|
+
const base = `${this.apiUrl}/annotation-queues/${assertUuid(queueId, "queueId")}/runs`;
|
|
4085
|
+
// All strings (including empty) -> legacy /runs; otherwise treat as run keys.
|
|
4086
|
+
const allStrings = runs.every((r) => typeof r === "string");
|
|
4087
|
+
let url;
|
|
4088
|
+
let body;
|
|
4089
|
+
if (!allStrings) {
|
|
4090
|
+
url = `${base}/by-key`;
|
|
4091
|
+
body = JSON.stringify(runs.map((run, i) => {
|
|
4092
|
+
const serialized = {
|
|
4093
|
+
run_id: assertUuid(run.runId, `runs[${i}].runId`).toString(),
|
|
4094
|
+
session_id: assertUuid(run.sessionId, `runs[${i}].sessionId`).toString(),
|
|
4095
|
+
start_time: typeof run.startTime === "string"
|
|
4096
|
+
? run.startTime
|
|
4097
|
+
: new Date(run.startTime).toISOString(),
|
|
4098
|
+
};
|
|
4099
|
+
if (run.sourceProposedExampleId != null) {
|
|
4100
|
+
serialized.source_proposed_example_id = assertUuid(run.sourceProposedExampleId, `runs[${i}].sourceProposedExampleId`).toString();
|
|
4101
|
+
}
|
|
4102
|
+
return serialized;
|
|
4103
|
+
}));
|
|
4104
|
+
}
|
|
4105
|
+
else {
|
|
4106
|
+
url = base;
|
|
4107
|
+
body = JSON.stringify(runs.map((id, i) => assertUuid(id, `runs[${i}]`).toString()));
|
|
4108
|
+
}
|
|
4054
4109
|
await this.caller.call(async () => {
|
|
4055
|
-
const res = await this._fetch(
|
|
4110
|
+
const res = await this._fetch(url, {
|
|
4056
4111
|
method: "POST",
|
|
4057
4112
|
headers: {
|
|
4058
4113
|
...this._mergedHeaders,
|
package/dist/index.cjs
CHANGED
|
@@ -34,6 +34,6 @@ Object.defineProperty(exports, "UnprocessableEntityError", { enumerable: true, g
|
|
|
34
34
|
Object.defineProperty(exports, "RateLimitError", { enumerable: true, get: function () { return error_js_1.RateLimitError; } });
|
|
35
35
|
Object.defineProperty(exports, "InternalServerError", { enumerable: true, get: function () { return error_js_1.InternalServerError; } });
|
|
36
36
|
// Update using pnpm bump-version
|
|
37
|
-
exports.__version__ = "0.8.
|
|
37
|
+
exports.__version__ = "0.8.3";
|
|
38
38
|
// Metadata key to hide a traced run from LangSmith's Messages View.
|
|
39
39
|
exports.LS_MESSAGE_VIEW_EXCLUDE = "ls_message_view_exclude";
|
package/dist/index.d.ts
CHANGED
|
@@ -7,5 +7,5 @@ export { uuid7, uuid7FromTime } from "./uuid.js";
|
|
|
7
7
|
export { isTracingEnabled } from "./utils/guard.js";
|
|
8
8
|
export { Cache, PromptCache, type CacheConfig, type CacheMetrics, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
|
|
9
9
|
export { LangsmithError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, } from "./_openapi_client/core/error.js";
|
|
10
|
-
export declare const __version__ = "0.8.
|
|
10
|
+
export declare const __version__ = "0.8.3";
|
|
11
11
|
export declare const LS_MESSAGE_VIEW_EXCLUDE: "ls_message_view_exclude";
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,6 @@ export { isTracingEnabled } from "./utils/guard.js";
|
|
|
7
7
|
export { Cache, PromptCache, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
|
|
8
8
|
export { LangsmithError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, } from "./_openapi_client/core/error.js";
|
|
9
9
|
// Update using pnpm bump-version
|
|
10
|
-
export const __version__ = "0.8.
|
|
10
|
+
export const __version__ = "0.8.3";
|
|
11
11
|
// Metadata key to hide a traced run from LangSmith's Messages View.
|
|
12
12
|
export const LS_MESSAGE_VIEW_EXCLUDE = "ls_message_view_exclude";
|
package/dist/schemas.d.ts
CHANGED
|
@@ -531,6 +531,21 @@ export interface AnnotationQueueWithDetails extends AnnotationQueue {
|
|
|
531
531
|
/** The rubric items for the annotation queue. */
|
|
532
532
|
rubric_items?: AnnotationQueueRubricItem[];
|
|
533
533
|
}
|
|
534
|
+
/**
|
|
535
|
+
* A run identified by its full lookup key, for adding to an annotation queue.
|
|
536
|
+
* Unlike a bare run ID, this carries the partition key (`sessionId` and
|
|
537
|
+
* `startTime`) so the run can be located directly, without a scan.
|
|
538
|
+
*/
|
|
539
|
+
export interface RunKey {
|
|
540
|
+
/** The ID of the run to add to the queue. */
|
|
541
|
+
runId: string;
|
|
542
|
+
/** The ID of the project/session the run belongs to (partition key). */
|
|
543
|
+
sessionId: string;
|
|
544
|
+
/** The start time of the run (partition key): a Date, epoch ms, or ISO string. */
|
|
545
|
+
startTime: string | number | Date;
|
|
546
|
+
/** Optional back-pointer to the issues-agent proposed example that seeded this queue item. */
|
|
547
|
+
sourceProposedExampleId?: string;
|
|
548
|
+
}
|
|
534
549
|
export interface FeedbackConfigSchema {
|
|
535
550
|
/** The unique key identifying this feedback configuration. */
|
|
536
551
|
feedback_key: string;
|
package/dist/utils/constants.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const _MIN_BACKEND_VERSION = "0.16.
|
|
1
|
+
export declare const _MIN_BACKEND_VERSION = "0.16.13rc1";
|
package/dist/utils/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const _MIN_BACKEND_VERSION = "0.16.
|
|
1
|
+
export const _MIN_BACKEND_VERSION = "0.16.13rc1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "langsmith",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Client library to connect to the LangSmith Observability and Evaluation Platform.",
|
|
5
5
|
"packageManager": "pnpm@10.33.0",
|
|
6
6
|
"files": [
|
|
@@ -476,7 +476,9 @@
|
|
|
476
476
|
"pnpm": {
|
|
477
477
|
"overrides": {
|
|
478
478
|
"js-yaml": "^4.1.1",
|
|
479
|
-
"vite": "^7.3.2"
|
|
479
|
+
"vite": "^7.3.2",
|
|
480
|
+
"form-data": "4.0.6",
|
|
481
|
+
"langsmith": "0.6.0"
|
|
480
482
|
}
|
|
481
483
|
},
|
|
482
484
|
"browser": {
|