langsmith 0.0.37 → 0.0.39
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 +6 -2
- package/dist/client.d.ts +2 -1
- package/dist/client.js +6 -2
- package/dist/schemas.d.ts +15 -0
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -239,7 +239,8 @@ class Client {
|
|
|
239
239
|
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
|
|
240
240
|
const treemap = {};
|
|
241
241
|
const runs = {};
|
|
242
|
-
|
|
242
|
+
// TODO: make dotted order required when the migration finishes
|
|
243
|
+
childRuns.sort((a, b) => (a?.dotted_order ?? "").localeCompare(b?.dotted_order ?? ""));
|
|
243
244
|
for (const childRun of childRuns) {
|
|
244
245
|
if (childRun.parent_run_id === null ||
|
|
245
246
|
childRun.parent_run_id === undefined) {
|
|
@@ -347,7 +348,7 @@ class Client {
|
|
|
347
348
|
}
|
|
348
349
|
return `${this.getHostUrl()}/public/${result["share_token"]}/r`;
|
|
349
350
|
}
|
|
350
|
-
async createProject({ projectName, projectExtra, upsert, }) {
|
|
351
|
+
async createProject({ projectName, projectExtra, upsert, referenceDatasetId, }) {
|
|
351
352
|
const upsert_ = upsert ? `?upsert=true` : "";
|
|
352
353
|
const endpoint = `${this.apiUrl}/sessions${upsert_}`;
|
|
353
354
|
const body = {
|
|
@@ -356,6 +357,9 @@ class Client {
|
|
|
356
357
|
if (projectExtra !== undefined) {
|
|
357
358
|
body["extra"] = projectExtra;
|
|
358
359
|
}
|
|
360
|
+
if (referenceDatasetId !== undefined) {
|
|
361
|
+
body["reference_dataset_id"] = referenceDatasetId;
|
|
362
|
+
}
|
|
359
363
|
const response = await this.caller.call(fetch, endpoint, {
|
|
360
364
|
method: "POST",
|
|
361
365
|
headers: { ...this.headers, "Content-Type": "application/json" },
|
package/dist/client.d.ts
CHANGED
|
@@ -85,10 +85,11 @@ export declare class Client {
|
|
|
85
85
|
}): Promise<string>;
|
|
86
86
|
unshareRun(runId: string): Promise<void>;
|
|
87
87
|
readRunSharedLink(runId: string): Promise<string | undefined>;
|
|
88
|
-
createProject({ projectName, projectExtra, upsert, }: {
|
|
88
|
+
createProject({ projectName, projectExtra, upsert, referenceDatasetId, }: {
|
|
89
89
|
projectName: string;
|
|
90
90
|
projectExtra?: object;
|
|
91
91
|
upsert?: boolean;
|
|
92
|
+
referenceDatasetId?: string;
|
|
92
93
|
}): Promise<TracerSession>;
|
|
93
94
|
readProject({ projectId, projectName, }: {
|
|
94
95
|
projectId?: string;
|
package/dist/client.js
CHANGED
|
@@ -213,7 +213,8 @@ export class Client {
|
|
|
213
213
|
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
|
|
214
214
|
const treemap = {};
|
|
215
215
|
const runs = {};
|
|
216
|
-
|
|
216
|
+
// TODO: make dotted order required when the migration finishes
|
|
217
|
+
childRuns.sort((a, b) => (a?.dotted_order ?? "").localeCompare(b?.dotted_order ?? ""));
|
|
217
218
|
for (const childRun of childRuns) {
|
|
218
219
|
if (childRun.parent_run_id === null ||
|
|
219
220
|
childRun.parent_run_id === undefined) {
|
|
@@ -321,7 +322,7 @@ export class Client {
|
|
|
321
322
|
}
|
|
322
323
|
return `${this.getHostUrl()}/public/${result["share_token"]}/r`;
|
|
323
324
|
}
|
|
324
|
-
async createProject({ projectName, projectExtra, upsert, }) {
|
|
325
|
+
async createProject({ projectName, projectExtra, upsert, referenceDatasetId, }) {
|
|
325
326
|
const upsert_ = upsert ? `?upsert=true` : "";
|
|
326
327
|
const endpoint = `${this.apiUrl}/sessions${upsert_}`;
|
|
327
328
|
const body = {
|
|
@@ -330,6 +331,9 @@ export class Client {
|
|
|
330
331
|
if (projectExtra !== undefined) {
|
|
331
332
|
body["extra"] = projectExtra;
|
|
332
333
|
}
|
|
334
|
+
if (referenceDatasetId !== undefined) {
|
|
335
|
+
body["reference_dataset_id"] = referenceDatasetId;
|
|
336
|
+
}
|
|
333
337
|
const response = await this.caller.call(fetch, endpoint, {
|
|
334
338
|
method: "POST",
|
|
335
339
|
headers: { ...this.headers, "Content-Type": "application/json" },
|
package/dist/schemas.d.ts
CHANGED
|
@@ -95,6 +95,21 @@ export interface Run extends BaseRun {
|
|
|
95
95
|
first_token_time?: number;
|
|
96
96
|
/** IDs of parent runs, if multiple exist. */
|
|
97
97
|
parent_run_ids?: string[];
|
|
98
|
+
/**Unique ID assigned to every run within this nested trace.**/
|
|
99
|
+
trace_id?: string;
|
|
100
|
+
/**
|
|
101
|
+
* The dotted order for the run.
|
|
102
|
+
*
|
|
103
|
+
* This is a string composed of {time}{run-uuid}.* so that a trace can be
|
|
104
|
+
* sorted in the order it was executed.
|
|
105
|
+
*
|
|
106
|
+
* Example:
|
|
107
|
+
* - Parent: 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8
|
|
108
|
+
* - Children:
|
|
109
|
+
* - 20230914T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155649Z809ed3a2-0172-4f4d-8a02-a64e9b7a0f8a
|
|
110
|
+
* - 20230915T223155647Z1b64098b-4ab7-43f6-afee-992304f198d8.20230914T223155650Zc8d9f4c5-6c5a-4b2d-9b1c-3d9d7a7c5c7c
|
|
111
|
+
*/
|
|
112
|
+
dotted_order?: string;
|
|
98
113
|
}
|
|
99
114
|
export interface RunCreate extends BaseRun {
|
|
100
115
|
child_runs?: this[];
|