langsmith 0.10.7 → 0.10.9
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/_openapi_client/client.cjs +26 -2
- package/dist/_openapi_client/client.d.ts +15 -6
- package/dist/_openapi_client/client.js +27 -3
- package/dist/_openapi_client/internal/detect-platform.cjs +1 -1
- package/dist/_openapi_client/internal/detect-platform.js +1 -1
- package/dist/_openapi_client/resources/annotation-queues/items.cjs +13 -6
- package/dist/_openapi_client/resources/annotation-queues/items.d.ts +33 -8
- package/dist/_openapi_client/resources/annotation-queues/items.js +13 -6
- package/dist/_openapi_client/resources/datasets/datasets.cjs +9 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +4 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +9 -0
- package/dist/_openapi_client/resources/datasets/examples.cjs +26 -0
- package/dist/_openapi_client/resources/datasets/examples.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/examples.js +22 -0
- package/dist/_openapi_client/resources/fleet/fleet.cjs +54 -0
- package/dist/_openapi_client/resources/fleet/fleet.d.ts +9 -0
- package/dist/_openapi_client/resources/fleet/fleet.js +17 -0
- package/dist/_openapi_client/resources/fleet/threads.cjs +18 -0
- package/dist/_openapi_client/resources/fleet/threads.d.ts +19 -0
- package/dist/_openapi_client/resources/fleet/threads.js +14 -0
- package/dist/_openapi_client/resources/index.cjs +8 -2
- package/dist/_openapi_client/resources/index.d.ts +6 -3
- package/dist/_openapi_client/resources/index.js +5 -2
- package/dist/_openapi_client/resources/info.d.ts +6 -0
- package/dist/_openapi_client/resources/issues.cjs +2 -2
- package/dist/_openapi_client/resources/issues.d.ts +188 -4
- package/dist/_openapi_client/resources/issues.js +2 -2
- package/dist/_openapi_client/resources/online-evaluators.cjs +7 -4
- package/dist/_openapi_client/resources/online-evaluators.d.ts +63 -4
- package/dist/_openapi_client/resources/online-evaluators.js +7 -4
- package/dist/_openapi_client/resources/product-feedback.cjs +33 -0
- package/dist/_openapi_client/resources/product-feedback.d.ts +77 -0
- package/dist/_openapi_client/resources/product-feedback.js +29 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +26 -16
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +44 -4
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +256 -21
- package/dist/_openapi_client/resources/sandboxes/boxes.js +44 -4
- package/dist/_openapi_client/resources/sandboxes/registries.d.ts +10 -2
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +169 -14
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +13 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +10 -6
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +37 -6
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +10 -6
- package/dist/_openapi_client/resources/sessions.cjs +23 -0
- package/dist/_openapi_client/resources/sessions.d.ts +732 -0
- package/dist/_openapi_client/resources/sessions.js +19 -0
- package/dist/_openapi_client/resources/threads/index.cjs +9 -0
- package/dist/_openapi_client/resources/threads/index.d.ts +2 -0
- package/dist/_openapi_client/resources/threads/index.js +4 -0
- package/dist/_openapi_client/resources/threads/share.cjs +61 -0
- package/dist/_openapi_client/resources/threads/share.d.ts +71 -0
- package/dist/_openapi_client/resources/threads/share.js +57 -0
- package/dist/_openapi_client/resources/threads/threads.cjs +143 -0
- package/dist/_openapi_client/resources/threads/threads.d.ts +973 -0
- package/dist/_openapi_client/resources/threads/threads.js +106 -0
- package/dist/_openapi_client/resources/threads.cjs +15 -67
- package/dist/_openapi_client/resources/threads.d.ts +1 -709
- package/dist/_openapi_client/resources/threads.js +1 -65
- package/dist/_openapi_client/resources/traces.d.ts +7 -1
- package/dist/_openapi_client/version.cjs +1 -1
- package/dist/_openapi_client/version.js +1 -1
- package/dist/address.cjs +176 -99
- package/dist/address.d.ts +63 -8
- package/dist/address.js +170 -90
- package/dist/anonymizer/index.cjs +1 -1
- package/dist/anonymizer/index.js +1 -1
- package/dist/client.cjs +39 -19
- package/dist/client.d.ts +20 -4
- package/dist/client.js +34 -14
- package/dist/experimental/otel/exporter.cjs +21 -4
- package/dist/experimental/otel/exporter.d.ts +4 -2
- package/dist/experimental/otel/exporter.js +21 -4
- package/dist/index.cjs +5 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/run_trees.cjs +26 -43
- package/dist/run_trees.d.ts +4 -4
- package/dist/run_trees.js +23 -40
- package/dist/sandbox/client.cjs +33 -4
- package/dist/sandbox/client.d.ts +4 -0
- package/dist/sandbox/client.js +34 -5
- package/dist/sandbox/command_handle.cjs +8 -0
- package/dist/sandbox/command_handle.js +8 -0
- package/dist/sandbox/sandbox.cjs +7 -0
- package/dist/sandbox/sandbox.js +7 -0
- package/dist/sandbox/service_url.cjs +9 -1
- package/dist/sandbox/service_url.d.ts +2 -1
- package/dist/sandbox/service_url.js +9 -1
- package/dist/sandbox/tracing.cjs +13 -0
- package/dist/sandbox/tracing.d.ts +1 -0
- package/dist/sandbox/tracing.js +10 -0
- package/dist/schemas.d.ts +3 -3
- package/dist/traceable.cjs +5 -4
- package/dist/traceable.js +4 -3
- package/dist/utils/{agent_addressing.cjs → addressing.cjs} +22 -23
- package/dist/utils/{agent_addressing.d.ts → addressing.d.ts} +5 -8
- package/dist/utils/{agent_addressing.js → addressing.js} +23 -23
- package/dist/utils/env.cjs +6 -4
- package/dist/utils/env.js +6 -4
- package/package.json +1 -1
|
@@ -1,19 +1,10 @@
|
|
|
1
|
-
import { EnvAddressError,
|
|
1
|
+
import { AgentAddress, EnvAddressError, ensureAgent, envNames, } from "../address.js";
|
|
2
2
|
import { getEnvironmentVariable, getLangSmithEnvironmentVariable, } from "./env.js";
|
|
3
3
|
import { warnOnce } from "./warn.js";
|
|
4
|
-
function isRendered(value) {
|
|
5
|
-
return (value != null &&
|
|
6
|
-
typeof value === "object" &&
|
|
7
|
-
"kind" in value);
|
|
8
|
-
}
|
|
9
|
-
/** Validate an address at an entry point; the SDK carries the frozen copy. */
|
|
10
|
-
export function checkAddress(address) {
|
|
11
|
-
return address == null ? undefined : normalizeAddress(address);
|
|
12
|
-
}
|
|
13
4
|
export function rejectConflicting(project, address) {
|
|
14
5
|
if (project && address) {
|
|
15
6
|
throw new Error(`A run is sent to a project (${JSON.stringify(project)}) or to an ` +
|
|
16
|
-
|
|
7
|
+
"address, not both.");
|
|
17
8
|
}
|
|
18
9
|
}
|
|
19
10
|
/** The highest level naming a project or an address, whichever it names. */
|
|
@@ -37,7 +28,7 @@ function getEnvProject() {
|
|
|
37
28
|
*/
|
|
38
29
|
export function resolveFromEnv() {
|
|
39
30
|
const project = getEnvProject();
|
|
40
|
-
const address =
|
|
31
|
+
const address = AgentAddress.fromEnv();
|
|
41
32
|
if (project && address) {
|
|
42
33
|
throw new EnvAddressError("LANGSMITH_AGENT_* and a project are both set in the environment.");
|
|
43
34
|
}
|
|
@@ -60,30 +51,39 @@ export function warnOnEnv() {
|
|
|
60
51
|
}
|
|
61
52
|
}
|
|
62
53
|
/**
|
|
63
|
-
*
|
|
64
|
-
* naming no project takes the env address.
|
|
65
|
-
* re-prepared when batched) are left alone.
|
|
54
|
+
* Put the run's address in its payload field, in its wire form.
|
|
55
|
+
* Without one, a create naming no project takes the env address.
|
|
66
56
|
*
|
|
67
57
|
* @throws {EnvAddressError} If the env names half an address.
|
|
68
58
|
*/
|
|
69
59
|
export function applyToPayload(run, { update = false } = {}) {
|
|
70
60
|
const payload = run;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
let address;
|
|
62
|
+
if (typeof payload.address === "string") {
|
|
63
|
+
// Wire data already applied: a queued run is applied again when its batch
|
|
64
|
+
// is sent. It is parsed again, so a malformed one cannot fail the whole
|
|
65
|
+
// batch in the backend.
|
|
66
|
+
try {
|
|
67
|
+
address = AgentAddress._fromLrn(payload.address);
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
throw new Error("The run's `address` is not a valid agent address.");
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
address = ensureAgent(payload.address);
|
|
76
75
|
}
|
|
76
|
+
delete payload.address;
|
|
77
77
|
const namedProject = payload.session_id != null || payload.session_name != null;
|
|
78
|
-
if (!address && !update && !namedProject
|
|
79
|
-
address =
|
|
78
|
+
if (!address && !update && !namedProject) {
|
|
79
|
+
address = AgentAddress.fromEnv();
|
|
80
80
|
}
|
|
81
81
|
if (!address) {
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
84
84
|
warnOnce("Sending runs to an `address` is in beta and enabled per workspace; a " +
|
|
85
85
|
"workspace without it rejects the runs.");
|
|
86
|
-
|
|
86
|
+
payload.address = address._toLrn();
|
|
87
87
|
if (!namedProject) {
|
|
88
88
|
delete payload.session_name;
|
|
89
89
|
delete payload.session_id;
|
package/dist/utils/env.cjs
CHANGED
|
@@ -120,14 +120,16 @@ function getLangSmithEnvVarsMetadata() {
|
|
|
120
120
|
if (typeof value === "string" &&
|
|
121
121
|
!excluded.includes(key) &&
|
|
122
122
|
!isSensitiveEnvVarName(key)) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
123
|
+
// LANGCHAIN_REVISION_ID is the legacy name for LANGSMITH_REVISION_ID.
|
|
124
|
+
if (key !== "LANGSMITH_REVISION_ID" && key !== "LANGCHAIN_REVISION_ID") {
|
|
127
125
|
envVars[key] = value;
|
|
128
126
|
}
|
|
129
127
|
}
|
|
130
128
|
}
|
|
129
|
+
const revisionId = allEnvVars.LANGSMITH_REVISION_ID || allEnvVars.LANGCHAIN_REVISION_ID;
|
|
130
|
+
if (revisionId) {
|
|
131
|
+
envVars["revision_id"] = revisionId;
|
|
132
|
+
}
|
|
131
133
|
return envVars;
|
|
132
134
|
}
|
|
133
135
|
/**
|
package/dist/utils/env.js
CHANGED
|
@@ -102,14 +102,16 @@ export function getLangSmithEnvVarsMetadata() {
|
|
|
102
102
|
if (typeof value === "string" &&
|
|
103
103
|
!excluded.includes(key) &&
|
|
104
104
|
!isSensitiveEnvVarName(key)) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
105
|
+
// LANGCHAIN_REVISION_ID is the legacy name for LANGSMITH_REVISION_ID.
|
|
106
|
+
if (key !== "LANGSMITH_REVISION_ID" && key !== "LANGCHAIN_REVISION_ID") {
|
|
109
107
|
envVars[key] = value;
|
|
110
108
|
}
|
|
111
109
|
}
|
|
112
110
|
}
|
|
111
|
+
const revisionId = allEnvVars.LANGSMITH_REVISION_ID || allEnvVars.LANGCHAIN_REVISION_ID;
|
|
112
|
+
if (revisionId) {
|
|
113
|
+
envVars["revision_id"] = revisionId;
|
|
114
|
+
}
|
|
113
115
|
return envVars;
|
|
114
116
|
}
|
|
115
117
|
/**
|