langsmith 0.0.1-0 → 0.0.2

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.
@@ -1,5 +1,7 @@
1
1
  version: "3"
2
2
  services:
3
+ langchain-playground:
4
+ image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-playground:latest
3
5
  langchain-frontend:
4
6
  image: langchain/${_LANGCHAINPLUS_IMAGE_PREFIX-}langchainplus-frontend:latest
5
7
  ports:
@@ -8,6 +10,7 @@ services:
8
10
  - REACT_APP_BACKEND_URL=http://localhost:1984
9
11
  depends_on:
10
12
  - langchain-backend
13
+ - langchain-playground
11
14
  volumes:
12
15
  - ./conf/nginx.conf:/etc/nginx/default.conf:ro
13
16
  langchain-backend:
package/dist/cli/main.cjs CHANGED
@@ -163,6 +163,7 @@ class PlusCommand {
163
163
  if (args.openaiApiKey) {
164
164
  (0, env_js_1.setEnvironmentVariable)("OPENAI_API_KEY", args.openaiApiKey);
165
165
  }
166
+ await this.pull(args);
166
167
  if (args.expose) {
167
168
  await this.startAndExpose(args.ngrokAuthtoken);
168
169
  }
@@ -188,7 +189,6 @@ class PlusCommand {
188
189
  "-f",
189
190
  this.dockerComposeFile,
190
191
  "up",
191
- "--pull=always",
192
192
  "--quiet-pull",
193
193
  "--wait",
194
194
  ];
@@ -205,7 +205,6 @@ class PlusCommand {
205
205
  "-f",
206
206
  this.ngrokPath,
207
207
  "up",
208
- "--pull=always",
209
208
  "--quiet-pull",
210
209
  "--wait",
211
210
  ];
@@ -269,7 +268,6 @@ const statusCommand = new commander_1.Command("status")
269
268
  .description("Get the status of the LangSmith server")
270
269
  .action(async () => (await PlusCommand.create()).status());
271
270
  program
272
- .command("plus")
273
271
  .description("Manage the LangSmith server")
274
272
  .addCommand(startCommand)
275
273
  .addCommand(stopCommand)
package/dist/cli/main.js CHANGED
@@ -137,6 +137,7 @@ class PlusCommand {
137
137
  if (args.openaiApiKey) {
138
138
  setEnvironmentVariable("OPENAI_API_KEY", args.openaiApiKey);
139
139
  }
140
+ await this.pull(args);
140
141
  if (args.expose) {
141
142
  await this.startAndExpose(args.ngrokAuthtoken);
142
143
  }
@@ -162,7 +163,6 @@ class PlusCommand {
162
163
  "-f",
163
164
  this.dockerComposeFile,
164
165
  "up",
165
- "--pull=always",
166
166
  "--quiet-pull",
167
167
  "--wait",
168
168
  ];
@@ -179,7 +179,6 @@ class PlusCommand {
179
179
  "-f",
180
180
  this.ngrokPath,
181
181
  "up",
182
- "--pull=always",
183
182
  "--quiet-pull",
184
183
  "--wait",
185
184
  ];
@@ -243,7 +242,6 @@ const statusCommand = new Command("status")
243
242
  .description("Get the status of the LangSmith server")
244
243
  .action(async () => (await PlusCommand.create()).status());
245
244
  program
246
- .command("plus")
247
245
  .description("Manage the LangSmith server")
248
246
  .addCommand(startCommand)
249
247
  .addCommand(stopCommand)
package/dist/cli/main.ts CHANGED
@@ -151,7 +151,7 @@ class PlusCommand {
151
151
  if (args.openaiApiKey) {
152
152
  setEnvironmentVariable("OPENAI_API_KEY", args.openaiApiKey);
153
153
  }
154
-
154
+ await this.pull(args);
155
155
  if (args.expose) {
156
156
  await this.startAndExpose(args.ngrokAuthtoken);
157
157
  } else {
@@ -179,7 +179,6 @@ class PlusCommand {
179
179
  "-f",
180
180
  this.dockerComposeFile,
181
181
  "up",
182
- "--pull=always",
183
182
  "--quiet-pull",
184
183
  "--wait",
185
184
  ];
@@ -199,7 +198,6 @@ class PlusCommand {
199
198
  "-f",
200
199
  this.ngrokPath,
201
200
  "up",
202
- "--pull=always",
203
201
  "--quiet-pull",
204
202
  "--wait",
205
203
  ];
@@ -282,7 +280,6 @@ const statusCommand = new Command("status")
282
280
  .action(async () => (await PlusCommand.create()).status());
283
281
 
284
282
  program
285
- .command("plus")
286
283
  .description("Manage the LangSmith server")
287
284
  .addCommand(startCommand)
288
285
  .addCommand(stopCommand)
package/dist/client.cjs CHANGED
@@ -400,8 +400,7 @@ class Client {
400
400
  if (!response.ok) {
401
401
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
402
402
  }
403
- const results = await response.json();
404
- return results;
403
+ await response.json();
405
404
  }
406
405
  async createExample(inputs, outputs, { datasetId, datasetName, createdAt, }) {
407
406
  let datasetId_ = datasetId;
@@ -473,8 +472,7 @@ class Client {
473
472
  if (!response.ok) {
474
473
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
475
474
  }
476
- const result = await response.json();
477
- return result;
475
+ await response.json();
478
476
  }
479
477
  async updateExample(exampleId, update) {
480
478
  const response = await this.caller.call(fetch, `${this.apiUrl}/examples/${exampleId}`, {
@@ -567,8 +565,7 @@ class Client {
567
565
  if (!response.ok) {
568
566
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
569
567
  }
570
- const result = await response.json();
571
- return result;
568
+ await response.json();
572
569
  }
573
570
  async listFeedback({ runIds, limit, offset, } = {}) {
574
571
  const queryParams = new URLSearchParams();
package/dist/client.d.ts CHANGED
@@ -92,7 +92,7 @@ export declare class Client {
92
92
  deleteDataset({ datasetId, datasetName, }: {
93
93
  datasetId?: string;
94
94
  datasetName?: string;
95
- }): Promise<Dataset>;
95
+ }): Promise<void>;
96
96
  createExample(inputs: KVMap, outputs: KVMap, { datasetId, datasetName, createdAt, }: {
97
97
  datasetId?: string;
98
98
  datasetName?: string;
@@ -105,7 +105,7 @@ export declare class Client {
105
105
  limit?: number;
106
106
  offset?: number;
107
107
  }): Promise<Example[]>;
108
- deleteExample(exampleId: string): Promise<Example>;
108
+ deleteExample(exampleId: string): Promise<void>;
109
109
  updateExample(exampleId: string, update: ExampleUpdate): Promise<object>;
110
110
  evaluateRun(run: Run | string, evaluator: RunEvaluator, { sourceInfo, loadChildRuns, }?: {
111
111
  sourceInfo?: KVMap;
@@ -120,7 +120,7 @@ export declare class Client {
120
120
  feedbackSourceType?: "API" | "MODEL";
121
121
  }): Promise<Feedback>;
122
122
  readFeedback(feedbackId: string): Promise<Feedback>;
123
- deleteFeedback(feedbackId: string): Promise<Feedback>;
123
+ deleteFeedback(feedbackId: string): Promise<void>;
124
124
  listFeedback({ runIds, limit, offset, }?: {
125
125
  runIds?: string[];
126
126
  limit?: number;
package/dist/client.js CHANGED
@@ -374,8 +374,7 @@ export class Client {
374
374
  if (!response.ok) {
375
375
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
376
376
  }
377
- const results = await response.json();
378
- return results;
377
+ await response.json();
379
378
  }
380
379
  async createExample(inputs, outputs, { datasetId, datasetName, createdAt, }) {
381
380
  let datasetId_ = datasetId;
@@ -447,8 +446,7 @@ export class Client {
447
446
  if (!response.ok) {
448
447
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
449
448
  }
450
- const result = await response.json();
451
- return result;
449
+ await response.json();
452
450
  }
453
451
  async updateExample(exampleId, update) {
454
452
  const response = await this.caller.call(fetch, `${this.apiUrl}/examples/${exampleId}`, {
@@ -541,8 +539,7 @@ export class Client {
541
539
  if (!response.ok) {
542
540
  throw new Error(`Failed to delete ${path}: ${response.status} ${response.statusText}`);
543
541
  }
544
- const result = await response.json();
545
- return result;
542
+ await response.json();
546
543
  }
547
544
  async listFeedback({ runIds, limit, offset, } = {}) {
548
545
  const queryParams = new URLSearchParams();
@@ -131,6 +131,12 @@ class RunTree {
131
131
  writable: true,
132
132
  value: void 0
133
133
  });
134
+ Object.defineProperty(this, "events", {
135
+ enumerable: true,
136
+ configurable: true,
137
+ writable: true,
138
+ value: void 0
139
+ });
134
140
  const defaultConfig = RunTree.getDefaultConfig();
135
141
  Object.assign(this, { ...defaultConfig, ...config });
136
142
  }
@@ -225,6 +231,8 @@ class RunTree {
225
231
  outputs: this.outputs,
226
232
  parent_run_id: this.parent_run?.id,
227
233
  reference_example_id: this.reference_example_id,
234
+ extra: this.extra,
235
+ events: this.events,
228
236
  };
229
237
  await this.client.updateRun(this.id, runUpdate);
230
238
  }
@@ -37,6 +37,7 @@ export declare class RunTree implements BaseRun {
37
37
  outputs?: KVMap;
38
38
  reference_example_id?: string;
39
39
  client: Client;
40
+ events?: KVMap[] | undefined;
40
41
  constructor(config: RunTreeConfig);
41
42
  private static getDefaultConfig;
42
43
  createChild(config: RunTreeConfig): Promise<RunTree>;
package/dist/run_trees.js CHANGED
@@ -105,6 +105,12 @@ export class RunTree {
105
105
  writable: true,
106
106
  value: void 0
107
107
  });
108
+ Object.defineProperty(this, "events", {
109
+ enumerable: true,
110
+ configurable: true,
111
+ writable: true,
112
+ value: void 0
113
+ });
108
114
  const defaultConfig = RunTree.getDefaultConfig();
109
115
  Object.assign(this, { ...defaultConfig, ...config });
110
116
  }
@@ -199,6 +205,8 @@ export class RunTree {
199
205
  outputs: this.outputs,
200
206
  parent_run_id: this.parent_run?.id,
201
207
  reference_example_id: this.reference_example_id,
208
+ extra: this.extra,
209
+ events: this.events,
202
210
  };
203
211
  await this.client.updateRun(this.id, runUpdate);
204
212
  }
package/dist/schemas.d.ts CHANGED
@@ -18,7 +18,7 @@ export interface TracerSessionResult extends TracerSession {
18
18
  run_facets?: KVMap[];
19
19
  }
20
20
  export type KVMap = Record<string, any>;
21
- export type RunType = "llm" | "chain" | "tool";
21
+ export type RunType = "llm" | "chain" | "tool" | "retriever" | "embedding";
22
22
  export type ScoreType = number | boolean | null;
23
23
  export type ValueType = number | boolean | string | object | null;
24
24
  export interface BaseExample {
@@ -58,10 +58,13 @@ export interface RunCreate extends BaseRun {
58
58
  }
59
59
  export interface RunUpdate {
60
60
  end_time?: number;
61
+ extra?: KVMap;
61
62
  error?: string;
62
63
  outputs?: KVMap;
63
64
  parent_run_id?: string;
64
65
  reference_example_id?: string;
66
+ events?: KVMap[];
67
+ session_id?: string;
65
68
  }
66
69
  export interface ExampleCreate extends BaseExample {
67
70
  id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.0.1-0",
3
+ "version": "0.0.2",
4
4
  "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
5
5
  "files": [
6
6
  "dist/",
@@ -23,7 +23,7 @@
23
23
  "type": "module",
24
24
  "main": "./dist/index.js",
25
25
  "bin": {
26
- "langchain": "./dist/cli/main.cjs"
26
+ "langsmith": "./dist/cli/main.cjs"
27
27
  },
28
28
  "types": "./dist/index.d.ts",
29
29
  "scripts": {