langsmith 0.0.20 → 0.0.23
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 +34 -1
- package/dist/client.d.ts +11 -2
- package/dist/client.js +34 -1
- package/dist/evaluation/evaluator.d.ts +1 -1
- package/dist/evaluation/string_evaluator.d.ts +1 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -506,12 +506,23 @@ class Client {
|
|
|
506
506
|
}
|
|
507
507
|
return result;
|
|
508
508
|
}
|
|
509
|
-
async *listDatasets({ limit = 100, offset = 0, } = {}) {
|
|
509
|
+
async *listDatasets({ limit = 100, offset = 0, datasetIds, datasetName, datasetNameContains, } = {}) {
|
|
510
510
|
const path = "/datasets";
|
|
511
511
|
const params = new URLSearchParams({
|
|
512
512
|
limit: limit.toString(),
|
|
513
513
|
offset: offset.toString(),
|
|
514
514
|
});
|
|
515
|
+
if (datasetIds !== undefined) {
|
|
516
|
+
for (const id_ of datasetIds) {
|
|
517
|
+
params.append("id", id_);
|
|
518
|
+
}
|
|
519
|
+
}
|
|
520
|
+
if (datasetName !== undefined) {
|
|
521
|
+
params.append("name", datasetName);
|
|
522
|
+
}
|
|
523
|
+
if (datasetNameContains !== undefined) {
|
|
524
|
+
params.append("name_contains", datasetNameContains);
|
|
525
|
+
}
|
|
515
526
|
for await (const datasets of this._getPaginated(path, params)) {
|
|
516
527
|
yield* datasets;
|
|
517
528
|
}
|
|
@@ -685,6 +696,28 @@ class Client {
|
|
|
685
696
|
const result = await response.json();
|
|
686
697
|
return result;
|
|
687
698
|
}
|
|
699
|
+
async updateFeedback(feedbackId, { score, value, correction, comment, }) {
|
|
700
|
+
const feedbackUpdate = {};
|
|
701
|
+
if (score !== undefined && score !== null) {
|
|
702
|
+
feedbackUpdate["score"] = score;
|
|
703
|
+
}
|
|
704
|
+
if (value !== undefined && value !== null) {
|
|
705
|
+
feedbackUpdate["value"] = value;
|
|
706
|
+
}
|
|
707
|
+
if (correction !== undefined && correction !== null) {
|
|
708
|
+
feedbackUpdate["correction"] = correction;
|
|
709
|
+
}
|
|
710
|
+
if (comment !== undefined && comment !== null) {
|
|
711
|
+
feedbackUpdate["comment"] = comment;
|
|
712
|
+
}
|
|
713
|
+
const response = await this.caller.call(fetch, `${this.apiUrl}/feedback/${feedbackId}`, {
|
|
714
|
+
method: "PATCH",
|
|
715
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
716
|
+
body: JSON.stringify(feedbackUpdate),
|
|
717
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
718
|
+
});
|
|
719
|
+
return response.json();
|
|
720
|
+
}
|
|
688
721
|
async readFeedback(feedbackId) {
|
|
689
722
|
const path = `/feedback/${feedbackId}`;
|
|
690
723
|
const response = await this._get(path);
|
package/dist/client.d.ts
CHANGED
|
@@ -105,9 +105,12 @@ export declare class Client {
|
|
|
105
105
|
datasetId?: string;
|
|
106
106
|
datasetName?: string;
|
|
107
107
|
}): Promise<Dataset>;
|
|
108
|
-
listDatasets({ limit, offset, }?: {
|
|
108
|
+
listDatasets({ limit, offset, datasetIds, datasetName, datasetNameContains, }?: {
|
|
109
109
|
limit?: number;
|
|
110
110
|
offset?: number;
|
|
111
|
+
datasetIds?: string[];
|
|
112
|
+
datasetName?: string;
|
|
113
|
+
datasetNameContains?: string;
|
|
111
114
|
}): AsyncIterable<Dataset>;
|
|
112
115
|
deleteDataset({ datasetId, datasetName, }: {
|
|
113
116
|
datasetId?: string;
|
|
@@ -132,11 +135,17 @@ export declare class Client {
|
|
|
132
135
|
createFeedback(runId: string, key: string, { score, value, correction, comment, sourceInfo, feedbackSourceType, }: {
|
|
133
136
|
score?: ScoreType;
|
|
134
137
|
value?: ValueType;
|
|
135
|
-
correction?:
|
|
138
|
+
correction?: object;
|
|
136
139
|
comment?: string;
|
|
137
140
|
sourceInfo?: object;
|
|
138
141
|
feedbackSourceType?: "API" | "MODEL";
|
|
139
142
|
}): Promise<Feedback>;
|
|
143
|
+
updateFeedback(feedbackId: string, { score, value, correction, comment, }: {
|
|
144
|
+
score?: number | boolean | null;
|
|
145
|
+
value?: number | boolean | string | object | null;
|
|
146
|
+
correction?: object | null;
|
|
147
|
+
comment?: string | null;
|
|
148
|
+
}): Promise<Feedback>;
|
|
140
149
|
readFeedback(feedbackId: string): Promise<Feedback>;
|
|
141
150
|
deleteFeedback(feedbackId: string): Promise<void>;
|
|
142
151
|
listFeedback({ runIds, }?: {
|
package/dist/client.js
CHANGED
|
@@ -480,12 +480,23 @@ export class Client {
|
|
|
480
480
|
}
|
|
481
481
|
return result;
|
|
482
482
|
}
|
|
483
|
-
async *listDatasets({ limit = 100, offset = 0, } = {}) {
|
|
483
|
+
async *listDatasets({ limit = 100, offset = 0, datasetIds, datasetName, datasetNameContains, } = {}) {
|
|
484
484
|
const path = "/datasets";
|
|
485
485
|
const params = new URLSearchParams({
|
|
486
486
|
limit: limit.toString(),
|
|
487
487
|
offset: offset.toString(),
|
|
488
488
|
});
|
|
489
|
+
if (datasetIds !== undefined) {
|
|
490
|
+
for (const id_ of datasetIds) {
|
|
491
|
+
params.append("id", id_);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (datasetName !== undefined) {
|
|
495
|
+
params.append("name", datasetName);
|
|
496
|
+
}
|
|
497
|
+
if (datasetNameContains !== undefined) {
|
|
498
|
+
params.append("name_contains", datasetNameContains);
|
|
499
|
+
}
|
|
489
500
|
for await (const datasets of this._getPaginated(path, params)) {
|
|
490
501
|
yield* datasets;
|
|
491
502
|
}
|
|
@@ -659,6 +670,28 @@ export class Client {
|
|
|
659
670
|
const result = await response.json();
|
|
660
671
|
return result;
|
|
661
672
|
}
|
|
673
|
+
async updateFeedback(feedbackId, { score, value, correction, comment, }) {
|
|
674
|
+
const feedbackUpdate = {};
|
|
675
|
+
if (score !== undefined && score !== null) {
|
|
676
|
+
feedbackUpdate["score"] = score;
|
|
677
|
+
}
|
|
678
|
+
if (value !== undefined && value !== null) {
|
|
679
|
+
feedbackUpdate["value"] = value;
|
|
680
|
+
}
|
|
681
|
+
if (correction !== undefined && correction !== null) {
|
|
682
|
+
feedbackUpdate["correction"] = correction;
|
|
683
|
+
}
|
|
684
|
+
if (comment !== undefined && comment !== null) {
|
|
685
|
+
feedbackUpdate["comment"] = comment;
|
|
686
|
+
}
|
|
687
|
+
const response = await this.caller.call(fetch, `${this.apiUrl}/feedback/${feedbackId}`, {
|
|
688
|
+
method: "PATCH",
|
|
689
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
690
|
+
body: JSON.stringify(feedbackUpdate),
|
|
691
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
692
|
+
});
|
|
693
|
+
return response.json();
|
|
694
|
+
}
|
|
662
695
|
async readFeedback(feedbackId) {
|
|
663
696
|
const path = `/feedback/${feedbackId}`;
|
|
664
697
|
const response = await this._get(path);
|