langsmith
Advanced tools
Comparing version 0.0.20 to 0.0.23
@@ -108,5 +108,8 @@ import { AsyncCallerParams } from "./utils/async_caller.js"; | ||
}): Promise<Dataset>; | ||
listDatasets({ limit, offset, }?: { | ||
listDatasets({ limit, offset, datasetIds, datasetName, datasetNameContains, }?: { | ||
limit?: number; | ||
offset?: number; | ||
datasetIds?: string[]; | ||
datasetName?: string; | ||
datasetNameContains?: string; | ||
}): AsyncIterable<Dataset>; | ||
@@ -136,3 +139,3 @@ deleteDataset({ datasetId, datasetName, }: { | ||
value?: ValueType; | ||
correction?: string | object; | ||
correction?: object; | ||
comment?: string; | ||
@@ -142,2 +145,8 @@ sourceInfo?: object; | ||
}): Promise<Feedback>; | ||
updateFeedback(feedbackId: string, { score, value, correction, comment, }: { | ||
score?: number | boolean | null; | ||
value?: number | boolean | string | object | null; | ||
correction?: object | null; | ||
comment?: string | null; | ||
}): Promise<Feedback>; | ||
readFeedback(feedbackId: string): Promise<Feedback>; | ||
@@ -144,0 +153,0 @@ deleteFeedback(feedbackId: string): Promise<void>; |
@@ -483,3 +483,3 @@ import * as uuid from "uuid"; | ||
} | ||
async *listDatasets({ limit = 100, offset = 0, } = {}) { | ||
async *listDatasets({ limit = 100, offset = 0, datasetIds, datasetName, datasetNameContains, } = {}) { | ||
const path = "/datasets"; | ||
@@ -490,2 +490,13 @@ const params = new URLSearchParams({ | ||
}); | ||
if (datasetIds !== undefined) { | ||
for (const id_ of datasetIds) { | ||
params.append("id", id_); | ||
} | ||
} | ||
if (datasetName !== undefined) { | ||
params.append("name", datasetName); | ||
} | ||
if (datasetNameContains !== undefined) { | ||
params.append("name_contains", datasetNameContains); | ||
} | ||
for await (const datasets of this._getPaginated(path, params)) { | ||
@@ -664,2 +675,24 @@ yield* datasets; | ||
} | ||
async updateFeedback(feedbackId, { score, value, correction, comment, }) { | ||
const feedbackUpdate = {}; | ||
if (score !== undefined && score !== null) { | ||
feedbackUpdate["score"] = score; | ||
} | ||
if (value !== undefined && value !== null) { | ||
feedbackUpdate["value"] = value; | ||
} | ||
if (correction !== undefined && correction !== null) { | ||
feedbackUpdate["correction"] = correction; | ||
} | ||
if (comment !== undefined && comment !== null) { | ||
feedbackUpdate["comment"] = comment; | ||
} | ||
const response = await this.caller.call(fetch, `${this.apiUrl}/feedback/${feedbackId}`, { | ||
method: "PATCH", | ||
headers: { ...this.headers, "Content-Type": "application/json" }, | ||
body: JSON.stringify(feedbackUpdate), | ||
signal: AbortSignal.timeout(this.timeout_ms), | ||
}); | ||
return response.json(); | ||
} | ||
async readFeedback(feedbackId) { | ||
@@ -666,0 +699,0 @@ const path = `/feedback/${feedbackId}`; |
@@ -7,3 +7,3 @@ import { Example, KVMap, Run, ScoreType, ValueType } from "../schemas.js"; | ||
comment?: string; | ||
correction?: string | object; | ||
correction?: object; | ||
evaluatorInfo?: KVMap; | ||
@@ -10,0 +10,0 @@ } |
@@ -8,3 +8,3 @@ import { Example, Run, ScoreType, ValueType } from "../schemas.js"; | ||
comment?: string; | ||
correction?: string | object; | ||
correction?: object; | ||
} | ||
@@ -11,0 +11,0 @@ export interface GradingFunctionParams { |
{ | ||
"name": "langsmith", | ||
"version": "0.0.20", | ||
"version": "0.0.23", | ||
"description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152090
3771
46