langsmith 0.5.19 → 0.6.0
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 +460 -22
- package/dist/client.d.ts +165 -1
- package/dist/client.js +464 -26
- package/dist/evaluation/_runner.cjs +4 -7
- package/dist/evaluation/_runner.js +2 -5
- package/dist/evaluation/evaluate_comparative.cjs +10 -10
- package/dist/evaluation/evaluate_comparative.js +1 -1
- package/dist/evaluation/evaluator.cjs +2 -2
- package/dist/evaluation/evaluator.js +1 -1
- package/dist/experimental/anthropic/context.cjs +419 -49
- package/dist/experimental/anthropic/context.js +420 -50
- package/dist/experimental/anthropic/index.cjs +78 -10
- package/dist/experimental/anthropic/index.js +80 -12
- package/dist/experimental/anthropic/messages.cjs +53 -0
- package/dist/experimental/anthropic/messages.d.ts +6 -0
- package/dist/experimental/anthropic/messages.js +52 -0
- package/dist/experimental/anthropic/transcripts.cjs +144 -0
- package/dist/experimental/anthropic/transcripts.d.ts +22 -0
- package/dist/experimental/anthropic/transcripts.js +141 -0
- package/dist/experimental/anthropic/types.d.ts +1 -0
- package/dist/experimental/anthropic/usage.cjs +19 -20
- package/dist/experimental/anthropic/usage.d.ts +2 -1
- package/dist/experimental/anthropic/usage.js +18 -20
- package/dist/experimental/opencode/index.cjs +36 -0
- package/dist/experimental/opencode/index.d.ts +3 -0
- package/dist/experimental/opencode/index.js +32 -0
- package/dist/experimental/opencode/tracer.cjs +389 -0
- package/dist/experimental/opencode/tracer.d.ts +30 -0
- package/dist/experimental/opencode/tracer.js +385 -0
- package/dist/experimental/otel/setup.cjs +1 -1
- package/dist/experimental/otel/setup.js +1 -1
- package/dist/experimental/sandbox/client.cjs +308 -409
- package/dist/experimental/sandbox/client.d.ts +136 -157
- package/dist/experimental/sandbox/client.js +310 -411
- package/dist/experimental/sandbox/errors.cjs +1 -2
- package/dist/experimental/sandbox/errors.d.ts +1 -2
- package/dist/experimental/sandbox/errors.js +1 -2
- package/dist/experimental/sandbox/helpers.cjs +8 -98
- package/dist/experimental/sandbox/helpers.d.ts +0 -29
- package/dist/experimental/sandbox/helpers.js +9 -95
- package/dist/experimental/sandbox/index.cjs +6 -1
- package/dist/experimental/sandbox/index.d.ts +7 -2
- package/dist/experimental/sandbox/index.js +6 -1
- package/dist/experimental/sandbox/sandbox.cjs +71 -13
- package/dist/experimental/sandbox/sandbox.d.ts +39 -9
- package/dist/experimental/sandbox/sandbox.js +71 -13
- package/dist/experimental/sandbox/types.d.ts +147 -137
- package/dist/experimental/vercel/index.cjs +1 -1
- package/dist/experimental/vercel/index.js +1 -1
- package/dist/experimental/vercel/middleware.cjs +2 -1
- package/dist/experimental/vercel/middleware.js +2 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/run_trees.cjs +8 -7
- package/dist/run_trees.d.ts +7 -0
- package/dist/run_trees.js +7 -6
- package/dist/schemas.d.ts +58 -0
- package/dist/singletons/otel.cjs +3 -2
- package/dist/singletons/otel.js +4 -3
- package/dist/singletons/traceable.cjs +1 -3
- package/dist/singletons/traceable.js +1 -3
- package/dist/traceable.cjs +2 -5
- package/dist/traceable.js +2 -5
- package/dist/utils/_git.cjs +2 -2
- package/dist/utils/_git.js +2 -2
- package/dist/utils/_uuid.cjs +2 -2
- package/dist/utils/_uuid.js +1 -1
- package/dist/utils/env.cjs +35 -2
- package/dist/utils/env.d.ts +9 -0
- package/dist/utils/env.js +34 -2
- package/dist/utils/error.cjs +9 -2
- package/dist/utils/error.d.ts +1 -0
- package/dist/utils/error.js +8 -2
- package/dist/utils/fast-safe-stringify/index.cjs +203 -0
- package/dist/utils/fast-safe-stringify/index.d.ts +46 -0
- package/dist/utils/fast-safe-stringify/index.js +202 -0
- package/dist/utils/jestlike/index.cjs +5 -5
- package/dist/utils/jestlike/index.js +1 -1
- package/dist/utils/jestlike/reporter.cjs +1 -1
- package/dist/utils/jestlike/reporter.js +1 -1
- package/dist/utils/jestlike/vendor/chain.cjs +2 -3
- package/dist/utils/jestlike/vendor/chain.js +2 -3
- package/dist/utils/jestlike/vendor/evaluatedBy.cjs +3 -3
- package/dist/utils/jestlike/vendor/evaluatedBy.js +1 -1
- package/dist/utils/prompts.cjs +7 -2
- package/dist/utils/prompts.d.ts +6 -1
- package/dist/utils/prompts.js +6 -1
- package/dist/utils/serialize_worker.cjs +388 -0
- package/dist/utils/serialize_worker.d.ts +66 -0
- package/dist/utils/serialize_worker.js +382 -0
- package/dist/utils/uuid/src/index.cjs +24 -0
- package/dist/utils/uuid/src/index.d.ts +10 -0
- package/dist/utils/uuid/src/index.js +9 -0
- package/dist/utils/uuid/src/max.cjs +3 -0
- package/dist/utils/uuid/src/max.d.ts +2 -0
- package/dist/utils/uuid/src/max.js +1 -0
- package/dist/utils/uuid/src/nil.cjs +3 -0
- package/dist/utils/uuid/src/nil.d.ts +2 -0
- package/dist/utils/uuid/src/nil.js +1 -0
- package/dist/utils/uuid/src/parse.cjs +23 -0
- package/dist/utils/uuid/src/parse.d.ts +3 -0
- package/dist/utils/uuid/src/parse.js +18 -0
- package/dist/utils/uuid/src/regex.cjs +3 -0
- package/dist/utils/uuid/src/regex.d.ts +2 -0
- package/dist/utils/uuid/src/regex.js +1 -0
- package/dist/utils/uuid/src/rng.cjs +10 -0
- package/dist/utils/uuid/src/rng.d.ts +1 -0
- package/dist/utils/uuid/src/rng.js +7 -0
- package/dist/utils/uuid/src/sha1.cjs +75 -0
- package/dist/utils/uuid/src/sha1.d.ts +2 -0
- package/dist/utils/uuid/src/sha1.js +73 -0
- package/dist/utils/uuid/src/stringify.cjs +55 -0
- package/dist/utils/uuid/src/stringify.d.ts +3 -0
- package/dist/utils/uuid/src/stringify.js +49 -0
- package/dist/utils/uuid/src/types.cjs +2 -0
- package/dist/utils/uuid/src/types.d.ts +22 -0
- package/dist/utils/uuid/src/types.js +1 -0
- package/dist/utils/uuid/src/v35.cjs +52 -0
- package/dist/utils/uuid/src/v35.d.ts +7 -0
- package/dist/utils/uuid/src/v35.js +44 -0
- package/dist/utils/uuid/src/v4.cjs +40 -0
- package/dist/utils/uuid/src/v4.d.ts +4 -0
- package/dist/utils/uuid/src/v4.js +35 -0
- package/dist/utils/uuid/src/v5.cjs +50 -0
- package/dist/utils/uuid/src/v5.d.ts +9 -0
- package/dist/utils/uuid/src/v5.js +9 -0
- package/dist/utils/uuid/src/v7.cjs +88 -0
- package/dist/utils/uuid/src/v7.d.ts +9 -0
- package/dist/utils/uuid/src/v7.js +82 -0
- package/dist/utils/uuid/src/validate.cjs +10 -0
- package/dist/utils/uuid/src/validate.d.ts +2 -0
- package/dist/utils/uuid/src/validate.js +5 -0
- package/dist/utils/uuid/src/version.cjs +13 -0
- package/dist/utils/uuid/src/version.d.ts +2 -0
- package/dist/utils/uuid/src/version.js +8 -0
- package/dist/utils/worker_threads.browser.cjs +16 -0
- package/dist/utils/worker_threads.browser.d.ts +14 -0
- package/dist/utils/worker_threads.browser.js +13 -0
- package/dist/utils/worker_threads.cjs +16 -0
- package/dist/utils/worker_threads.d.ts +13 -0
- package/dist/utils/worker_threads.js +13 -0
- package/dist/uuid.cjs +2 -2
- package/dist/uuid.js +1 -1
- package/dist/vitest/utils/esm.mjs +4 -4
- package/dist/wrappers/gemini.cjs +1 -1
- package/dist/wrappers/gemini.js +1 -1
- package/dist/wrappers/openai.cjs +2 -6
- package/dist/wrappers/openai.js +2 -6
- package/dist/wrappers/openai_agents.cjs +849 -0
- package/dist/wrappers/openai_agents.d.ts +92 -0
- package/dist/wrappers/openai_agents.js +845 -0
- package/experimental/opencode.cjs +1 -0
- package/experimental/opencode.d.cts +1 -0
- package/experimental/opencode.d.ts +1 -0
- package/experimental/opencode.js +1 -0
- package/package.json +47 -25
- package/wrappers/openai_agents.cjs +1 -0
- package/wrappers/openai_agents.d.cts +1 -0
- package/wrappers/openai_agents.d.ts +1 -0
- package/wrappers/openai_agents.js +1 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const validate_js_1 = __importDefault(require("./validate.cjs"));
|
|
7
|
+
function version(uuid) {
|
|
8
|
+
if (!(0, validate_js_1.default)(uuid)) {
|
|
9
|
+
throw TypeError("Invalid UUID");
|
|
10
|
+
}
|
|
11
|
+
return parseInt(uuid.slice(14, 15), 16);
|
|
12
|
+
}
|
|
13
|
+
exports.default = version;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* worker_threads abstraction (browser / edge stub).
|
|
4
|
+
*
|
|
5
|
+
* Selected in browser / edge builds via the package.json `browser` field.
|
|
6
|
+
* Worker is null and WORKER_THREADS_AVAILABLE is false, so callers can
|
|
7
|
+
* bail out at construction time without referencing `node:worker_threads`.
|
|
8
|
+
*
|
|
9
|
+
* Intentionally does not import `node:worker_threads` -- bundlers that
|
|
10
|
+
* honor the browser field will never traverse the Node variant, so this
|
|
11
|
+
* file is what determines the browser-bundle surface.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.WORKER_THREADS_AVAILABLE = exports.Worker = void 0;
|
|
15
|
+
exports.Worker = null;
|
|
16
|
+
exports.WORKER_THREADS_AVAILABLE = false;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* worker_threads abstraction (browser / edge stub).
|
|
3
|
+
*
|
|
4
|
+
* Selected in browser / edge builds via the package.json `browser` field.
|
|
5
|
+
* Worker is null and WORKER_THREADS_AVAILABLE is false, so callers can
|
|
6
|
+
* bail out at construction time without referencing `node:worker_threads`.
|
|
7
|
+
*
|
|
8
|
+
* Intentionally does not import `node:worker_threads` -- bundlers that
|
|
9
|
+
* honor the browser field will never traverse the Node variant, so this
|
|
10
|
+
* file is what determines the browser-bundle surface.
|
|
11
|
+
*/
|
|
12
|
+
export type WorkerLike = unknown;
|
|
13
|
+
export declare const Worker: null;
|
|
14
|
+
export declare const WORKER_THREADS_AVAILABLE = false;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* worker_threads abstraction (browser / edge stub).
|
|
3
|
+
*
|
|
4
|
+
* Selected in browser / edge builds via the package.json `browser` field.
|
|
5
|
+
* Worker is null and WORKER_THREADS_AVAILABLE is false, so callers can
|
|
6
|
+
* bail out at construction time without referencing `node:worker_threads`.
|
|
7
|
+
*
|
|
8
|
+
* Intentionally does not import `node:worker_threads` -- bundlers that
|
|
9
|
+
* honor the browser field will never traverse the Node variant, so this
|
|
10
|
+
* file is what determines the browser-bundle surface.
|
|
11
|
+
*/
|
|
12
|
+
export const Worker = null;
|
|
13
|
+
export const WORKER_THREADS_AVAILABLE = false;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* worker_threads abstraction (Node.js version).
|
|
4
|
+
*
|
|
5
|
+
* This file is swapped with worker_threads.browser.ts for browser / edge
|
|
6
|
+
* builds via the package.json `browser` field. Node gets the real module;
|
|
7
|
+
* browsers get a stub that signals unavailability.
|
|
8
|
+
*
|
|
9
|
+
* Only the surface actually used by SerializeWorker is re-exported.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.WORKER_THREADS_AVAILABLE = exports.Worker = void 0;
|
|
13
|
+
// eslint-disable-next-line import/no-unresolved
|
|
14
|
+
const node_worker_threads_1 = require("node:worker_threads");
|
|
15
|
+
exports.Worker = node_worker_threads_1.Worker;
|
|
16
|
+
exports.WORKER_THREADS_AVAILABLE = true;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* worker_threads abstraction (Node.js version).
|
|
3
|
+
*
|
|
4
|
+
* This file is swapped with worker_threads.browser.ts for browser / edge
|
|
5
|
+
* builds via the package.json `browser` field. Node gets the real module;
|
|
6
|
+
* browsers get a stub that signals unavailability.
|
|
7
|
+
*
|
|
8
|
+
* Only the surface actually used by SerializeWorker is re-exported.
|
|
9
|
+
*/
|
|
10
|
+
import { Worker as NodeWorker } from "node:worker_threads";
|
|
11
|
+
export type WorkerLike = InstanceType<typeof NodeWorker>;
|
|
12
|
+
export declare const Worker: typeof NodeWorker | null;
|
|
13
|
+
export declare const WORKER_THREADS_AVAILABLE = true;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* worker_threads abstraction (Node.js version).
|
|
3
|
+
*
|
|
4
|
+
* This file is swapped with worker_threads.browser.ts for browser / edge
|
|
5
|
+
* builds via the package.json `browser` field. Node gets the real module;
|
|
6
|
+
* browsers get a stub that signals unavailability.
|
|
7
|
+
*
|
|
8
|
+
* Only the surface actually used by SerializeWorker is re-exported.
|
|
9
|
+
*/
|
|
10
|
+
// eslint-disable-next-line import/no-unresolved
|
|
11
|
+
import { Worker as NodeWorker } from "node:worker_threads";
|
|
12
|
+
export const Worker = NodeWorker;
|
|
13
|
+
export const WORKER_THREADS_AVAILABLE = true;
|
package/dist/uuid.cjs
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.uuid7FromTime = void 0;
|
|
4
4
|
exports.uuid7 = uuid7;
|
|
5
|
-
const
|
|
5
|
+
const index_js_1 = require("./utils/uuid/src/index.cjs");
|
|
6
6
|
var _uuid_js_1 = require("./utils/_uuid.cjs");
|
|
7
7
|
Object.defineProperty(exports, "uuid7FromTime", { enumerable: true, get: function () { return _uuid_js_1.uuid7FromTime; } });
|
|
8
8
|
/**
|
|
9
9
|
* Generate a random UUID v7 string.
|
|
10
10
|
*/
|
|
11
11
|
function uuid7() {
|
|
12
|
-
return (0,
|
|
12
|
+
return (0, index_js_1.v7)();
|
|
13
13
|
}
|
package/dist/uuid.js
CHANGED
|
@@ -20,9 +20,9 @@ export const importVitestModule = async (entrypoint) => {
|
|
|
20
20
|
const pkg = require(packagePath);
|
|
21
21
|
const pkgDir = packagePath.replace(`${sep}package.json`, "");
|
|
22
22
|
const esmEntry = !entrypoint
|
|
23
|
-
? pkg.module ?? pkg.exports?.["."]?.import ?? "dist/index.js"
|
|
24
|
-
: pkg.exports?.[`./${entrypoint}`]?.import ??
|
|
25
|
-
pkg.exports?.[`./${entrypoint}`]?.default;
|
|
23
|
+
? (pkg.module ?? pkg.exports?.["."]?.import ?? "dist/index.js")
|
|
24
|
+
: (pkg.exports?.[`./${entrypoint}`]?.import ??
|
|
25
|
+
pkg.exports?.[`./${entrypoint}`]?.default);
|
|
26
26
|
const modulePath = `${pkgDir}${sep}${esmEntry}`;
|
|
27
27
|
const path = pathToFileURL(modulePath).href;
|
|
28
28
|
importedModule = await import(path);
|
|
@@ -31,7 +31,7 @@ export const importVitestModule = async (entrypoint) => {
|
|
|
31
31
|
}
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
33
|
}
|
|
34
|
-
catch (
|
|
34
|
+
catch (_error) {
|
|
35
35
|
importedModule = await import(`vitest${entrypoint ? `/${entrypoint}` : ""}`);
|
|
36
36
|
}
|
|
37
37
|
return importedModule;
|
package/dist/wrappers/gemini.cjs
CHANGED
|
@@ -190,7 +190,7 @@ function processGeminiInputs(inputs) {
|
|
|
190
190
|
return "parts" in item && Array.isArray(item.parts);
|
|
191
191
|
};
|
|
192
192
|
const role = "role" in content ? content.role : "user";
|
|
193
|
-
const parts = isContent(content) ? content.parts ?? [] : [content];
|
|
193
|
+
const parts = isContent(content) ? (content.parts ?? []) : [content];
|
|
194
194
|
const textParts = [];
|
|
195
195
|
const contentParts = [];
|
|
196
196
|
for (const part of parts) {
|
package/dist/wrappers/gemini.js
CHANGED
|
@@ -187,7 +187,7 @@ function processGeminiInputs(inputs) {
|
|
|
187
187
|
return "parts" in item && Array.isArray(item.parts);
|
|
188
188
|
};
|
|
189
189
|
const role = "role" in content ? content.role : "user";
|
|
190
|
-
const parts = isContent(content) ? content.parts ?? [] : [content];
|
|
190
|
+
const parts = isContent(content) ? (content.parts ?? []) : [content];
|
|
191
191
|
const textParts = [];
|
|
192
192
|
const contentParts = [];
|
|
193
193
|
for (const part of parts) {
|
package/dist/wrappers/openai.cjs
CHANGED
|
@@ -25,9 +25,7 @@ const TRACED_INVOCATION_KEYS = [
|
|
|
25
25
|
"verbosity",
|
|
26
26
|
"web_search_options",
|
|
27
27
|
];
|
|
28
|
-
function _combineChatCompletionChoices(choices
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
-
) {
|
|
28
|
+
function _combineChatCompletionChoices(choices) {
|
|
31
29
|
const reversedChoices = choices.slice().reverse();
|
|
32
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
31
|
const message = {
|
|
@@ -130,9 +128,7 @@ const responsesAggregator = (events) => {
|
|
|
130
128
|
// If no completed event found, return the last event
|
|
131
129
|
return events[events.length - 1] || {};
|
|
132
130
|
};
|
|
133
|
-
const textAggregator = (allChunks
|
|
134
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
135
|
-
) => {
|
|
131
|
+
const textAggregator = (allChunks) => {
|
|
136
132
|
if (allChunks.length === 0) {
|
|
137
133
|
return { choices: [{ text: "" }] };
|
|
138
134
|
}
|
package/dist/wrappers/openai.js
CHANGED
|
@@ -22,9 +22,7 @@ const TRACED_INVOCATION_KEYS = [
|
|
|
22
22
|
"verbosity",
|
|
23
23
|
"web_search_options",
|
|
24
24
|
];
|
|
25
|
-
function _combineChatCompletionChoices(choices
|
|
26
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
-
) {
|
|
25
|
+
function _combineChatCompletionChoices(choices) {
|
|
28
26
|
const reversedChoices = choices.slice().reverse();
|
|
29
27
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
28
|
const message = {
|
|
@@ -127,9 +125,7 @@ const responsesAggregator = (events) => {
|
|
|
127
125
|
// If no completed event found, return the last event
|
|
128
126
|
return events[events.length - 1] || {};
|
|
129
127
|
};
|
|
130
|
-
const textAggregator = (allChunks
|
|
131
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
132
|
-
) => {
|
|
128
|
+
const textAggregator = (allChunks) => {
|
|
133
129
|
if (allChunks.length === 0) {
|
|
134
130
|
return { choices: [{ text: "" }] };
|
|
135
131
|
}
|