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 +2 -2
- package/dist/client.js +2 -2
- package/dist/experimental/vercel/middleware.cjs +8 -5
- package/dist/experimental/vercel/middleware.d.ts +1 -1
- package/dist/experimental/vercel/middleware.js +8 -5
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas.d.ts +1 -0
- package/package.json +1 -1
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) =>
|
|
110
|
+
processInputs: (inputs) => {
|
|
111
|
+
const typedInputs = inputs;
|
|
112
|
+
return _formatTracedInputs(typedInputs);
|
|
113
|
+
},
|
|
112
114
|
processOutputs: (outputs) => {
|
|
113
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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) =>
|
|
105
|
+
processInputs: (inputs) => {
|
|
106
|
+
const typedInputs = inputs;
|
|
107
|
+
return _formatTracedInputs(typedInputs);
|
|
108
|
+
},
|
|
107
109
|
processOutputs: (outputs) => {
|
|
108
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
6
|
+
export const __version__ = "0.3.57";
|
package/dist/schemas.d.ts
CHANGED