langsmith 0.0.27 → 0.0.29
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 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.js +6 -1
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -651,7 +651,7 @@ class Client {
|
|
|
651
651
|
feedbackSourceType: "MODEL",
|
|
652
652
|
});
|
|
653
653
|
}
|
|
654
|
-
async createFeedback(runId, key, { score, value, correction, comment, sourceInfo, feedbackSourceType = "API", }) {
|
|
654
|
+
async createFeedback(runId, key, { score, value, correction, comment, sourceInfo, feedbackSourceType = "API", sourceRunId, }) {
|
|
655
655
|
let feedback_source;
|
|
656
656
|
if (feedbackSourceType === "API") {
|
|
657
657
|
feedback_source = { type: "api", metadata: sourceInfo ?? {} };
|
|
@@ -662,6 +662,11 @@ class Client {
|
|
|
662
662
|
else {
|
|
663
663
|
throw new Error(`Unknown feedback source type ${feedbackSourceType}`);
|
|
664
664
|
}
|
|
665
|
+
if (sourceRunId !== undefined &&
|
|
666
|
+
feedback_source?.metadata !== undefined &&
|
|
667
|
+
!feedback_source.metadata["__run"]) {
|
|
668
|
+
feedback_source.metadata["__run"] = { run_id: sourceRunId };
|
|
669
|
+
}
|
|
665
670
|
const feedback = {
|
|
666
671
|
id: uuid.v4(),
|
|
667
672
|
run_id: runId,
|
package/dist/client.d.ts
CHANGED
|
@@ -129,13 +129,14 @@ export declare class Client {
|
|
|
129
129
|
sourceInfo?: KVMap;
|
|
130
130
|
loadChildRuns: boolean;
|
|
131
131
|
}): Promise<Feedback>;
|
|
132
|
-
createFeedback(runId: string, key: string, { score, value, correction, comment, sourceInfo, feedbackSourceType, }: {
|
|
132
|
+
createFeedback(runId: string, key: string, { score, value, correction, comment, sourceInfo, feedbackSourceType, sourceRunId, }: {
|
|
133
133
|
score?: ScoreType;
|
|
134
134
|
value?: ValueType;
|
|
135
135
|
correction?: object;
|
|
136
136
|
comment?: string;
|
|
137
137
|
sourceInfo?: object;
|
|
138
138
|
feedbackSourceType?: "API" | "MODEL";
|
|
139
|
+
sourceRunId?: string;
|
|
139
140
|
}): Promise<Feedback>;
|
|
140
141
|
updateFeedback(feedbackId: string, { score, value, correction, comment, }: {
|
|
141
142
|
score?: number | boolean | null;
|
package/dist/client.js
CHANGED
|
@@ -625,7 +625,7 @@ export class Client {
|
|
|
625
625
|
feedbackSourceType: "MODEL",
|
|
626
626
|
});
|
|
627
627
|
}
|
|
628
|
-
async createFeedback(runId, key, { score, value, correction, comment, sourceInfo, feedbackSourceType = "API", }) {
|
|
628
|
+
async createFeedback(runId, key, { score, value, correction, comment, sourceInfo, feedbackSourceType = "API", sourceRunId, }) {
|
|
629
629
|
let feedback_source;
|
|
630
630
|
if (feedbackSourceType === "API") {
|
|
631
631
|
feedback_source = { type: "api", metadata: sourceInfo ?? {} };
|
|
@@ -636,6 +636,11 @@ export class Client {
|
|
|
636
636
|
else {
|
|
637
637
|
throw new Error(`Unknown feedback source type ${feedbackSourceType}`);
|
|
638
638
|
}
|
|
639
|
+
if (sourceRunId !== undefined &&
|
|
640
|
+
feedback_source?.metadata !== undefined &&
|
|
641
|
+
!feedback_source.metadata["__run"]) {
|
|
642
|
+
feedback_source.metadata["__run"] = { run_id: sourceRunId };
|
|
643
|
+
}
|
|
639
644
|
const feedback = {
|
|
640
645
|
id: uuid.v4(),
|
|
641
646
|
run_id: runId,
|