langsmith 0.5.5 → 0.5.6

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.
@@ -254,8 +254,19 @@ function LangSmithMiddleware(config) {
254
254
  role: "assistant",
255
255
  tool_calls: [],
256
256
  });
257
- const outputFormatter = lsConfig?.processOutputs ?? utils_js_1.convertMessageToTracedFormat;
258
- const formattedOutputs = await outputFormatter(output);
257
+ // Add raw request/response for tracing only (not part of aggregated output)
258
+ const outputForTracing = {
259
+ ...output,
260
+ request: rest.request,
261
+ response: rest.response,
262
+ };
263
+ let formattedOutputs;
264
+ if (lsConfig?.processOutputs) {
265
+ formattedOutputs = await lsConfig.processOutputs(outputForTracing);
266
+ }
267
+ else {
268
+ formattedOutputs = _formatTracedOutputs(outputForTracing, lsConfig?.traceRawHttp);
269
+ }
259
270
  await runTree?.end(formattedOutputs);
260
271
  }
261
272
  catch (error) {
@@ -251,8 +251,19 @@ export function LangSmithMiddleware(config) {
251
251
  role: "assistant",
252
252
  tool_calls: [],
253
253
  });
254
- const outputFormatter = lsConfig?.processOutputs ?? convertMessageToTracedFormat;
255
- const formattedOutputs = await outputFormatter(output);
254
+ // Add raw request/response for tracing only (not part of aggregated output)
255
+ const outputForTracing = {
256
+ ...output,
257
+ request: rest.request,
258
+ response: rest.response,
259
+ };
260
+ let formattedOutputs;
261
+ if (lsConfig?.processOutputs) {
262
+ formattedOutputs = await lsConfig.processOutputs(outputForTracing);
263
+ }
264
+ else {
265
+ formattedOutputs = _formatTracedOutputs(outputForTracing, lsConfig?.traceRawHttp);
266
+ }
256
267
  await runTree?.end(formattedOutputs);
257
268
  }
258
269
  catch (error) {
package/dist/index.cjs CHANGED
@@ -18,4 +18,4 @@ Object.defineProperty(exports, "PromptCache", { enumerable: true, get: function
18
18
  Object.defineProperty(exports, "configureGlobalPromptCache", { enumerable: true, get: function () { return index_js_1.configureGlobalPromptCache; } });
19
19
  Object.defineProperty(exports, "promptCacheSingleton", { enumerable: true, get: function () { return index_js_1.promptCacheSingleton; } });
20
20
  // Update using yarn bump-version
21
- exports.__version__ = "0.5.5";
21
+ exports.__version__ = "0.5.6";
package/dist/index.d.ts CHANGED
@@ -5,4 +5,4 @@ export { overrideFetchImplementation } from "./singletons/fetch.js";
5
5
  export { getDefaultProjectName } from "./utils/project.js";
6
6
  export { uuid7, uuid7FromTime } from "./uuid.js";
7
7
  export { Cache, PromptCache, type CacheConfig, type CacheMetrics, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
8
- export declare const __version__ = "0.5.5";
8
+ export declare const __version__ = "0.5.6";
package/dist/index.js CHANGED
@@ -5,4 +5,4 @@ export { getDefaultProjectName } from "./utils/project.js";
5
5
  export { uuid7, uuid7FromTime } from "./uuid.js";
6
6
  export { Cache, PromptCache, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
7
7
  // Update using yarn bump-version
8
- export const __version__ = "0.5.5";
8
+ export const __version__ = "0.5.6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "Client library to connect to the LangSmith Observability and Evaluation Platform.",
5
5
  "packageManager": "yarn@1.22.19",
6
6
  "files": [