langsmith 0.1.37 → 0.1.38
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/README.md +1 -0
- package/dist/client.cjs +18 -0
- package/dist/client.d.ts +2 -1
- package/dist/client.js +18 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas.d.ts +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -53,6 +53,7 @@ Tracing can be activated by setting the following environment variables or by ma
|
|
|
53
53
|
```typescript
|
|
54
54
|
process.env["LANGSMITH_TRACING"] = "true";
|
|
55
55
|
process.env["LANGCHAIN_ENDPOINT"] = "https://api.smith.langchain.com";
|
|
56
|
+
// process.env["LANGCHAIN_ENDPOINT"] = "https://eu.api.smith.langchain.com"; // If signed up in the EU region
|
|
56
57
|
process.env["LANGCHAIN_API_KEY"] = "<YOUR-LANGSMITH-API-KEY>";
|
|
57
58
|
// process.env["LANGCHAIN_PROJECT"] = "My Project Name"; // Optional: "default" is used if not set
|
|
58
59
|
```
|
package/dist/client.cjs
CHANGED
|
@@ -319,6 +319,10 @@ class Client {
|
|
|
319
319
|
this.webUrl = "https://dev.smith.langchain.com";
|
|
320
320
|
return this.webUrl;
|
|
321
321
|
}
|
|
322
|
+
else if (this.apiUrl.split(".", 1)[0].includes("eu")) {
|
|
323
|
+
this.webUrl = "https://eu.smith.langchain.com";
|
|
324
|
+
return this.webUrl;
|
|
325
|
+
}
|
|
322
326
|
else {
|
|
323
327
|
this.webUrl = "https://smith.langchain.com";
|
|
324
328
|
return this.webUrl;
|
|
@@ -1659,6 +1663,20 @@ class Client {
|
|
|
1659
1663
|
const result = await response.json();
|
|
1660
1664
|
return result;
|
|
1661
1665
|
}
|
|
1666
|
+
async updateExamples(update) {
|
|
1667
|
+
const response = await this.caller.call(fetch, `${this.apiUrl}/examples/bulk`, {
|
|
1668
|
+
method: "PATCH",
|
|
1669
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1670
|
+
body: JSON.stringify(update),
|
|
1671
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1672
|
+
...this.fetchOptions,
|
|
1673
|
+
});
|
|
1674
|
+
if (!response.ok) {
|
|
1675
|
+
throw new Error(`Failed to update examples: ${response.status} ${response.statusText}`);
|
|
1676
|
+
}
|
|
1677
|
+
const result = await response.json();
|
|
1678
|
+
return result;
|
|
1679
|
+
}
|
|
1662
1680
|
async listDatasetSplits({ datasetId, datasetName, asOf, }) {
|
|
1663
1681
|
let datasetId_;
|
|
1664
1682
|
if (datasetId === undefined && datasetName === undefined) {
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AsyncCallerParams } from "./utils/async_caller.js";
|
|
2
|
-
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleUpdate, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType } from "./schemas.js";
|
|
2
|
+
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleUpdate, ExampleUpdateWithId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType } from "./schemas.js";
|
|
3
3
|
import { EvaluationResult, EvaluationResults, RunEvaluator } from "./evaluation/evaluator.js";
|
|
4
4
|
interface ClientConfig {
|
|
5
5
|
apiUrl?: string;
|
|
@@ -430,6 +430,7 @@ export declare class Client {
|
|
|
430
430
|
}): AsyncIterable<Example>;
|
|
431
431
|
deleteExample(exampleId: string): Promise<void>;
|
|
432
432
|
updateExample(exampleId: string, update: ExampleUpdate): Promise<object>;
|
|
433
|
+
updateExamples(update: ExampleUpdateWithId[]): Promise<object>;
|
|
433
434
|
listDatasetSplits({ datasetId, datasetName, asOf, }: {
|
|
434
435
|
datasetId?: string;
|
|
435
436
|
datasetName?: string;
|
package/dist/client.js
CHANGED
|
@@ -292,6 +292,10 @@ export class Client {
|
|
|
292
292
|
this.webUrl = "https://dev.smith.langchain.com";
|
|
293
293
|
return this.webUrl;
|
|
294
294
|
}
|
|
295
|
+
else if (this.apiUrl.split(".", 1)[0].includes("eu")) {
|
|
296
|
+
this.webUrl = "https://eu.smith.langchain.com";
|
|
297
|
+
return this.webUrl;
|
|
298
|
+
}
|
|
295
299
|
else {
|
|
296
300
|
this.webUrl = "https://smith.langchain.com";
|
|
297
301
|
return this.webUrl;
|
|
@@ -1632,6 +1636,20 @@ export class Client {
|
|
|
1632
1636
|
const result = await response.json();
|
|
1633
1637
|
return result;
|
|
1634
1638
|
}
|
|
1639
|
+
async updateExamples(update) {
|
|
1640
|
+
const response = await this.caller.call(fetch, `${this.apiUrl}/examples/bulk`, {
|
|
1641
|
+
method: "PATCH",
|
|
1642
|
+
headers: { ...this.headers, "Content-Type": "application/json" },
|
|
1643
|
+
body: JSON.stringify(update),
|
|
1644
|
+
signal: AbortSignal.timeout(this.timeout_ms),
|
|
1645
|
+
...this.fetchOptions,
|
|
1646
|
+
});
|
|
1647
|
+
if (!response.ok) {
|
|
1648
|
+
throw new Error(`Failed to update examples: ${response.status} ${response.statusText}`);
|
|
1649
|
+
}
|
|
1650
|
+
const result = await response.json();
|
|
1651
|
+
return result;
|
|
1652
|
+
}
|
|
1635
1653
|
async listDatasetSplits({ datasetId, datasetName, asOf, }) {
|
|
1636
1654
|
let datasetId_;
|
|
1637
1655
|
if (datasetId === undefined && datasetName === undefined) {
|
package/dist/index.cjs
CHANGED
|
@@ -6,4 +6,4 @@ Object.defineProperty(exports, "Client", { enumerable: true, get: function () {
|
|
|
6
6
|
var run_trees_js_1 = require("./run_trees.cjs");
|
|
7
7
|
Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () { return run_trees_js_1.RunTree; } });
|
|
8
8
|
// Update using yarn bump-version
|
|
9
|
-
exports.__version__ = "0.1.
|
|
9
|
+
exports.__version__ = "0.1.38";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Client } from "./client.js";
|
|
2
2
|
export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
|
|
3
3
|
export { RunTree, type RunTreeConfig } from "./run_trees.js";
|
|
4
|
-
export declare const __version__ = "0.1.
|
|
4
|
+
export declare const __version__ = "0.1.38";
|
package/dist/index.js
CHANGED
package/dist/schemas.d.ts
CHANGED
|
@@ -178,6 +178,9 @@ export interface ExampleUpdate {
|
|
|
178
178
|
metadata?: KVMap;
|
|
179
179
|
split?: string | string[];
|
|
180
180
|
}
|
|
181
|
+
export interface ExampleUpdateWithId extends ExampleUpdate {
|
|
182
|
+
id: string;
|
|
183
|
+
}
|
|
181
184
|
export interface BaseDataset {
|
|
182
185
|
name: string;
|
|
183
186
|
description: string;
|