langsmith 0.3.57-rc.2 → 0.3.57

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 CHANGED
@@ -1001,8 +1001,8 @@ class Client {
1001
1001
  ]) {
1002
1002
  for (const originalPayload of payloads) {
1003
1003
  // collect fields to be sent as separate parts
1004
- const { inputs, outputs, events, attachments, ...payload } = originalPayload;
1005
- const fields = { inputs, outputs, events };
1004
+ const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
1005
+ const fields = { inputs, outputs, events, extra, error, serialized };
1006
1006
  // encode the main run payload
1007
1007
  const stringifiedPayload = (0, index_js_2.serialize)(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
1008
1008
  accumulatedParts.push({
package/dist/client.js CHANGED
@@ -963,8 +963,8 @@ export class Client {
963
963
  ]) {
964
964
  for (const originalPayload of payloads) {
965
965
  // collect fields to be sent as separate parts
966
- const { inputs, outputs, events, attachments, ...payload } = originalPayload;
967
- const fields = { inputs, outputs, events };
966
+ const { inputs, outputs, events, extra, error, serialized, attachments, ...payload } = originalPayload;
967
+ const fields = { inputs, outputs, events, extra, error, serialized };
968
968
  // encode the main run payload
969
969
  const stringifiedPayload = serializePayloadForTracing(payload, `Serializing for multipart ingestion of run with id: ${payload.id}`);
970
970
  accumulatedParts.push({
@@ -57,7 +57,6 @@ const _formatTracedOutputs = (outputs) => {
57
57
  }
58
58
  return (0, exports.populateToolCallsForTracing)(formattedOutputs);
59
59
  };
60
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
61
60
  const setUsageMetadataOnRunTree = (result, runTree) => {
62
61
  if (result.usage == null || typeof result.usage !== "object") {
63
62
  return;
@@ -108,9 +107,13 @@ function LangSmithMiddleware(config) {
108
107
  ai_sdk_method: "ai.doGenerate",
109
108
  ...lsConfig?.metadata,
110
109
  },
111
- processInputs: (inputs) => _formatTracedInputs(inputs),
110
+ processInputs: (inputs) => {
111
+ const typedInputs = inputs;
112
+ return _formatTracedInputs(typedInputs);
113
+ },
112
114
  processOutputs: (outputs) => {
113
- return _formatTracedOutputs(outputs);
115
+ const typedOutputs = outputs;
116
+ return _formatTracedOutputs(typedOutputs);
114
117
  },
115
118
  });
116
119
  return traceableFunc(params);
@@ -151,7 +154,7 @@ function LangSmithMiddleware(config) {
151
154
  }
152
155
  return {
153
156
  ...aggregated,
154
- text: aggregated.text + chunk.delta,
157
+ content: aggregated.content + chunk.delta,
155
158
  };
156
159
  }
157
160
  else if (chunk.type === "tool-call") {
@@ -188,7 +191,7 @@ function LangSmithMiddleware(config) {
188
191
  return aggregated;
189
192
  }
190
193
  }, {
191
- text: "",
194
+ content: "",
192
195
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
193
196
  tool_calls: [],
194
197
  });
@@ -27,5 +27,5 @@ export declare const populateToolCallsForTracing: (message: LanguageModelV2Messa
27
27
  export declare function LangSmithMiddleware(config?: {
28
28
  name: string;
29
29
  modelId?: string;
30
- lsConfig?: Partial<Omit<RunTreeConfig, "inputs" | "outputs">>;
30
+ lsConfig?: Partial<Omit<RunTreeConfig, "inputs" | "outputs" | "run_type">>;
31
31
  }): LanguageModelV2Middleware;
@@ -52,7 +52,6 @@ const _formatTracedOutputs = (outputs) => {
52
52
  }
53
53
  return populateToolCallsForTracing(formattedOutputs);
54
54
  };
55
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
56
55
  const setUsageMetadataOnRunTree = (result, runTree) => {
57
56
  if (result.usage == null || typeof result.usage !== "object") {
58
57
  return;
@@ -103,9 +102,13 @@ export function LangSmithMiddleware(config) {
103
102
  ai_sdk_method: "ai.doGenerate",
104
103
  ...lsConfig?.metadata,
105
104
  },
106
- processInputs: (inputs) => _formatTracedInputs(inputs),
105
+ processInputs: (inputs) => {
106
+ const typedInputs = inputs;
107
+ return _formatTracedInputs(typedInputs);
108
+ },
107
109
  processOutputs: (outputs) => {
108
- return _formatTracedOutputs(outputs);
110
+ const typedOutputs = outputs;
111
+ return _formatTracedOutputs(typedOutputs);
109
112
  },
110
113
  });
111
114
  return traceableFunc(params);
@@ -146,7 +149,7 @@ export function LangSmithMiddleware(config) {
146
149
  }
147
150
  return {
148
151
  ...aggregated,
149
- text: aggregated.text + chunk.delta,
152
+ content: aggregated.content + chunk.delta,
150
153
  };
151
154
  }
152
155
  else if (chunk.type === "tool-call") {
@@ -183,7 +186,7 @@ export function LangSmithMiddleware(config) {
183
186
  return aggregated;
184
187
  }
185
188
  }, {
186
- text: "",
189
+ content: "",
187
190
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
188
191
  tool_calls: [],
189
192
  });
package/dist/index.cjs CHANGED
@@ -10,4 +10,4 @@ Object.defineProperty(exports, "overrideFetchImplementation", { enumerable: true
10
10
  var project_js_1 = require("./utils/project.cjs");
11
11
  Object.defineProperty(exports, "getDefaultProjectName", { enumerable: true, get: function () { return project_js_1.getDefaultProjectName; } });
12
12
  // Update using yarn bump-version
13
- exports.__version__ = "0.3.57-rc.2";
13
+ exports.__version__ = "0.3.57";
package/dist/index.d.ts CHANGED
@@ -3,4 +3,4 @@ export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, }
3
3
  export { RunTree, type RunTreeConfig } from "./run_trees.js";
4
4
  export { overrideFetchImplementation } from "./singletons/fetch.js";
5
5
  export { getDefaultProjectName } from "./utils/project.js";
6
- export declare const __version__ = "0.3.57-rc.2";
6
+ export declare const __version__ = "0.3.57";
package/dist/index.js CHANGED
@@ -3,4 +3,4 @@ export { RunTree } from "./run_trees.js";
3
3
  export { overrideFetchImplementation } from "./singletons/fetch.js";
4
4
  export { getDefaultProjectName } from "./utils/project.js";
5
5
  // Update using yarn bump-version
6
- export const __version__ = "0.3.57-rc.2";
6
+ export const __version__ = "0.3.57";
package/dist/schemas.d.ts CHANGED
@@ -156,6 +156,7 @@ export interface RunUpdate {
156
156
  extra?: KVMap;
157
157
  tags?: string[];
158
158
  error?: string;
159
+ serialized?: object;
159
160
  inputs?: KVMap;
160
161
  outputs?: KVMap;
161
162
  parent_run_id?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.3.57-rc.2",
3
+ "version": "0.3.57",
4
4
  "description": "Client library to connect to the LangSmith LLM Tracing and Evaluation Platform.",
5
5
  "packageManager": "yarn@1.22.19",
6
6
  "files": [