langsmith 0.3.24 → 0.3.25
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/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/vercel.cjs +28 -1
- package/dist/vercel.js +28 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8,4 +8,4 @@ Object.defineProperty(exports, "RunTree", { enumerable: true, get: function () {
|
|
|
8
8
|
var fetch_js_1 = require("./singletons/fetch.cjs");
|
|
9
9
|
Object.defineProperty(exports, "overrideFetchImplementation", { enumerable: true, get: function () { return fetch_js_1.overrideFetchImplementation; } });
|
|
10
10
|
// Update using yarn bump-version
|
|
11
|
-
exports.__version__ = "0.3.
|
|
11
|
+
exports.__version__ = "0.3.25";
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ export { Client, type ClientConfig, type LangSmithTracingClientInterface, } from
|
|
|
2
2
|
export type { Dataset, Example, TracerSession, Run, Feedback, RetrieverOutput, } from "./schemas.js";
|
|
3
3
|
export { RunTree, type RunTreeConfig } from "./run_trees.js";
|
|
4
4
|
export { overrideFetchImplementation } from "./singletons/fetch.js";
|
|
5
|
-
export declare const __version__ = "0.3.
|
|
5
|
+
export declare const __version__ = "0.3.25";
|
package/dist/index.js
CHANGED
package/dist/vercel.cjs
CHANGED
|
@@ -61,9 +61,36 @@ function convertCoreToSmith(message) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
if (part.type === "image") {
|
|
64
|
+
let imageUrl = part.image;
|
|
65
|
+
if (typeof imageUrl !== "string") {
|
|
66
|
+
let uint8Array;
|
|
67
|
+
if (imageUrl != null &&
|
|
68
|
+
typeof imageUrl === "object" &&
|
|
69
|
+
"type" in imageUrl &&
|
|
70
|
+
"data" in imageUrl) {
|
|
71
|
+
// Typing is wrong here if a buffer is passed in
|
|
72
|
+
uint8Array = new Uint8Array(imageUrl.data);
|
|
73
|
+
}
|
|
74
|
+
else if (imageUrl != null &&
|
|
75
|
+
typeof imageUrl === "object" &&
|
|
76
|
+
Object.keys(imageUrl).every((key) => !isNaN(Number(key)))) {
|
|
77
|
+
// ArrayBuffers get turned into objects with numeric keys for some reason
|
|
78
|
+
uint8Array = new Uint8Array(Array.from({
|
|
79
|
+
...imageUrl,
|
|
80
|
+
length: Object.keys(imageUrl).length,
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
if (uint8Array) {
|
|
84
|
+
let binary = "";
|
|
85
|
+
for (let i = 0; i < uint8Array.length; i++) {
|
|
86
|
+
binary += String.fromCharCode(uint8Array[i]);
|
|
87
|
+
}
|
|
88
|
+
imageUrl = btoa(binary);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
64
91
|
return {
|
|
65
92
|
type: "image_url",
|
|
66
|
-
image_url:
|
|
93
|
+
image_url: imageUrl,
|
|
67
94
|
...part.experimental_providerMetadata,
|
|
68
95
|
};
|
|
69
96
|
}
|
package/dist/vercel.js
CHANGED
|
@@ -58,9 +58,36 @@ function convertCoreToSmith(message) {
|
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
if (part.type === "image") {
|
|
61
|
+
let imageUrl = part.image;
|
|
62
|
+
if (typeof imageUrl !== "string") {
|
|
63
|
+
let uint8Array;
|
|
64
|
+
if (imageUrl != null &&
|
|
65
|
+
typeof imageUrl === "object" &&
|
|
66
|
+
"type" in imageUrl &&
|
|
67
|
+
"data" in imageUrl) {
|
|
68
|
+
// Typing is wrong here if a buffer is passed in
|
|
69
|
+
uint8Array = new Uint8Array(imageUrl.data);
|
|
70
|
+
}
|
|
71
|
+
else if (imageUrl != null &&
|
|
72
|
+
typeof imageUrl === "object" &&
|
|
73
|
+
Object.keys(imageUrl).every((key) => !isNaN(Number(key)))) {
|
|
74
|
+
// ArrayBuffers get turned into objects with numeric keys for some reason
|
|
75
|
+
uint8Array = new Uint8Array(Array.from({
|
|
76
|
+
...imageUrl,
|
|
77
|
+
length: Object.keys(imageUrl).length,
|
|
78
|
+
}));
|
|
79
|
+
}
|
|
80
|
+
if (uint8Array) {
|
|
81
|
+
let binary = "";
|
|
82
|
+
for (let i = 0; i < uint8Array.length; i++) {
|
|
83
|
+
binary += String.fromCharCode(uint8Array[i]);
|
|
84
|
+
}
|
|
85
|
+
imageUrl = btoa(binary);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
61
88
|
return {
|
|
62
89
|
type: "image_url",
|
|
63
|
-
image_url:
|
|
90
|
+
image_url: imageUrl,
|
|
64
91
|
...part.experimental_providerMetadata,
|
|
65
92
|
};
|
|
66
93
|
}
|