langsmith 0.7.7 → 0.7.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/README.md +161 -15
- package/dist/_openapi_client/client.cjs +814 -0
- package/dist/_openapi_client/client.d.ts +247 -0
- package/dist/_openapi_client/client.js +777 -0
- package/dist/_openapi_client/core/api-promise.cjs +100 -0
- package/dist/_openapi_client/core/api-promise.d.ts +45 -0
- package/dist/_openapi_client/core/api-promise.js +96 -0
- package/dist/_openapi_client/core/error.cjs +134 -0
- package/dist/_openapi_client/core/error.d.ts +45 -0
- package/dist/_openapi_client/core/error.js +118 -0
- package/dist/_openapi_client/core/pagination.cjs +374 -0
- package/dist/_openapi_client/core/pagination.d.ts +157 -0
- package/dist/_openapi_client/core/pagination.js +361 -0
- package/dist/_openapi_client/core/resource.cjs +17 -0
- package/dist/_openapi_client/core/resource.d.ts +5 -0
- package/dist/_openapi_client/core/resource.js +13 -0
- package/dist/_openapi_client/core/uploads.cjs +5 -0
- package/dist/_openapi_client/core/uploads.d.ts +2 -0
- package/dist/_openapi_client/core/uploads.js +1 -0
- package/dist/_openapi_client/index.cjs +29 -0
- package/dist/_openapi_client/index.d.ts +6 -0
- package/dist/_openapi_client/index.js +8 -0
- package/dist/_openapi_client/internal/builtin-types.cjs +4 -0
- package/dist/_openapi_client/internal/builtin-types.d.ts +72 -0
- package/dist/_openapi_client/internal/builtin-types.js +3 -0
- package/dist/_openapi_client/internal/detect-platform.cjs +162 -0
- package/dist/_openapi_client/internal/detect-platform.d.ts +14 -0
- package/dist/_openapi_client/internal/detect-platform.js +157 -0
- package/dist/_openapi_client/internal/errors.cjs +41 -0
- package/dist/_openapi_client/internal/errors.d.ts +2 -0
- package/dist/_openapi_client/internal/errors.js +36 -0
- package/dist/_openapi_client/internal/headers.cjs +79 -0
- package/dist/_openapi_client/internal/headers.d.ts +5 -0
- package/dist/_openapi_client/internal/headers.js +74 -0
- package/dist/_openapi_client/internal/parse.cjs +40 -0
- package/dist/_openapi_client/internal/parse.d.ts +11 -0
- package/dist/_openapi_client/internal/parse.js +37 -0
- package/dist/_openapi_client/internal/qs/formats.cjs +12 -0
- package/dist/_openapi_client/internal/qs/formats.d.ts +6 -0
- package/dist/_openapi_client/internal/qs/formats.js +8 -0
- package/dist/_openapi_client/internal/qs/stringify.cjs +277 -0
- package/dist/_openapi_client/internal/qs/stringify.d.ts +2 -0
- package/dist/_openapi_client/internal/qs/stringify.js +274 -0
- package/dist/_openapi_client/internal/qs/types.cjs +2 -0
- package/dist/_openapi_client/internal/qs/types.d.ts +56 -0
- package/dist/_openapi_client/internal/qs/types.js +1 -0
- package/dist/_openapi_client/internal/qs/utils.cjs +230 -0
- package/dist/_openapi_client/internal/qs/utils.d.ts +14 -0
- package/dist/_openapi_client/internal/qs/utils.js +217 -0
- package/dist/_openapi_client/internal/request-options.cjs +14 -0
- package/dist/_openapi_client/internal/request-options.d.ts +74 -0
- package/dist/_openapi_client/internal/request-options.js +10 -0
- package/dist/_openapi_client/internal/shim-types.cjs +4 -0
- package/dist/_openapi_client/internal/shim-types.d.ts +16 -0
- package/dist/_openapi_client/internal/shim-types.js +3 -0
- package/dist/_openapi_client/internal/shims.cjs +92 -0
- package/dist/_openapi_client/internal/shims.d.ts +25 -0
- package/dist/_openapi_client/internal/shims.js +85 -0
- package/dist/_openapi_client/internal/to-file.cjs +91 -0
- package/dist/_openapi_client/internal/to-file.d.ts +44 -0
- package/dist/_openapi_client/internal/to-file.js +88 -0
- package/dist/_openapi_client/internal/types.cjs +4 -0
- package/dist/_openapi_client/internal/types.d.ts +62 -0
- package/dist/_openapi_client/internal/types.js +3 -0
- package/dist/_openapi_client/internal/uploads.cjs +140 -0
- package/dist/_openapi_client/internal/uploads.d.ts +41 -0
- package/dist/_openapi_client/internal/uploads.js +130 -0
- package/dist/_openapi_client/internal/utils/env.cjs +22 -0
- package/dist/_openapi_client/internal/utils/env.d.ts +8 -0
- package/dist/_openapi_client/internal/utils/env.js +18 -0
- package/dist/_openapi_client/internal/utils/log.cjs +88 -0
- package/dist/_openapi_client/internal/utils/log.d.ts +36 -0
- package/dist/_openapi_client/internal/utils/log.js +82 -0
- package/dist/_openapi_client/internal/utils/path.cjs +79 -0
- package/dist/_openapi_client/internal/utils/path.d.ts +14 -0
- package/dist/_openapi_client/internal/utils/path.js +74 -0
- package/dist/_openapi_client/internal/utils/query.cjs +42 -0
- package/dist/_openapi_client/internal/utils/query.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/query.js +6 -0
- package/dist/_openapi_client/internal/utils/sleep.cjs +7 -0
- package/dist/_openapi_client/internal/utils/sleep.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/sleep.js +3 -0
- package/dist/_openapi_client/internal/utils/uuid.cjs +19 -0
- package/dist/_openapi_client/internal/utils/uuid.d.ts +4 -0
- package/dist/_openapi_client/internal/utils/uuid.js +15 -0
- package/dist/_openapi_client/internal/utils/values.cjs +112 -0
- package/dist/_openapi_client/internal/utils/values.d.ts +17 -0
- package/dist/_openapi_client/internal/utils/values.js +94 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +138 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +367 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +101 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.cjs +46 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +128 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.js +42 -0
- package/dist/_openapi_client/resources/commits.cjs +44 -0
- package/dist/_openapi_client/resources/commits.d.ts +204 -0
- package/dist/_openapi_client/resources/commits.js +40 -0
- package/dist/_openapi_client/resources/datasets/comparative.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/comparative.d.ts +55 -0
- package/dist/_openapi_client/resources/datasets/comparative.js +18 -0
- package/dist/_openapi_client/resources/datasets/datasets.cjs +193 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +374 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +156 -0
- package/dist/_openapi_client/resources/datasets/experiments.cjs +16 -0
- package/dist/_openapi_client/resources/datasets/experiments.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/experiments.js +12 -0
- package/dist/_openapi_client/resources/datasets/group.cjs +17 -0
- package/dist/_openapi_client/resources/datasets/group.d.ts +160 -0
- package/dist/_openapi_client/resources/datasets/group.js +13 -0
- package/dist/_openapi_client/resources/datasets/runs.cjs +29 -0
- package/dist/_openapi_client/resources/datasets/runs.d.ts +216 -0
- package/dist/_openapi_client/resources/datasets/runs.js +25 -0
- package/dist/_openapi_client/resources/datasets/share.cjs +32 -0
- package/dist/_openapi_client/resources/datasets/share.d.ts +28 -0
- package/dist/_openapi_client/resources/datasets/share.js +28 -0
- package/dist/_openapi_client/resources/datasets/splits.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/splits.d.ts +30 -0
- package/dist/_openapi_client/resources/datasets/splits.js +18 -0
- package/dist/_openapi_client/resources/datasets/versions.cjs +23 -0
- package/dist/_openapi_client/resources/datasets/versions.d.ts +36 -0
- package/dist/_openapi_client/resources/datasets/versions.js +19 -0
- package/dist/_openapi_client/resources/evaluators.cjs +15 -0
- package/dist/_openapi_client/resources/evaluators.d.ts +125 -0
- package/dist/_openapi_client/resources/evaluators.js +11 -0
- package/dist/_openapi_client/resources/examples/bulk.cjs +24 -0
- package/dist/_openapi_client/resources/examples/bulk.d.ts +78 -0
- package/dist/_openapi_client/resources/examples/bulk.js +20 -0
- package/dist/_openapi_client/resources/examples/examples.cjs +124 -0
- package/dist/_openapi_client/resources/examples/examples.d.ts +182 -0
- package/dist/_openapi_client/resources/examples/examples.js +87 -0
- package/dist/_openapi_client/resources/examples/validate.cjs +21 -0
- package/dist/_openapi_client/resources/examples/validate.d.ts +38 -0
- package/dist/_openapi_client/resources/examples/validate.js +17 -0
- package/dist/_openapi_client/resources/feedback/configs.cjs +24 -0
- package/dist/_openapi_client/resources/feedback/configs.d.ts +18 -0
- package/dist/_openapi_client/resources/feedback/configs.js +20 -0
- package/dist/_openapi_client/resources/feedback/feedback.cjs +98 -0
- package/dist/_openapi_client/resources/feedback/feedback.d.ts +275 -0
- package/dist/_openapi_client/resources/feedback/feedback.js +61 -0
- package/dist/_openapi_client/resources/feedback/tokens.cjs +35 -0
- package/dist/_openapi_client/resources/feedback/tokens.d.ts +130 -0
- package/dist/_openapi_client/resources/feedback/tokens.js +31 -0
- package/dist/_openapi_client/resources/index.cjs +35 -0
- package/dist/_openapi_client/resources/index.d.ts +15 -0
- package/dist/_openapi_client/resources/index.js +17 -0
- package/dist/_openapi_client/resources/info.cjs +15 -0
- package/dist/_openapi_client/resources/info.d.ts +51 -0
- package/dist/_openapi_client/resources/info.js +11 -0
- package/dist/_openapi_client/resources/online-evaluators.cjs +70 -0
- package/dist/_openapi_client/resources/online-evaluators.d.ts +284 -0
- package/dist/_openapi_client/resources/online-evaluators.js +66 -0
- package/dist/_openapi_client/resources/public/datasets.cjs +47 -0
- package/dist/_openapi_client/resources/public/datasets.d.ts +152 -0
- package/dist/_openapi_client/resources/public/datasets.js +43 -0
- package/dist/_openapi_client/resources/public/public.cjs +62 -0
- package/dist/_openapi_client/resources/public/public.d.ts +32 -0
- package/dist/_openapi_client/resources/public/public.js +25 -0
- package/dist/_openapi_client/resources/repos/directories.cjs +40 -0
- package/dist/_openapi_client/resources/repos/directories.d.ts +72 -0
- package/dist/_openapi_client/resources/repos/directories.js +36 -0
- package/dist/_openapi_client/resources/repos/repos.cjs +93 -0
- package/dist/_openapi_client/resources/repos/repos.d.ts +188 -0
- package/dist/_openapi_client/resources/repos/repos.js +56 -0
- package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
- package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
- package/dist/_openapi_client/resources/runs/rules.js +5 -0
- package/dist/_openapi_client/resources/runs/runs.cjs +102 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +542 -0
- package/dist/_openapi_client/resources/runs/runs.js +65 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +1121 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +63 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +26 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +130 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
- package/dist/_openapi_client/resources/sessions/insights.cjs +54 -0
- package/dist/_openapi_client/resources/sessions/insights.d.ts +246 -0
- package/dist/_openapi_client/resources/sessions/insights.js +50 -0
- package/dist/_openapi_client/resources/sessions/sessions.cjs +109 -0
- package/dist/_openapi_client/resources/sessions/sessions.d.ts +674 -0
- package/dist/_openapi_client/resources/sessions/sessions.js +72 -0
- package/dist/_openapi_client/resources/settings.cjs +15 -0
- package/dist/_openapi_client/resources/settings.d.ts +18 -0
- package/dist/_openapi_client/resources/settings.js +11 -0
- package/dist/_openapi_client/resources/workspaces.cjs +35 -0
- package/dist/_openapi_client/resources/workspaces.d.ts +84 -0
- package/dist/_openapi_client/resources/workspaces.js +31 -0
- package/dist/_openapi_client/version.cjs +5 -0
- package/dist/_openapi_client/version.d.ts +1 -0
- package/dist/_openapi_client/version.js +2 -0
- package/dist/client.cjs +48 -19
- package/dist/client.d.ts +5 -0
- package/dist/client.js +29 -0
- package/dist/env.cjs +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/env.js +1 -1
- package/dist/evaluation/_runner.cjs +31 -3
- package/dist/evaluation/_runner.d.ts +2 -0
- package/dist/evaluation/_runner.js +30 -4
- package/dist/experimental/otel/exporter.cjs +1 -1
- package/dist/experimental/otel/exporter.js +2 -2
- package/dist/experimental/vercel/telemetry.cjs +1 -1
- package/dist/experimental/vercel/telemetry.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/run_trees.cjs +1 -1
- package/dist/run_trees.js +2 -2
- package/dist/sandbox/client.cjs +11 -3
- package/dist/sandbox/client.js +11 -3
- package/dist/sandbox/errors.cjs +2 -1
- package/dist/sandbox/errors.d.ts +2 -1
- package/dist/sandbox/errors.js +2 -1
- package/dist/sandbox/index.cjs +8 -2
- package/dist/sandbox/index.d.ts +3 -2
- package/dist/sandbox/index.js +2 -1
- package/dist/sandbox/mounts.cjs +114 -0
- package/dist/sandbox/mounts.d.ts +24 -0
- package/dist/sandbox/mounts.js +109 -0
- package/dist/sandbox/proxy_config.cjs +90 -5
- package/dist/sandbox/proxy_config.d.ts +19 -4
- package/dist/sandbox/proxy_config.js +86 -4
- package/dist/sandbox/types.d.ts +92 -3
- package/dist/traceable.cjs +1 -1
- package/dist/traceable.js +2 -2
- package/dist/utils/guard.cjs +13 -0
- package/dist/utils/guard.d.ts +6 -0
- package/dist/utils/guard.js +10 -0
- package/dist/utils/jestlike/globals.cjs +1 -1
- package/dist/utils/jestlike/globals.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
import { APIResource } from '../../core/resource.js';
|
|
4
|
+
import * as InsightsAPI from './insights.js';
|
|
5
|
+
import { Insights, } from './insights.js';
|
|
6
|
+
import { OffsetPaginationTopLevelArray, } from '../../core/pagination.js';
|
|
7
|
+
import { buildHeaders } from '../../internal/headers.js';
|
|
8
|
+
import { path } from '../../internal/utils/path.js';
|
|
9
|
+
export class Sessions extends APIResource {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
Object.defineProperty(this, "insights", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: new InsightsAPI.Insights(this._client)
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a new session.
|
|
21
|
+
*/
|
|
22
|
+
create(params, options) {
|
|
23
|
+
const { upsert, ...body } = params;
|
|
24
|
+
return this._client.post('/api/v1/sessions', { query: { upsert }, body, ...options });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get a specific session.
|
|
28
|
+
*/
|
|
29
|
+
retrieve(sessionID, params = {}, options) {
|
|
30
|
+
const { accept, ...query } = params ?? {};
|
|
31
|
+
return this._client.get(path `/api/v1/sessions/${sessionID}`, {
|
|
32
|
+
query,
|
|
33
|
+
...options,
|
|
34
|
+
headers: buildHeaders([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Update a session.
|
|
39
|
+
*/
|
|
40
|
+
update(sessionID, body, options) {
|
|
41
|
+
return this._client.patch(path `/api/v1/sessions/${sessionID}`, { body, ...options });
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Get all sessions.
|
|
45
|
+
*/
|
|
46
|
+
list(params = {}, options) {
|
|
47
|
+
const { accept, ...query } = params ?? {};
|
|
48
|
+
return this._client.getAPIList('/api/v1/sessions', (OffsetPaginationTopLevelArray), {
|
|
49
|
+
query,
|
|
50
|
+
...options,
|
|
51
|
+
headers: buildHeaders([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Delete a specific session.
|
|
56
|
+
*/
|
|
57
|
+
delete(sessionID, options) {
|
|
58
|
+
return this._client.delete(path `/api/v1/sessions/${sessionID}`, options);
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Get a prebuilt dashboard for a tracing project.
|
|
62
|
+
*/
|
|
63
|
+
dashboard(sessionID, params, options) {
|
|
64
|
+
const { accept, ...body } = params;
|
|
65
|
+
return this._client.post(path `/api/v1/sessions/${sessionID}/dashboard`, {
|
|
66
|
+
body,
|
|
67
|
+
...options,
|
|
68
|
+
headers: buildHeaders([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
Sessions.Insights = Insights;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Settings = void 0;
|
|
6
|
+
const resource_js_1 = require("../core/resource.cjs");
|
|
7
|
+
class Settings extends resource_js_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get settings.
|
|
10
|
+
*/
|
|
11
|
+
list(options) {
|
|
12
|
+
return this._client.get('/api/v1/settings', options);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.Settings = Settings;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { APIResource } from '../core/resource.js';
|
|
2
|
+
import { APIPromise } from '../core/api-promise.js';
|
|
3
|
+
import { RequestOptions } from '../internal/request-options.js';
|
|
4
|
+
export declare class Settings extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get settings.
|
|
7
|
+
*/
|
|
8
|
+
list(options?: RequestOptions): APIPromise<AppHubCrudTenantsTenant>;
|
|
9
|
+
}
|
|
10
|
+
export interface AppHubCrudTenantsTenant {
|
|
11
|
+
id: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
display_name: string;
|
|
14
|
+
tenant_handle?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare namespace Settings {
|
|
17
|
+
export { type AppHubCrudTenantsTenant as AppHubCrudTenantsTenant };
|
|
18
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
import { APIResource } from '../core/resource.js';
|
|
4
|
+
export class Settings extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Get settings.
|
|
7
|
+
*/
|
|
8
|
+
list(options) {
|
|
9
|
+
return this._client.get('/api/v1/settings', options);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Workspaces = void 0;
|
|
6
|
+
const resource_js_1 = require("../core/resource.cjs");
|
|
7
|
+
const path_js_1 = require("../internal/utils/path.cjs");
|
|
8
|
+
class Workspaces extends resource_js_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Create a new workspace.
|
|
11
|
+
*/
|
|
12
|
+
create(body, options) {
|
|
13
|
+
return this._client.post('/api/v1/workspaces', { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Update a workspace.
|
|
17
|
+
*/
|
|
18
|
+
update(workspaceID, body, options) {
|
|
19
|
+
return this._client.patch((0, path_js_1.path) `/api/v1/workspaces/${workspaceID}`, { body, ...options });
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get all workspaces visible to this auth in the current org. Does not create a
|
|
23
|
+
* new workspace/org.
|
|
24
|
+
*/
|
|
25
|
+
list(query = {}, options) {
|
|
26
|
+
return this._client.get('/api/v1/workspaces', { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Delete Workspace
|
|
30
|
+
*/
|
|
31
|
+
delete(workspaceID, options) {
|
|
32
|
+
return this._client.delete((0, path_js_1.path) `/api/v1/workspaces/${workspaceID}`, options);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.Workspaces = Workspaces;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { APIResource } from '../core/resource.js';
|
|
2
|
+
import { APIPromise } from '../core/api-promise.js';
|
|
3
|
+
import { RequestOptions } from '../internal/request-options.js';
|
|
4
|
+
export declare class Workspaces extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Create a new workspace.
|
|
7
|
+
*/
|
|
8
|
+
create(body: WorkspaceCreateParams, options?: RequestOptions): APIPromise<WorkspaceCreateResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Update a workspace.
|
|
11
|
+
*/
|
|
12
|
+
update(workspaceID: string, body: WorkspaceUpdateParams, options?: RequestOptions): APIPromise<WorkspaceUpdateResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Get all workspaces visible to this auth in the current org. Does not create a
|
|
15
|
+
* new workspace/org.
|
|
16
|
+
*/
|
|
17
|
+
list(query?: WorkspaceListParams | null | undefined, options?: RequestOptions): APIPromise<WorkspaceListResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Delete Workspace
|
|
20
|
+
*/
|
|
21
|
+
delete(workspaceID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Tenant schema.
|
|
25
|
+
*/
|
|
26
|
+
export interface WorkspaceCreateResponse {
|
|
27
|
+
id: string;
|
|
28
|
+
created_at: string;
|
|
29
|
+
display_name: string;
|
|
30
|
+
is_deleted: boolean;
|
|
31
|
+
is_personal: boolean;
|
|
32
|
+
data_plane_url?: string | null;
|
|
33
|
+
organization_id?: string | null;
|
|
34
|
+
tenant_handle?: string | null;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Tenant schema.
|
|
38
|
+
*/
|
|
39
|
+
export interface WorkspaceUpdateResponse {
|
|
40
|
+
id: string;
|
|
41
|
+
created_at: string;
|
|
42
|
+
display_name: string;
|
|
43
|
+
is_deleted: boolean;
|
|
44
|
+
is_personal: boolean;
|
|
45
|
+
data_plane_url?: string | null;
|
|
46
|
+
organization_id?: string | null;
|
|
47
|
+
tenant_handle?: string | null;
|
|
48
|
+
}
|
|
49
|
+
export type WorkspaceListResponse = Array<WorkspaceListResponse.WorkspaceListResponseItem>;
|
|
50
|
+
export declare namespace WorkspaceListResponse {
|
|
51
|
+
interface WorkspaceListResponseItem {
|
|
52
|
+
id: string;
|
|
53
|
+
created_at: string;
|
|
54
|
+
display_name: string;
|
|
55
|
+
is_deleted: boolean;
|
|
56
|
+
is_personal: boolean;
|
|
57
|
+
data_plane_url?: string | null;
|
|
58
|
+
organization_id?: string | null;
|
|
59
|
+
permissions?: Array<string> | null;
|
|
60
|
+
/**
|
|
61
|
+
* @deprecated
|
|
62
|
+
*/
|
|
63
|
+
read_only?: boolean;
|
|
64
|
+
role_id?: string | null;
|
|
65
|
+
role_name?: string | null;
|
|
66
|
+
tenant_handle?: string | null;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
export type WorkspaceDeleteResponse = unknown;
|
|
70
|
+
export interface WorkspaceCreateParams {
|
|
71
|
+
display_name: string;
|
|
72
|
+
id?: string;
|
|
73
|
+
tenant_handle?: string | null;
|
|
74
|
+
}
|
|
75
|
+
export interface WorkspaceUpdateParams {
|
|
76
|
+
display_name: string;
|
|
77
|
+
}
|
|
78
|
+
export interface WorkspaceListParams {
|
|
79
|
+
data_plane_id?: string | null;
|
|
80
|
+
include_deleted?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export declare namespace Workspaces {
|
|
83
|
+
export { type WorkspaceCreateResponse as WorkspaceCreateResponse, type WorkspaceUpdateResponse as WorkspaceUpdateResponse, type WorkspaceListResponse as WorkspaceListResponse, type WorkspaceDeleteResponse as WorkspaceDeleteResponse, type WorkspaceCreateParams as WorkspaceCreateParams, type WorkspaceUpdateParams as WorkspaceUpdateParams, type WorkspaceListParams as WorkspaceListParams, };
|
|
84
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
import { APIResource } from '../core/resource.js';
|
|
4
|
+
import { path } from '../internal/utils/path.js';
|
|
5
|
+
export class Workspaces extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Create a new workspace.
|
|
8
|
+
*/
|
|
9
|
+
create(body, options) {
|
|
10
|
+
return this._client.post('/api/v1/workspaces', { body, ...options });
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Update a workspace.
|
|
14
|
+
*/
|
|
15
|
+
update(workspaceID, body, options) {
|
|
16
|
+
return this._client.patch(path `/api/v1/workspaces/${workspaceID}`, { body, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get all workspaces visible to this auth in the current org. Does not create a
|
|
20
|
+
* new workspace/org.
|
|
21
|
+
*/
|
|
22
|
+
list(query = {}, options) {
|
|
23
|
+
return this._client.get('/api/v1/workspaces', { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Delete Workspace
|
|
27
|
+
*/
|
|
28
|
+
delete(workspaceID, options) {
|
|
29
|
+
return this._client.delete(path `/api/v1/workspaces/${workspaceID}`, options);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const VERSION = "0.0.1";
|
package/dist/client.cjs
CHANGED
|
@@ -42,15 +42,16 @@ const async_caller_js_1 = require("./utils/async_caller.cjs");
|
|
|
42
42
|
const messages_js_1 = require("./utils/messages.cjs");
|
|
43
43
|
const env_js_1 = require("./utils/env.cjs");
|
|
44
44
|
const index_js_1 = require("./index.cjs");
|
|
45
|
+
const index_js_2 = require("./_openapi_client/index.cjs");
|
|
45
46
|
const _uuid_js_1 = require("./utils/_uuid.cjs");
|
|
46
47
|
const warn_js_1 = require("./utils/warn.cjs");
|
|
47
48
|
const prompts_js_1 = require("./utils/prompts.cjs");
|
|
48
49
|
const error_js_1 = require("./utils/error.cjs");
|
|
49
|
-
const
|
|
50
|
+
const index_js_3 = require("./utils/prompt_cache/index.cjs");
|
|
50
51
|
const fsUtils = __importStar(require("./utils/fs.cjs"));
|
|
51
52
|
const fetch_js_1 = require("./singletons/fetch.cjs");
|
|
52
53
|
const profiles_js_1 = require("./utils/profiles.cjs");
|
|
53
|
-
const
|
|
54
|
+
const index_js_4 = require("./utils/fast-safe-stringify/index.cjs");
|
|
54
55
|
const serialize_worker_js_1 = require("./utils/serialize_worker.cjs");
|
|
55
56
|
function assertPullPublicPromptAllowed(promptIdentifier, dangerouslyPullPublicPrompt) {
|
|
56
57
|
const [owner] = (0, prompts_js_1.parseHubIdentifier)(promptIdentifier);
|
|
@@ -200,7 +201,7 @@ class AutoBatchQueue {
|
|
|
200
201
|
// limit and downstream async caller memory tracking). The exact
|
|
201
202
|
// serialization still happens later, off the hot path, when the batch is
|
|
202
203
|
// assembled for sending.
|
|
203
|
-
const size = (0,
|
|
204
|
+
const size = (0, index_js_4.estimateSerializedSize)(item.item).size;
|
|
204
205
|
// Check if adding this item would exceed the size limit
|
|
205
206
|
// Allow the run if the queue is empty (to support large single traces)
|
|
206
207
|
if (this.sizeBytes + size > this.maxSizeBytes && this.items.length > 0) {
|
|
@@ -423,7 +424,7 @@ class Client {
|
|
|
423
424
|
}
|
|
424
425
|
async _serializeBody(payload, errorContext) {
|
|
425
426
|
if (this.manualFlushMode) {
|
|
426
|
-
return (0,
|
|
427
|
+
return (0, index_js_4.serialize)(payload, errorContext);
|
|
427
428
|
}
|
|
428
429
|
// Shape-aware gate: worker offload pays for itself only when the
|
|
429
430
|
// payload is dominated by one or more large strings (V8 can refcount
|
|
@@ -432,26 +433,26 @@ class Client {
|
|
|
432
433
|
// structuredClone walk plus thread-hop cost exceeds the JSON.stringify
|
|
433
434
|
// cost we would pay inline, so we fall through to sync serialize.
|
|
434
435
|
if (!(0, serialize_worker_js_1.hasLargeString)(payload)) {
|
|
435
|
-
return (0,
|
|
436
|
+
return (0, index_js_4.serialize)(payload, errorContext);
|
|
436
437
|
}
|
|
437
438
|
if (this._serializeWorker === undefined) {
|
|
438
439
|
this._serializeWorker = (0, serialize_worker_js_1.getSharedSerializeWorker)();
|
|
439
440
|
}
|
|
440
441
|
if (this._serializeWorker === null) {
|
|
441
|
-
return (0,
|
|
442
|
+
return (0, index_js_4.serialize)(payload, errorContext);
|
|
442
443
|
}
|
|
443
444
|
try {
|
|
444
445
|
const bytes = await this._serializeWorker.serialize(payload);
|
|
445
446
|
if (bytes === null) {
|
|
446
447
|
// Worker subsystem unavailable; cache the null to skip re-entry.
|
|
447
448
|
this._serializeWorker = null;
|
|
448
|
-
return (0,
|
|
449
|
+
return (0, index_js_4.serialize)(payload, errorContext);
|
|
449
450
|
}
|
|
450
451
|
return bytes;
|
|
451
452
|
}
|
|
452
453
|
catch {
|
|
453
454
|
// DataCloneError, worker crash, etc. Fall back silently.
|
|
454
|
-
return (0,
|
|
455
|
+
return (0, index_js_4.serialize)(payload, errorContext);
|
|
455
456
|
}
|
|
456
457
|
}
|
|
457
458
|
constructor(config = {}) {
|
|
@@ -581,6 +582,12 @@ class Client {
|
|
|
581
582
|
writable: true,
|
|
582
583
|
value: void 0
|
|
583
584
|
});
|
|
585
|
+
Object.defineProperty(this, "openAPIClient", {
|
|
586
|
+
enumerable: true,
|
|
587
|
+
configurable: true,
|
|
588
|
+
writable: true,
|
|
589
|
+
value: void 0
|
|
590
|
+
});
|
|
584
591
|
Object.defineProperty(this, "settings", {
|
|
585
592
|
enumerable: true,
|
|
586
593
|
configurable: true,
|
|
@@ -774,6 +781,7 @@ class Client {
|
|
|
774
781
|
this.batchSizeBytesLimit = config.batchSizeBytesLimit;
|
|
775
782
|
this.batchSizeLimit = config.batchSizeLimit;
|
|
776
783
|
this.fetchOptions = config.fetchOptions || {};
|
|
784
|
+
this.openAPIClient = this._newOpenAPIClient();
|
|
777
785
|
this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
|
|
778
786
|
this._tracingMode = (0, env_js_1.resolveTracingMode)(config.tracingMode);
|
|
779
787
|
if (this._tracingMode === "otel") {
|
|
@@ -797,7 +805,7 @@ class Client {
|
|
|
797
805
|
this._promptCache = undefined;
|
|
798
806
|
}
|
|
799
807
|
else if (config.cache === true) {
|
|
800
|
-
this._promptCache =
|
|
808
|
+
this._promptCache = index_js_3.promptCacheSingleton;
|
|
801
809
|
}
|
|
802
810
|
else {
|
|
803
811
|
// Custom PromptCache instance provided
|
|
@@ -806,7 +814,7 @@ class Client {
|
|
|
806
814
|
}
|
|
807
815
|
else if (!config.disablePromptCache) {
|
|
808
816
|
// Use the global singleton instance
|
|
809
|
-
this._promptCache =
|
|
817
|
+
this._promptCache = index_js_3.promptCacheSingleton;
|
|
810
818
|
}
|
|
811
819
|
// Initialize custom headers
|
|
812
820
|
this._customHeaders = config.headers ?? {};
|
|
@@ -913,11 +921,32 @@ class Client {
|
|
|
913
921
|
set headers(value) {
|
|
914
922
|
this._customHeaders = value ?? {};
|
|
915
923
|
}
|
|
924
|
+
_getOpenAPIBaseUrl() {
|
|
925
|
+
return this.apiUrl.endsWith("/v1") ? this.apiUrl.slice(0, -3) : this.apiUrl;
|
|
926
|
+
}
|
|
927
|
+
_newOpenAPIClient() {
|
|
928
|
+
const defaultHeaders = this.apiKey === undefined && this.workspaceId === undefined
|
|
929
|
+
? { "X-API-Key": null }
|
|
930
|
+
: undefined;
|
|
931
|
+
const { method: _method, headers: _headers, body: _body, signal: _signal, ...openAPIFetchOptions } = this.fetchOptions;
|
|
932
|
+
return new index_js_2.Langsmith({
|
|
933
|
+
apiKey: this.apiKey,
|
|
934
|
+
tenantID: this.workspaceId,
|
|
935
|
+
baseURL: this._getOpenAPIBaseUrl(),
|
|
936
|
+
timeout: this.timeout_ms,
|
|
937
|
+
fetch: this._fetch,
|
|
938
|
+
fetchOptions: openAPIFetchOptions,
|
|
939
|
+
defaultHeaders,
|
|
940
|
+
});
|
|
941
|
+
}
|
|
916
942
|
_getPlatformEndpointPath(path) {
|
|
917
943
|
// Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
|
|
918
944
|
const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
|
|
919
945
|
return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
|
|
920
946
|
}
|
|
947
|
+
get onlineEvaluators() {
|
|
948
|
+
return this.openAPIClient.onlineEvaluators;
|
|
949
|
+
}
|
|
921
950
|
async processInputs(inputs) {
|
|
922
951
|
if (this.hideInputs === false) {
|
|
923
952
|
return inputs;
|
|
@@ -1457,7 +1486,7 @@ class Client {
|
|
|
1457
1486
|
if (options?.workspaceId !== undefined) {
|
|
1458
1487
|
headers["x-tenant-id"] = options.workspaceId;
|
|
1459
1488
|
}
|
|
1460
|
-
const body = (0,
|
|
1489
|
+
const body = (0, index_js_4.serialize)(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
|
|
1461
1490
|
await this.caller.call(async () => {
|
|
1462
1491
|
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs`, {
|
|
1463
1492
|
method: "POST",
|
|
@@ -1887,7 +1916,7 @@ class Client {
|
|
|
1887
1916
|
if (options?.workspaceId !== undefined) {
|
|
1888
1917
|
headers["x-tenant-id"] = options.workspaceId;
|
|
1889
1918
|
}
|
|
1890
|
-
const body = (0,
|
|
1919
|
+
const body = (0, index_js_4.serialize)(run, `Serializing payload to update run with id: ${runId}`);
|
|
1891
1920
|
await this.caller.call(async () => {
|
|
1892
1921
|
const res = await this._fetch(`${options?.apiUrl ?? this.apiUrl}/runs/${runId}`, {
|
|
1893
1922
|
method: "PATCH",
|
|
@@ -4476,14 +4505,14 @@ class Client {
|
|
|
4476
4505
|
...(example.split && { split: example.split }),
|
|
4477
4506
|
};
|
|
4478
4507
|
// Add main example data
|
|
4479
|
-
const stringifiedExample = (0,
|
|
4508
|
+
const stringifiedExample = (0, index_js_4.serialize)(exampleBody, `Serializing body for example with id: ${exampleId}`);
|
|
4480
4509
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
4481
4510
|
type: "application/json",
|
|
4482
4511
|
});
|
|
4483
4512
|
formData.append(exampleId, exampleBlob);
|
|
4484
4513
|
// Add inputs if present
|
|
4485
4514
|
if (example.inputs) {
|
|
4486
|
-
const stringifiedInputs = (0,
|
|
4515
|
+
const stringifiedInputs = (0, index_js_4.serialize)(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
|
|
4487
4516
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
4488
4517
|
type: "application/json",
|
|
4489
4518
|
});
|
|
@@ -4491,7 +4520,7 @@ class Client {
|
|
|
4491
4520
|
}
|
|
4492
4521
|
// Add outputs if present
|
|
4493
4522
|
if (example.outputs) {
|
|
4494
|
-
const stringifiedOutputs = (0,
|
|
4523
|
+
const stringifiedOutputs = (0, index_js_4.serialize)(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
|
|
4495
4524
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
4496
4525
|
type: "application/json",
|
|
4497
4526
|
});
|
|
@@ -4516,7 +4545,7 @@ class Client {
|
|
|
4516
4545
|
}
|
|
4517
4546
|
}
|
|
4518
4547
|
if (example.attachments_operations) {
|
|
4519
|
-
const stringifiedAttachmentsOperations = (0,
|
|
4548
|
+
const stringifiedAttachmentsOperations = (0, index_js_4.serialize)(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
|
|
4520
4549
|
const attachmentsOperationsBlob = new Blob([stringifiedAttachmentsOperations], {
|
|
4521
4550
|
type: "application/json",
|
|
4522
4551
|
});
|
|
@@ -4567,14 +4596,14 @@ class Client {
|
|
|
4567
4596
|
}),
|
|
4568
4597
|
};
|
|
4569
4598
|
// Add main example data
|
|
4570
|
-
const stringifiedExample = (0,
|
|
4599
|
+
const stringifiedExample = (0, index_js_4.serialize)(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
|
|
4571
4600
|
const exampleBlob = new Blob([stringifiedExample], {
|
|
4572
4601
|
type: "application/json",
|
|
4573
4602
|
});
|
|
4574
4603
|
formData.append(exampleId, exampleBlob);
|
|
4575
4604
|
// Add inputs if present
|
|
4576
4605
|
if (example.inputs) {
|
|
4577
|
-
const stringifiedInputs = (0,
|
|
4606
|
+
const stringifiedInputs = (0, index_js_4.serialize)(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
|
|
4578
4607
|
const inputsBlob = new Blob([stringifiedInputs], {
|
|
4579
4608
|
type: "application/json",
|
|
4580
4609
|
});
|
|
@@ -4582,7 +4611,7 @@ class Client {
|
|
|
4582
4611
|
}
|
|
4583
4612
|
// Add outputs if present
|
|
4584
4613
|
if (example.outputs) {
|
|
4585
|
-
const stringifiedOutputs = (0,
|
|
4614
|
+
const stringifiedOutputs = (0, index_js_4.serialize)(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
|
|
4586
4615
|
const outputsBlob = new Blob([stringifiedOutputs], {
|
|
4587
4616
|
type: "application/json",
|
|
4588
4617
|
});
|
package/dist/client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AsyncCallerParams } from "./utils/async_caller.js";
|
|
|
3
3
|
import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails, AnnotationQueueRubricItem, FeedbackConfigSchema, AgentContext, SkillContext, Entry } from "./schemas.js";
|
|
4
4
|
import { type TracingMode } from "./utils/env.js";
|
|
5
5
|
import { EvaluationResult, EvaluationResults } from "./evaluation/evaluator.js";
|
|
6
|
+
import { OnlineEvaluators } from "./_openapi_client/resources/online-evaluators.js";
|
|
6
7
|
import { PromptCache } from "./utils/prompt_cache/index.js";
|
|
7
8
|
import { ProfileAuth } from "./utils/profiles.js";
|
|
8
9
|
export interface ClientConfig {
|
|
@@ -436,6 +437,7 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
436
437
|
private batchSizeBytesLimit?;
|
|
437
438
|
private batchSizeLimit?;
|
|
438
439
|
private fetchOptions;
|
|
440
|
+
private openAPIClient;
|
|
439
441
|
private settings;
|
|
440
442
|
private blockOnRootRunFinalization;
|
|
441
443
|
private traceBatchConcurrency;
|
|
@@ -495,7 +497,10 @@ export declare class Client implements LangSmithTracingClientInterface {
|
|
|
495
497
|
*/
|
|
496
498
|
get headers(): Record<string, string>;
|
|
497
499
|
set headers(value: Record<string, string> | undefined);
|
|
500
|
+
private _getOpenAPIBaseUrl;
|
|
501
|
+
private _newOpenAPIClient;
|
|
498
502
|
private _getPlatformEndpointPath;
|
|
503
|
+
get onlineEvaluators(): OnlineEvaluators;
|
|
499
504
|
private processInputs;
|
|
500
505
|
private processOutputs;
|
|
501
506
|
private processMetadata;
|
package/dist/client.js
CHANGED
|
@@ -5,6 +5,7 @@ import { AsyncCaller } from "./utils/async_caller.js";
|
|
|
5
5
|
import { convertLangChainMessageToExample, isLangChainMessage, } from "./utils/messages.js";
|
|
6
6
|
import { getEnvironmentVariable, getLangSmithEnvVarsMetadata, getLangSmithEnvironmentVariable, getRuntimeEnvironment, getEnv, resolveTracingMode, } from "./utils/env.js";
|
|
7
7
|
import { __version__ } from "./index.js";
|
|
8
|
+
import { Langsmith as OpenAPILangsmith } from "./_openapi_client/index.js";
|
|
8
9
|
import { assertUuid } from "./utils/_uuid.js";
|
|
9
10
|
import { warnOnce } from "./utils/warn.js";
|
|
10
11
|
import { parseHubIdentifier } from "./utils/prompts.js";
|
|
@@ -543,6 +544,12 @@ export class Client {
|
|
|
543
544
|
writable: true,
|
|
544
545
|
value: void 0
|
|
545
546
|
});
|
|
547
|
+
Object.defineProperty(this, "openAPIClient", {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
configurable: true,
|
|
550
|
+
writable: true,
|
|
551
|
+
value: void 0
|
|
552
|
+
});
|
|
546
553
|
Object.defineProperty(this, "settings", {
|
|
547
554
|
enumerable: true,
|
|
548
555
|
configurable: true,
|
|
@@ -736,6 +743,7 @@ export class Client {
|
|
|
736
743
|
this.batchSizeBytesLimit = config.batchSizeBytesLimit;
|
|
737
744
|
this.batchSizeLimit = config.batchSizeLimit;
|
|
738
745
|
this.fetchOptions = config.fetchOptions || {};
|
|
746
|
+
this.openAPIClient = this._newOpenAPIClient();
|
|
739
747
|
this.manualFlushMode = config.manualFlushMode ?? this.manualFlushMode;
|
|
740
748
|
this._tracingMode = resolveTracingMode(config.tracingMode);
|
|
741
749
|
if (this._tracingMode === "otel") {
|
|
@@ -875,11 +883,32 @@ export class Client {
|
|
|
875
883
|
set headers(value) {
|
|
876
884
|
this._customHeaders = value ?? {};
|
|
877
885
|
}
|
|
886
|
+
_getOpenAPIBaseUrl() {
|
|
887
|
+
return this.apiUrl.endsWith("/v1") ? this.apiUrl.slice(0, -3) : this.apiUrl;
|
|
888
|
+
}
|
|
889
|
+
_newOpenAPIClient() {
|
|
890
|
+
const defaultHeaders = this.apiKey === undefined && this.workspaceId === undefined
|
|
891
|
+
? { "X-API-Key": null }
|
|
892
|
+
: undefined;
|
|
893
|
+
const { method: _method, headers: _headers, body: _body, signal: _signal, ...openAPIFetchOptions } = this.fetchOptions;
|
|
894
|
+
return new OpenAPILangsmith({
|
|
895
|
+
apiKey: this.apiKey,
|
|
896
|
+
tenantID: this.workspaceId,
|
|
897
|
+
baseURL: this._getOpenAPIBaseUrl(),
|
|
898
|
+
timeout: this.timeout_ms,
|
|
899
|
+
fetch: this._fetch,
|
|
900
|
+
fetchOptions: openAPIFetchOptions,
|
|
901
|
+
defaultHeaders,
|
|
902
|
+
});
|
|
903
|
+
}
|
|
878
904
|
_getPlatformEndpointPath(path) {
|
|
879
905
|
// Check if apiUrl already ends with /v1 or /v1/ to avoid double /v1/v1/ paths
|
|
880
906
|
const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
|
|
881
907
|
return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
|
|
882
908
|
}
|
|
909
|
+
get onlineEvaluators() {
|
|
910
|
+
return this.openAPIClient.onlineEvaluators;
|
|
911
|
+
}
|
|
883
912
|
async processInputs(inputs) {
|
|
884
913
|
if (this.hideInputs === false) {
|
|
885
914
|
return inputs;
|
package/dist/env.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isEnvTracingEnabled = void 0;
|
|
4
4
|
const env_js_1 = require("./utils/env.cjs");
|
|
5
|
-
const
|
|
5
|
+
const isEnvTracingEnabled = (tracingEnabled) => {
|
|
6
6
|
if (tracingEnabled !== undefined) {
|
|
7
7
|
return tracingEnabled;
|
|
8
8
|
}
|
|
9
9
|
const envVars = ["TRACING_V2", "TRACING"];
|
|
10
10
|
return !!envVars.find((envVar) => (0, env_js_1.getLangSmithEnvironmentVariable)(envVar) === "true");
|
|
11
11
|
};
|
|
12
|
-
exports.
|
|
12
|
+
exports.isEnvTracingEnabled = isEnvTracingEnabled;
|
package/dist/env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const isEnvTracingEnabled: (tracingEnabled?: boolean) => boolean;
|
package/dist/env.js
CHANGED