langsmith 0.0.10 → 0.0.13
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/cli/docker-compose.yaml +0 -2
- package/dist/cli/main.cjs +10 -2
- package/dist/cli/main.js +10 -2
- package/dist/cli/main.ts +10 -2
- package/dist/client.cjs +19 -0
- package/dist/client.d.ts +4 -0
- package/dist/client.js +19 -0
- package/dist/schemas.d.ts +1 -0
- package/package.json +1 -1
package/dist/cli/main.cjs
CHANGED
|
@@ -221,7 +221,11 @@ class SmithCommand {
|
|
|
221
221
|
}
|
|
222
222
|
command.push("up", "--quiet-pull", "--wait");
|
|
223
223
|
await this.executeCommand(command);
|
|
224
|
-
console.info("LangSmith server is running at http://localhost:1984
|
|
224
|
+
console.info("LangSmith server is running at http://localhost:1984.\n" +
|
|
225
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
226
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
227
|
+
" locally, set the following environment variable" +
|
|
228
|
+
" when running your LangChain application.");
|
|
225
229
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
226
230
|
}
|
|
227
231
|
async startAndExpose(ngrokAuthToken, dev) {
|
|
@@ -240,7 +244,11 @@ class SmithCommand {
|
|
|
240
244
|
await this.executeCommand(command);
|
|
241
245
|
console.info("ngrok is running. You can view the dashboard at http://0.0.0.0:4040");
|
|
242
246
|
const ngrokUrl = await getNgrokUrl();
|
|
243
|
-
console.info("LangSmith server is running at http://localhost:1984.
|
|
247
|
+
console.info("LangSmith server is running at http://localhost:1984." +
|
|
248
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
249
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
250
|
+
" remotely, set the following environment variable" +
|
|
251
|
+
" when running your LangChain application.");
|
|
244
252
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
245
253
|
console.info(`\tLANGCHAIN_ENDPOINT=${ngrokUrl}`);
|
|
246
254
|
fs.unlinkSync(configPath);
|
package/dist/cli/main.js
CHANGED
|
@@ -195,7 +195,11 @@ class SmithCommand {
|
|
|
195
195
|
}
|
|
196
196
|
command.push("up", "--quiet-pull", "--wait");
|
|
197
197
|
await this.executeCommand(command);
|
|
198
|
-
console.info("LangSmith server is running at http://localhost:1984
|
|
198
|
+
console.info("LangSmith server is running at http://localhost:1984.\n" +
|
|
199
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
200
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
201
|
+
" locally, set the following environment variable" +
|
|
202
|
+
" when running your LangChain application.");
|
|
199
203
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
200
204
|
}
|
|
201
205
|
async startAndExpose(ngrokAuthToken, dev) {
|
|
@@ -214,7 +218,11 @@ class SmithCommand {
|
|
|
214
218
|
await this.executeCommand(command);
|
|
215
219
|
console.info("ngrok is running. You can view the dashboard at http://0.0.0.0:4040");
|
|
216
220
|
const ngrokUrl = await getNgrokUrl();
|
|
217
|
-
console.info("LangSmith server is running at http://localhost:1984.
|
|
221
|
+
console.info("LangSmith server is running at http://localhost:1984." +
|
|
222
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
223
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
224
|
+
" remotely, set the following environment variable" +
|
|
225
|
+
" when running your LangChain application.");
|
|
218
226
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
219
227
|
console.info(`\tLANGCHAIN_ENDPOINT=${ngrokUrl}`);
|
|
220
228
|
fs.unlinkSync(configPath);
|
package/dist/cli/main.ts
CHANGED
|
@@ -213,7 +213,11 @@ class SmithCommand {
|
|
|
213
213
|
command.push("up", "--quiet-pull", "--wait");
|
|
214
214
|
await this.executeCommand(command);
|
|
215
215
|
console.info(
|
|
216
|
-
"LangSmith server is running at http://localhost:1984
|
|
216
|
+
"LangSmith server is running at http://localhost:1984.\n" +
|
|
217
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
218
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
219
|
+
" locally, set the following environment variable" +
|
|
220
|
+
" when running your LangChain application."
|
|
217
221
|
);
|
|
218
222
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
219
223
|
}
|
|
@@ -237,7 +241,11 @@ class SmithCommand {
|
|
|
237
241
|
);
|
|
238
242
|
const ngrokUrl = await getNgrokUrl();
|
|
239
243
|
console.info(
|
|
240
|
-
"LangSmith server is running at http://localhost:1984.
|
|
244
|
+
"LangSmith server is running at http://localhost:1984." +
|
|
245
|
+
"To view the app, navigate your browser to http://localhost:80" +
|
|
246
|
+
"\n\nTo connect your LangChain application to the server" +
|
|
247
|
+
" remotely, set the following environment variable" +
|
|
248
|
+
" when running your LangChain application."
|
|
241
249
|
);
|
|
242
250
|
console.info("\tLANGCHAIN_TRACING_V2=true");
|
|
243
251
|
console.info(`\tLANGCHAIN_ENDPOINT=${ngrokUrl}`);
|
package/dist/client.cjs
CHANGED
|
@@ -105,6 +105,17 @@ class Client {
|
|
|
105
105
|
throw new Error("API key must be provided when using hosted LangSmith API");
|
|
106
106
|
}
|
|
107
107
|
}
|
|
108
|
+
getHostUrl() {
|
|
109
|
+
if (isLocalhost(this.apiUrl)) {
|
|
110
|
+
return "http://localhost";
|
|
111
|
+
}
|
|
112
|
+
else if (this.apiUrl.split(".", 1)[0].includes("dev")) {
|
|
113
|
+
return "https://dev.smith.langchain.com";
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
return "https://smith.langchain.com";
|
|
117
|
+
}
|
|
118
|
+
}
|
|
108
119
|
get headers() {
|
|
109
120
|
const headers = {};
|
|
110
121
|
if (this.apiKey) {
|
|
@@ -193,6 +204,14 @@ class Client {
|
|
|
193
204
|
}
|
|
194
205
|
return run;
|
|
195
206
|
}
|
|
207
|
+
async getRunUrl({ runId, }) {
|
|
208
|
+
const run = await this.readRun(runId);
|
|
209
|
+
if (!run.app_path) {
|
|
210
|
+
return undefined;
|
|
211
|
+
}
|
|
212
|
+
const baseUrl = this.getHostUrl();
|
|
213
|
+
return `${baseUrl}${run.app_path}`;
|
|
214
|
+
}
|
|
196
215
|
async _loadChildRuns(run) {
|
|
197
216
|
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
|
|
198
217
|
const treemap = {};
|
package/dist/client.d.ts
CHANGED
|
@@ -62,6 +62,7 @@ export declare class Client {
|
|
|
62
62
|
apiKey?: string;
|
|
63
63
|
};
|
|
64
64
|
private validateApiKeyIfHosted;
|
|
65
|
+
private getHostUrl;
|
|
65
66
|
private get headers();
|
|
66
67
|
private _get;
|
|
67
68
|
private _getPaginated;
|
|
@@ -70,6 +71,9 @@ export declare class Client {
|
|
|
70
71
|
readRun(runId: string, { loadChildRuns }?: {
|
|
71
72
|
loadChildRuns: boolean;
|
|
72
73
|
}): Promise<Run>;
|
|
74
|
+
getRunUrl({ runId, }: {
|
|
75
|
+
runId: string;
|
|
76
|
+
}): Promise<string | undefined>;
|
|
73
77
|
private _loadChildRuns;
|
|
74
78
|
listRuns({ projectId, projectName, parentRunId, referenceExampleId, datasetId, startTime, endTime, executionOrder, runType, error, id, limit, offset, query, filter, orderBy, }: ListRunsParams): AsyncIterable<Run>;
|
|
75
79
|
deleteRun(runId: string): Promise<void>;
|
package/dist/client.js
CHANGED
|
@@ -79,6 +79,17 @@ export class Client {
|
|
|
79
79
|
throw new Error("API key must be provided when using hosted LangSmith API");
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
getHostUrl() {
|
|
83
|
+
if (isLocalhost(this.apiUrl)) {
|
|
84
|
+
return "http://localhost";
|
|
85
|
+
}
|
|
86
|
+
else if (this.apiUrl.split(".", 1)[0].includes("dev")) {
|
|
87
|
+
return "https://dev.smith.langchain.com";
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
return "https://smith.langchain.com";
|
|
91
|
+
}
|
|
92
|
+
}
|
|
82
93
|
get headers() {
|
|
83
94
|
const headers = {};
|
|
84
95
|
if (this.apiKey) {
|
|
@@ -167,6 +178,14 @@ export class Client {
|
|
|
167
178
|
}
|
|
168
179
|
return run;
|
|
169
180
|
}
|
|
181
|
+
async getRunUrl({ runId, }) {
|
|
182
|
+
const run = await this.readRun(runId);
|
|
183
|
+
if (!run.app_path) {
|
|
184
|
+
return undefined;
|
|
185
|
+
}
|
|
186
|
+
const baseUrl = this.getHostUrl();
|
|
187
|
+
return `${baseUrl}${run.app_path}`;
|
|
188
|
+
}
|
|
170
189
|
async _loadChildRuns(run) {
|
|
171
190
|
const childRuns = await toArray(this.listRuns({ id: run.child_run_ids }));
|
|
172
191
|
const treemap = {};
|
package/dist/schemas.d.ts
CHANGED