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.
Files changed (234) hide show
  1. package/README.md +161 -15
  2. package/dist/_openapi_client/client.cjs +814 -0
  3. package/dist/_openapi_client/client.d.ts +247 -0
  4. package/dist/_openapi_client/client.js +777 -0
  5. package/dist/_openapi_client/core/api-promise.cjs +100 -0
  6. package/dist/_openapi_client/core/api-promise.d.ts +45 -0
  7. package/dist/_openapi_client/core/api-promise.js +96 -0
  8. package/dist/_openapi_client/core/error.cjs +134 -0
  9. package/dist/_openapi_client/core/error.d.ts +45 -0
  10. package/dist/_openapi_client/core/error.js +118 -0
  11. package/dist/_openapi_client/core/pagination.cjs +374 -0
  12. package/dist/_openapi_client/core/pagination.d.ts +157 -0
  13. package/dist/_openapi_client/core/pagination.js +361 -0
  14. package/dist/_openapi_client/core/resource.cjs +17 -0
  15. package/dist/_openapi_client/core/resource.d.ts +5 -0
  16. package/dist/_openapi_client/core/resource.js +13 -0
  17. package/dist/_openapi_client/core/uploads.cjs +5 -0
  18. package/dist/_openapi_client/core/uploads.d.ts +2 -0
  19. package/dist/_openapi_client/core/uploads.js +1 -0
  20. package/dist/_openapi_client/index.cjs +29 -0
  21. package/dist/_openapi_client/index.d.ts +6 -0
  22. package/dist/_openapi_client/index.js +8 -0
  23. package/dist/_openapi_client/internal/builtin-types.cjs +4 -0
  24. package/dist/_openapi_client/internal/builtin-types.d.ts +72 -0
  25. package/dist/_openapi_client/internal/builtin-types.js +3 -0
  26. package/dist/_openapi_client/internal/detect-platform.cjs +162 -0
  27. package/dist/_openapi_client/internal/detect-platform.d.ts +14 -0
  28. package/dist/_openapi_client/internal/detect-platform.js +157 -0
  29. package/dist/_openapi_client/internal/errors.cjs +41 -0
  30. package/dist/_openapi_client/internal/errors.d.ts +2 -0
  31. package/dist/_openapi_client/internal/errors.js +36 -0
  32. package/dist/_openapi_client/internal/headers.cjs +79 -0
  33. package/dist/_openapi_client/internal/headers.d.ts +5 -0
  34. package/dist/_openapi_client/internal/headers.js +74 -0
  35. package/dist/_openapi_client/internal/parse.cjs +40 -0
  36. package/dist/_openapi_client/internal/parse.d.ts +11 -0
  37. package/dist/_openapi_client/internal/parse.js +37 -0
  38. package/dist/_openapi_client/internal/qs/formats.cjs +12 -0
  39. package/dist/_openapi_client/internal/qs/formats.d.ts +6 -0
  40. package/dist/_openapi_client/internal/qs/formats.js +8 -0
  41. package/dist/_openapi_client/internal/qs/stringify.cjs +277 -0
  42. package/dist/_openapi_client/internal/qs/stringify.d.ts +2 -0
  43. package/dist/_openapi_client/internal/qs/stringify.js +274 -0
  44. package/dist/_openapi_client/internal/qs/types.cjs +2 -0
  45. package/dist/_openapi_client/internal/qs/types.d.ts +56 -0
  46. package/dist/_openapi_client/internal/qs/types.js +1 -0
  47. package/dist/_openapi_client/internal/qs/utils.cjs +230 -0
  48. package/dist/_openapi_client/internal/qs/utils.d.ts +14 -0
  49. package/dist/_openapi_client/internal/qs/utils.js +217 -0
  50. package/dist/_openapi_client/internal/request-options.cjs +14 -0
  51. package/dist/_openapi_client/internal/request-options.d.ts +74 -0
  52. package/dist/_openapi_client/internal/request-options.js +10 -0
  53. package/dist/_openapi_client/internal/shim-types.cjs +4 -0
  54. package/dist/_openapi_client/internal/shim-types.d.ts +16 -0
  55. package/dist/_openapi_client/internal/shim-types.js +3 -0
  56. package/dist/_openapi_client/internal/shims.cjs +92 -0
  57. package/dist/_openapi_client/internal/shims.d.ts +25 -0
  58. package/dist/_openapi_client/internal/shims.js +85 -0
  59. package/dist/_openapi_client/internal/to-file.cjs +91 -0
  60. package/dist/_openapi_client/internal/to-file.d.ts +44 -0
  61. package/dist/_openapi_client/internal/to-file.js +88 -0
  62. package/dist/_openapi_client/internal/types.cjs +4 -0
  63. package/dist/_openapi_client/internal/types.d.ts +62 -0
  64. package/dist/_openapi_client/internal/types.js +3 -0
  65. package/dist/_openapi_client/internal/uploads.cjs +140 -0
  66. package/dist/_openapi_client/internal/uploads.d.ts +41 -0
  67. package/dist/_openapi_client/internal/uploads.js +130 -0
  68. package/dist/_openapi_client/internal/utils/env.cjs +22 -0
  69. package/dist/_openapi_client/internal/utils/env.d.ts +8 -0
  70. package/dist/_openapi_client/internal/utils/env.js +18 -0
  71. package/dist/_openapi_client/internal/utils/log.cjs +88 -0
  72. package/dist/_openapi_client/internal/utils/log.d.ts +36 -0
  73. package/dist/_openapi_client/internal/utils/log.js +82 -0
  74. package/dist/_openapi_client/internal/utils/path.cjs +79 -0
  75. package/dist/_openapi_client/internal/utils/path.d.ts +14 -0
  76. package/dist/_openapi_client/internal/utils/path.js +74 -0
  77. package/dist/_openapi_client/internal/utils/query.cjs +42 -0
  78. package/dist/_openapi_client/internal/utils/query.d.ts +1 -0
  79. package/dist/_openapi_client/internal/utils/query.js +6 -0
  80. package/dist/_openapi_client/internal/utils/sleep.cjs +7 -0
  81. package/dist/_openapi_client/internal/utils/sleep.d.ts +1 -0
  82. package/dist/_openapi_client/internal/utils/sleep.js +3 -0
  83. package/dist/_openapi_client/internal/utils/uuid.cjs +19 -0
  84. package/dist/_openapi_client/internal/utils/uuid.d.ts +4 -0
  85. package/dist/_openapi_client/internal/utils/uuid.js +15 -0
  86. package/dist/_openapi_client/internal/utils/values.cjs +112 -0
  87. package/dist/_openapi_client/internal/utils/values.d.ts +17 -0
  88. package/dist/_openapi_client/internal/utils/values.js +94 -0
  89. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +138 -0
  90. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +367 -0
  91. package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +101 -0
  92. package/dist/_openapi_client/resources/annotation-queues/runs.cjs +46 -0
  93. package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +128 -0
  94. package/dist/_openapi_client/resources/annotation-queues/runs.js +42 -0
  95. package/dist/_openapi_client/resources/commits.cjs +44 -0
  96. package/dist/_openapi_client/resources/commits.d.ts +204 -0
  97. package/dist/_openapi_client/resources/commits.js +40 -0
  98. package/dist/_openapi_client/resources/datasets/comparative.cjs +22 -0
  99. package/dist/_openapi_client/resources/datasets/comparative.d.ts +55 -0
  100. package/dist/_openapi_client/resources/datasets/comparative.js +18 -0
  101. package/dist/_openapi_client/resources/datasets/datasets.cjs +193 -0
  102. package/dist/_openapi_client/resources/datasets/datasets.d.ts +374 -0
  103. package/dist/_openapi_client/resources/datasets/datasets.js +156 -0
  104. package/dist/_openapi_client/resources/datasets/experiments.cjs +16 -0
  105. package/dist/_openapi_client/resources/datasets/experiments.d.ts +23 -0
  106. package/dist/_openapi_client/resources/datasets/experiments.js +12 -0
  107. package/dist/_openapi_client/resources/datasets/group.cjs +17 -0
  108. package/dist/_openapi_client/resources/datasets/group.d.ts +160 -0
  109. package/dist/_openapi_client/resources/datasets/group.js +13 -0
  110. package/dist/_openapi_client/resources/datasets/runs.cjs +29 -0
  111. package/dist/_openapi_client/resources/datasets/runs.d.ts +216 -0
  112. package/dist/_openapi_client/resources/datasets/runs.js +25 -0
  113. package/dist/_openapi_client/resources/datasets/share.cjs +32 -0
  114. package/dist/_openapi_client/resources/datasets/share.d.ts +28 -0
  115. package/dist/_openapi_client/resources/datasets/share.js +28 -0
  116. package/dist/_openapi_client/resources/datasets/splits.cjs +22 -0
  117. package/dist/_openapi_client/resources/datasets/splits.d.ts +30 -0
  118. package/dist/_openapi_client/resources/datasets/splits.js +18 -0
  119. package/dist/_openapi_client/resources/datasets/versions.cjs +23 -0
  120. package/dist/_openapi_client/resources/datasets/versions.d.ts +36 -0
  121. package/dist/_openapi_client/resources/datasets/versions.js +19 -0
  122. package/dist/_openapi_client/resources/evaluators.cjs +15 -0
  123. package/dist/_openapi_client/resources/evaluators.d.ts +125 -0
  124. package/dist/_openapi_client/resources/evaluators.js +11 -0
  125. package/dist/_openapi_client/resources/examples/bulk.cjs +24 -0
  126. package/dist/_openapi_client/resources/examples/bulk.d.ts +78 -0
  127. package/dist/_openapi_client/resources/examples/bulk.js +20 -0
  128. package/dist/_openapi_client/resources/examples/examples.cjs +124 -0
  129. package/dist/_openapi_client/resources/examples/examples.d.ts +182 -0
  130. package/dist/_openapi_client/resources/examples/examples.js +87 -0
  131. package/dist/_openapi_client/resources/examples/validate.cjs +21 -0
  132. package/dist/_openapi_client/resources/examples/validate.d.ts +38 -0
  133. package/dist/_openapi_client/resources/examples/validate.js +17 -0
  134. package/dist/_openapi_client/resources/feedback/configs.cjs +24 -0
  135. package/dist/_openapi_client/resources/feedback/configs.d.ts +18 -0
  136. package/dist/_openapi_client/resources/feedback/configs.js +20 -0
  137. package/dist/_openapi_client/resources/feedback/feedback.cjs +98 -0
  138. package/dist/_openapi_client/resources/feedback/feedback.d.ts +275 -0
  139. package/dist/_openapi_client/resources/feedback/feedback.js +61 -0
  140. package/dist/_openapi_client/resources/feedback/tokens.cjs +35 -0
  141. package/dist/_openapi_client/resources/feedback/tokens.d.ts +130 -0
  142. package/dist/_openapi_client/resources/feedback/tokens.js +31 -0
  143. package/dist/_openapi_client/resources/index.cjs +35 -0
  144. package/dist/_openapi_client/resources/index.d.ts +15 -0
  145. package/dist/_openapi_client/resources/index.js +17 -0
  146. package/dist/_openapi_client/resources/info.cjs +15 -0
  147. package/dist/_openapi_client/resources/info.d.ts +51 -0
  148. package/dist/_openapi_client/resources/info.js +11 -0
  149. package/dist/_openapi_client/resources/online-evaluators.cjs +70 -0
  150. package/dist/_openapi_client/resources/online-evaluators.d.ts +284 -0
  151. package/dist/_openapi_client/resources/online-evaluators.js +66 -0
  152. package/dist/_openapi_client/resources/public/datasets.cjs +47 -0
  153. package/dist/_openapi_client/resources/public/datasets.d.ts +152 -0
  154. package/dist/_openapi_client/resources/public/datasets.js +43 -0
  155. package/dist/_openapi_client/resources/public/public.cjs +62 -0
  156. package/dist/_openapi_client/resources/public/public.d.ts +32 -0
  157. package/dist/_openapi_client/resources/public/public.js +25 -0
  158. package/dist/_openapi_client/resources/repos/directories.cjs +40 -0
  159. package/dist/_openapi_client/resources/repos/directories.d.ts +72 -0
  160. package/dist/_openapi_client/resources/repos/directories.js +36 -0
  161. package/dist/_openapi_client/resources/repos/repos.cjs +93 -0
  162. package/dist/_openapi_client/resources/repos/repos.d.ts +188 -0
  163. package/dist/_openapi_client/resources/repos/repos.js +56 -0
  164. package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
  165. package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
  166. package/dist/_openapi_client/resources/runs/rules.js +5 -0
  167. package/dist/_openapi_client/resources/runs/runs.cjs +102 -0
  168. package/dist/_openapi_client/resources/runs/runs.d.ts +542 -0
  169. package/dist/_openapi_client/resources/runs/runs.js +65 -0
  170. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
  171. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +1121 -0
  172. package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
  173. package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +63 -0
  174. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +13 -0
  175. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +26 -0
  176. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
  177. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +130 -0
  178. package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
  179. package/dist/_openapi_client/resources/sessions/insights.cjs +54 -0
  180. package/dist/_openapi_client/resources/sessions/insights.d.ts +246 -0
  181. package/dist/_openapi_client/resources/sessions/insights.js +50 -0
  182. package/dist/_openapi_client/resources/sessions/sessions.cjs +109 -0
  183. package/dist/_openapi_client/resources/sessions/sessions.d.ts +674 -0
  184. package/dist/_openapi_client/resources/sessions/sessions.js +72 -0
  185. package/dist/_openapi_client/resources/settings.cjs +15 -0
  186. package/dist/_openapi_client/resources/settings.d.ts +18 -0
  187. package/dist/_openapi_client/resources/settings.js +11 -0
  188. package/dist/_openapi_client/resources/workspaces.cjs +35 -0
  189. package/dist/_openapi_client/resources/workspaces.d.ts +84 -0
  190. package/dist/_openapi_client/resources/workspaces.js +31 -0
  191. package/dist/_openapi_client/version.cjs +5 -0
  192. package/dist/_openapi_client/version.d.ts +1 -0
  193. package/dist/_openapi_client/version.js +2 -0
  194. package/dist/client.cjs +48 -19
  195. package/dist/client.d.ts +5 -0
  196. package/dist/client.js +29 -0
  197. package/dist/env.cjs +3 -3
  198. package/dist/env.d.ts +1 -1
  199. package/dist/env.js +1 -1
  200. package/dist/evaluation/_runner.cjs +31 -3
  201. package/dist/evaluation/_runner.d.ts +2 -0
  202. package/dist/evaluation/_runner.js +30 -4
  203. package/dist/experimental/otel/exporter.cjs +1 -1
  204. package/dist/experimental/otel/exporter.js +2 -2
  205. package/dist/experimental/vercel/telemetry.cjs +1 -1
  206. package/dist/experimental/vercel/telemetry.js +2 -2
  207. package/dist/index.cjs +4 -2
  208. package/dist/index.d.ts +2 -1
  209. package/dist/index.js +2 -1
  210. package/dist/run_trees.cjs +1 -1
  211. package/dist/run_trees.js +2 -2
  212. package/dist/sandbox/client.cjs +11 -3
  213. package/dist/sandbox/client.js +11 -3
  214. package/dist/sandbox/errors.cjs +2 -1
  215. package/dist/sandbox/errors.d.ts +2 -1
  216. package/dist/sandbox/errors.js +2 -1
  217. package/dist/sandbox/index.cjs +8 -2
  218. package/dist/sandbox/index.d.ts +3 -2
  219. package/dist/sandbox/index.js +2 -1
  220. package/dist/sandbox/mounts.cjs +114 -0
  221. package/dist/sandbox/mounts.d.ts +24 -0
  222. package/dist/sandbox/mounts.js +109 -0
  223. package/dist/sandbox/proxy_config.cjs +90 -5
  224. package/dist/sandbox/proxy_config.d.ts +19 -4
  225. package/dist/sandbox/proxy_config.js +86 -4
  226. package/dist/sandbox/types.d.ts +92 -3
  227. package/dist/traceable.cjs +1 -1
  228. package/dist/traceable.js +2 -2
  229. package/dist/utils/guard.cjs +13 -0
  230. package/dist/utils/guard.d.ts +6 -0
  231. package/dist/utils/guard.js +10 -0
  232. package/dist/utils/jestlike/globals.cjs +1 -1
  233. package/dist/utils/jestlike/globals.js +2 -2
  234. 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,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VERSION = void 0;
4
+ // @ts-nocheck
5
+ exports.VERSION = '0.0.1';
@@ -0,0 +1 @@
1
+ export declare const VERSION = "0.0.1";
@@ -0,0 +1,2 @@
1
+ // @ts-nocheck
2
+ export 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 index_js_2 = require("./utils/prompt_cache/index.cjs");
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 index_js_3 = require("./utils/fast-safe-stringify/index.cjs");
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, index_js_3.estimateSerializedSize)(item.item).size;
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, index_js_3.serialize)(payload, errorContext);
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, index_js_3.serialize)(payload, errorContext);
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, index_js_3.serialize)(payload, errorContext);
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, index_js_3.serialize)(payload, errorContext);
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, index_js_3.serialize)(payload, errorContext);
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 = index_js_2.promptCacheSingleton;
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 = index_js_2.promptCacheSingleton;
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, index_js_3.serialize)(mergedRunCreateParam, `Creating run with id: ${mergedRunCreateParam.id}`);
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, index_js_3.serialize)(run, `Serializing payload to update run with id: ${runId}`);
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, index_js_3.serialize)(exampleBody, `Serializing body for example with id: ${exampleId}`);
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, index_js_3.serialize)(example.inputs, `Serializing inputs for example with id: ${exampleId}`);
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, index_js_3.serialize)(example.outputs, `Serializing outputs whle updating example with id: ${exampleId}`);
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, index_js_3.serialize)(example.attachments_operations, `Serializing attachments while updating example with id: ${exampleId}`);
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, index_js_3.serialize)(exampleBody, `Serializing body for uploaded example with id: ${exampleId}`);
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, index_js_3.serialize)(example.inputs, `Serializing inputs for uploaded example with id: ${exampleId}`);
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, index_js_3.serialize)(example.outputs, `Serializing outputs for uploaded example with id: ${exampleId}`);
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.isTracingEnabled = void 0;
3
+ exports.isEnvTracingEnabled = void 0;
4
4
  const env_js_1 = require("./utils/env.cjs");
5
- const isTracingEnabled = (tracingEnabled) => {
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.isTracingEnabled = isTracingEnabled;
12
+ exports.isEnvTracingEnabled = isEnvTracingEnabled;
package/dist/env.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const isTracingEnabled: (tracingEnabled?: boolean) => boolean;
1
+ export declare const isEnvTracingEnabled: (tracingEnabled?: boolean) => boolean;
package/dist/env.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { getLangSmithEnvironmentVariable } from "./utils/env.js";
2
- export const isTracingEnabled = (tracingEnabled) => {
2
+ export const isEnvTracingEnabled = (tracingEnabled) => {
3
3
  if (tracingEnabled !== undefined) {
4
4
  return tracingEnabled;
5
5
  }