langsmith 0.7.8 → 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 (228) 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/experimental/otel/exporter.cjs +1 -1
  201. package/dist/experimental/otel/exporter.js +2 -2
  202. package/dist/experimental/vercel/telemetry.cjs +1 -1
  203. package/dist/experimental/vercel/telemetry.js +2 -2
  204. package/dist/index.cjs +4 -2
  205. package/dist/index.d.ts +2 -1
  206. package/dist/index.js +2 -1
  207. package/dist/run_trees.cjs +1 -1
  208. package/dist/run_trees.js +2 -2
  209. package/dist/sandbox/client.cjs +11 -3
  210. package/dist/sandbox/client.js +11 -3
  211. package/dist/sandbox/index.cjs +8 -2
  212. package/dist/sandbox/index.d.ts +3 -2
  213. package/dist/sandbox/index.js +2 -1
  214. package/dist/sandbox/mounts.cjs +114 -0
  215. package/dist/sandbox/mounts.d.ts +24 -0
  216. package/dist/sandbox/mounts.js +109 -0
  217. package/dist/sandbox/proxy_config.cjs +90 -5
  218. package/dist/sandbox/proxy_config.d.ts +19 -4
  219. package/dist/sandbox/proxy_config.js +86 -4
  220. package/dist/sandbox/types.d.ts +92 -3
  221. package/dist/traceable.cjs +1 -1
  222. package/dist/traceable.js +2 -2
  223. package/dist/utils/guard.cjs +13 -0
  224. package/dist/utils/guard.d.ts +6 -0
  225. package/dist/utils/guard.js +10 -0
  226. package/dist/utils/jestlike/globals.cjs +1 -1
  227. package/dist/utils/jestlike/globals.js +2 -2
  228. package/package.json +1 -1
@@ -0,0 +1,44 @@
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.Commits = void 0;
6
+ const resource_js_1 = require("../core/resource.cjs");
7
+ const pagination_js_1 = require("../core/pagination.cjs");
8
+ const path_js_1 = require("../internal/utils/path.cjs");
9
+ class Commits extends resource_js_1.APIResource {
10
+ /**
11
+ * Creates a new commit in a repository. Requires authentication and write access
12
+ * to the repository.
13
+ */
14
+ create(repo, params, options) {
15
+ const { owner, ...body } = params;
16
+ return this._client.post((0, path_js_1.path) `/commits/${owner}/${repo}`, { body, ...options });
17
+ }
18
+ /**
19
+ * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
20
+ * endpoint supports both authenticated and unauthenticated access. Authenticated
21
+ * users can access private repos, while unauthenticated users can only access
22
+ * public repos. Commit resolution logic:
23
+ *
24
+ * - "latest" or empty: Get the most recent commit
25
+ * - Less than 8 characters: Only check for tags
26
+ * - 8 or more characters: Prioritize commit hash over tag, check both
27
+ */
28
+ retrieve(commit, params, options) {
29
+ const { owner, repo, ...query } = params;
30
+ return this._client.get((0, path_js_1.path) `/commits/${owner}/${repo}/${commit}`, { query, ...options });
31
+ }
32
+ /**
33
+ * Lists all commits for a repository with pagination support. This endpoint
34
+ * supports both authenticated and unauthenticated access. Authenticated users can
35
+ * access private repos, while unauthenticated users can only access public repos.
36
+ * The include_stats parameter controls whether download and view statistics are
37
+ * computed (defaults to true).
38
+ */
39
+ list(repo, params, options) {
40
+ const { owner, ...query } = params;
41
+ return this._client.getAPIList((0, path_js_1.path) `/commits/${owner}/${repo}`, (pagination_js_1.OffsetPaginationCommits), { query, ...options });
42
+ }
43
+ }
44
+ exports.Commits = Commits;
@@ -0,0 +1,204 @@
1
+ import { APIResource } from '../core/resource.js';
2
+ import { APIPromise } from '../core/api-promise.js';
3
+ import { OffsetPaginationCommits, type OffsetPaginationCommitsParams, PagePromise } from '../core/pagination.js';
4
+ import { RequestOptions } from '../internal/request-options.js';
5
+ export declare class Commits extends APIResource {
6
+ /**
7
+ * Creates a new commit in a repository. Requires authentication and write access
8
+ * to the repository.
9
+ */
10
+ create(repo: string, params: CommitCreateParams, options?: RequestOptions): APIPromise<CommitCreateResponse>;
11
+ /**
12
+ * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
13
+ * endpoint supports both authenticated and unauthenticated access. Authenticated
14
+ * users can access private repos, while unauthenticated users can only access
15
+ * public repos. Commit resolution logic:
16
+ *
17
+ * - "latest" or empty: Get the most recent commit
18
+ * - Less than 8 characters: Only check for tags
19
+ * - 8 or more characters: Prioritize commit hash over tag, check both
20
+ */
21
+ retrieve(commit: string, params: CommitRetrieveParams, options?: RequestOptions): APIPromise<CommitRetrieveResponse>;
22
+ /**
23
+ * Lists all commits for a repository with pagination support. This endpoint
24
+ * supports both authenticated and unauthenticated access. Authenticated users can
25
+ * access private repos, while unauthenticated users can only access public repos.
26
+ * The include_stats parameter controls whether download and view statistics are
27
+ * computed (defaults to true).
28
+ */
29
+ list(repo: string, params: CommitListParams, options?: RequestOptions): PagePromise<CommitWithLookupsOffsetPaginationCommits, CommitWithLookups>;
30
+ }
31
+ export type CommitWithLookupsOffsetPaginationCommits = OffsetPaginationCommits<CommitWithLookups>;
32
+ /**
33
+ * Response model for get_commit_manifest.
34
+ */
35
+ export interface CommitManifestResponse {
36
+ commit_hash: string;
37
+ manifest: {
38
+ [key: string]: unknown;
39
+ };
40
+ examples?: Array<CommitManifestResponse.Example> | null;
41
+ }
42
+ export declare namespace CommitManifestResponse {
43
+ /**
44
+ * Response model for example runs
45
+ */
46
+ interface Example {
47
+ id: string;
48
+ session_id: string;
49
+ inputs?: {
50
+ [key: string]: unknown;
51
+ } | null;
52
+ outputs?: {
53
+ [key: string]: unknown;
54
+ } | null;
55
+ start_time?: string | null;
56
+ }
57
+ }
58
+ export interface CommitWithLookups {
59
+ /**
60
+ * The commit ID
61
+ */
62
+ id?: string;
63
+ /**
64
+ * The hash of the commit
65
+ */
66
+ commit_hash?: string;
67
+ /**
68
+ * When the commit was created
69
+ */
70
+ created_at?: string;
71
+ /**
72
+ * Optional human-readable description for the commit
73
+ */
74
+ description?: string;
75
+ /**
76
+ * Example run IDs associated with the commit
77
+ */
78
+ example_run_ids?: Array<string>;
79
+ /**
80
+ * Author's full name
81
+ */
82
+ full_name?: string;
83
+ /**
84
+ * The manifest of the commit
85
+ */
86
+ manifest?: unknown;
87
+ /**
88
+ * The SHA of the manifest
89
+ */
90
+ manifest_sha?: Array<number>;
91
+ /**
92
+ * Number of API downloads
93
+ */
94
+ num_downloads?: number;
95
+ /**
96
+ * Number of web views
97
+ */
98
+ num_views?: number;
99
+ /**
100
+ * The hash of the parent commit
101
+ */
102
+ parent_commit_hash?: string;
103
+ /**
104
+ * The ID of the parent commit
105
+ */
106
+ parent_id?: string;
107
+ /**
108
+ * Repository ID
109
+ */
110
+ repo_id?: string;
111
+ /**
112
+ * When the commit was last updated
113
+ */
114
+ updated_at?: string;
115
+ }
116
+ export interface CommitCreateResponse {
117
+ commit?: CommitWithLookups;
118
+ }
119
+ export interface CommitRetrieveResponse {
120
+ commit_hash?: string;
121
+ description?: string;
122
+ examples?: Array<CommitRetrieveResponse.Example>;
123
+ is_draft?: boolean;
124
+ manifest?: unknown;
125
+ model_config?: unknown;
126
+ model_provider?: string;
127
+ }
128
+ export declare namespace CommitRetrieveResponse {
129
+ interface Example {
130
+ id?: string;
131
+ inputs?: unknown;
132
+ outputs?: unknown;
133
+ session_id?: string;
134
+ start_time?: string;
135
+ }
136
+ }
137
+ export interface CommitCreateParams {
138
+ /**
139
+ * Path param: Repository owner (tenant handle) or '-' for private repos
140
+ */
141
+ owner: string;
142
+ /**
143
+ * Body param
144
+ */
145
+ description?: string;
146
+ /**
147
+ * Body param
148
+ */
149
+ manifest?: unknown;
150
+ /**
151
+ * Body param
152
+ */
153
+ parent_commit?: string;
154
+ /**
155
+ * Body param: SkipWebhooks allows skipping webhook notifications. Can be true
156
+ * (boolean) to skip all, or an array of webhook UUIDs to skip specific ones.
157
+ */
158
+ skip_webhooks?: unknown;
159
+ }
160
+ export interface CommitRetrieveParams {
161
+ /**
162
+ * Path param: Repository owner (tenant handle) or '-' for private repos
163
+ */
164
+ owner: string;
165
+ /**
166
+ * Path param: Repository handle
167
+ */
168
+ repo: string;
169
+ /**
170
+ * Query param
171
+ */
172
+ get_examples?: boolean;
173
+ /**
174
+ * Query param: Comma-separated list of optional fields: "model", "is_draft"
175
+ */
176
+ include?: string;
177
+ /**
178
+ * Query param: Deprecated: use Include instead
179
+ */
180
+ include_model?: boolean;
181
+ /**
182
+ * Query param
183
+ */
184
+ is_view?: boolean;
185
+ }
186
+ export interface CommitListParams extends OffsetPaginationCommitsParams {
187
+ /**
188
+ * Path param: Repository owner (tenant handle) or '-' for private repos
189
+ */
190
+ owner: string;
191
+ /**
192
+ * Query param: IncludeStats determines whether to compute num_downloads and
193
+ * num_views
194
+ */
195
+ include_stats?: boolean;
196
+ /**
197
+ * Query param: Tag filters commits to only those with a specific tag (e.g.
198
+ * "production", "staging")
199
+ */
200
+ tag?: string;
201
+ }
202
+ export declare namespace Commits {
203
+ export { type CommitManifestResponse as CommitManifestResponse, type CommitWithLookups as CommitWithLookups, type CommitCreateResponse as CommitCreateResponse, type CommitRetrieveResponse as CommitRetrieveResponse, type CommitWithLookupsOffsetPaginationCommits as CommitWithLookupsOffsetPaginationCommits, type CommitCreateParams as CommitCreateParams, type CommitRetrieveParams as CommitRetrieveParams, type CommitListParams as CommitListParams, };
204
+ }
@@ -0,0 +1,40 @@
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 { OffsetPaginationCommits } from '../core/pagination.js';
5
+ import { path } from '../internal/utils/path.js';
6
+ export class Commits extends APIResource {
7
+ /**
8
+ * Creates a new commit in a repository. Requires authentication and write access
9
+ * to the repository.
10
+ */
11
+ create(repo, params, options) {
12
+ const { owner, ...body } = params;
13
+ return this._client.post(path `/commits/${owner}/${repo}`, { body, ...options });
14
+ }
15
+ /**
16
+ * Retrieves a specific commit by hash, tag, or "latest" for a repository. This
17
+ * endpoint supports both authenticated and unauthenticated access. Authenticated
18
+ * users can access private repos, while unauthenticated users can only access
19
+ * public repos. Commit resolution logic:
20
+ *
21
+ * - "latest" or empty: Get the most recent commit
22
+ * - Less than 8 characters: Only check for tags
23
+ * - 8 or more characters: Prioritize commit hash over tag, check both
24
+ */
25
+ retrieve(commit, params, options) {
26
+ const { owner, repo, ...query } = params;
27
+ return this._client.get(path `/commits/${owner}/${repo}/${commit}`, { query, ...options });
28
+ }
29
+ /**
30
+ * Lists all commits for a repository with pagination support. This endpoint
31
+ * supports both authenticated and unauthenticated access. Authenticated users can
32
+ * access private repos, while unauthenticated users can only access public repos.
33
+ * The include_stats parameter controls whether download and view statistics are
34
+ * computed (defaults to true).
35
+ */
36
+ list(repo, params, options) {
37
+ const { owner, ...query } = params;
38
+ return this._client.getAPIList(path `/commits/${owner}/${repo}`, (OffsetPaginationCommits), { query, ...options });
39
+ }
40
+ }
@@ -0,0 +1,22 @@
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.Comparative = void 0;
6
+ const resource_js_1 = require("../../core/resource.cjs");
7
+ const path_js_1 = require("../../internal/utils/path.cjs");
8
+ class Comparative extends resource_js_1.APIResource {
9
+ /**
10
+ * Create a comparative experiment.
11
+ */
12
+ create(body, options) {
13
+ return this._client.post('/api/v1/datasets/comparative', { body, ...options });
14
+ }
15
+ /**
16
+ * Delete a specific comparative experiment.
17
+ */
18
+ delete(comparativeExperimentID, options) {
19
+ return this._client.delete((0, path_js_1.path) `/api/v1/datasets/comparative/${comparativeExperimentID}`, options);
20
+ }
21
+ }
22
+ exports.Comparative = Comparative;
@@ -0,0 +1,55 @@
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 Comparative extends APIResource {
5
+ /**
6
+ * Create a comparative experiment.
7
+ */
8
+ create(body: ComparativeCreateParams, options?: RequestOptions): APIPromise<ComparativeCreateResponse>;
9
+ /**
10
+ * Delete a specific comparative experiment.
11
+ */
12
+ delete(comparativeExperimentID: string, options?: RequestOptions): APIPromise<unknown>;
13
+ }
14
+ /**
15
+ * Simple experiment info schema for use with comparative experiments
16
+ */
17
+ export interface SimpleExperimentInfo {
18
+ id: string;
19
+ name: string;
20
+ }
21
+ /**
22
+ * Enum for available comparative experiment columns to sort by.
23
+ */
24
+ export type SortByComparativeExperimentColumn = 'name' | 'created_at';
25
+ /**
26
+ * ComparativeExperiment schema.
27
+ */
28
+ export interface ComparativeCreateResponse {
29
+ id: string;
30
+ created_at: string;
31
+ modified_at: string;
32
+ reference_dataset_id: string;
33
+ tenant_id: string;
34
+ description?: string | null;
35
+ extra?: {
36
+ [key: string]: unknown;
37
+ } | null;
38
+ name?: string | null;
39
+ }
40
+ export type ComparativeDeleteResponse = unknown;
41
+ export interface ComparativeCreateParams {
42
+ experiment_ids: Array<string>;
43
+ id?: string;
44
+ created_at?: string;
45
+ description?: string | null;
46
+ extra?: {
47
+ [key: string]: unknown;
48
+ } | null;
49
+ modified_at?: string;
50
+ name?: string | null;
51
+ reference_dataset_id?: string | null;
52
+ }
53
+ export declare namespace Comparative {
54
+ export { type SimpleExperimentInfo as SimpleExperimentInfo, type SortByComparativeExperimentColumn as SortByComparativeExperimentColumn, type ComparativeCreateResponse as ComparativeCreateResponse, type ComparativeDeleteResponse as ComparativeDeleteResponse, type ComparativeCreateParams as ComparativeCreateParams, };
55
+ }
@@ -0,0 +1,18 @@
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 Comparative extends APIResource {
6
+ /**
7
+ * Create a comparative experiment.
8
+ */
9
+ create(body, options) {
10
+ return this._client.post('/api/v1/datasets/comparative', { body, ...options });
11
+ }
12
+ /**
13
+ * Delete a specific comparative experiment.
14
+ */
15
+ delete(comparativeExperimentID, options) {
16
+ return this._client.delete(path `/api/v1/datasets/comparative/${comparativeExperimentID}`, options);
17
+ }
18
+ }
@@ -0,0 +1,193 @@
1
+ "use strict";
2
+ // @ts-nocheck
3
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
5
+ if (k2 === undefined) k2 = k;
6
+ var desc = Object.getOwnPropertyDescriptor(m, k);
7
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
8
+ desc = { enumerable: true, get: function() { return m[k]; } };
9
+ }
10
+ Object.defineProperty(o, k2, desc);
11
+ }) : (function(o, m, k, k2) {
12
+ if (k2 === undefined) k2 = k;
13
+ o[k2] = m[k];
14
+ }));
15
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
16
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
17
+ }) : function(o, v) {
18
+ o["default"] = v;
19
+ });
20
+ var __importStar = (this && this.__importStar) || (function () {
21
+ var ownKeys = function(o) {
22
+ ownKeys = Object.getOwnPropertyNames || function (o) {
23
+ var ar = [];
24
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
25
+ return ar;
26
+ };
27
+ return ownKeys(o);
28
+ };
29
+ return function (mod) {
30
+ if (mod && mod.__esModule) return mod;
31
+ var result = {};
32
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
33
+ __setModuleDefault(result, mod);
34
+ return result;
35
+ };
36
+ })();
37
+ Object.defineProperty(exports, "__esModule", { value: true });
38
+ exports.Datasets = void 0;
39
+ const resource_js_1 = require("../../core/resource.cjs");
40
+ const ComparativeAPI = __importStar(require("./comparative.cjs"));
41
+ const comparative_js_1 = require("./comparative.cjs");
42
+ const ExperimentsAPI = __importStar(require("./experiments.cjs"));
43
+ const experiments_js_1 = require("./experiments.cjs");
44
+ const GroupAPI = __importStar(require("./group.cjs"));
45
+ const group_js_1 = require("./group.cjs");
46
+ const RunsAPI = __importStar(require("./runs.cjs"));
47
+ const runs_js_1 = require("./runs.cjs");
48
+ const ShareAPI = __importStar(require("./share.cjs"));
49
+ const share_js_1 = require("./share.cjs");
50
+ const SplitsAPI = __importStar(require("./splits.cjs"));
51
+ const splits_js_1 = require("./splits.cjs");
52
+ const VersionsAPI = __importStar(require("./versions.cjs"));
53
+ const versions_js_1 = require("./versions.cjs");
54
+ const pagination_js_1 = require("../../core/pagination.cjs");
55
+ const uploads_js_1 = require("../../internal/uploads.cjs");
56
+ const path_js_1 = require("../../internal/utils/path.cjs");
57
+ class Datasets extends resource_js_1.APIResource {
58
+ constructor() {
59
+ super(...arguments);
60
+ Object.defineProperty(this, "versions", {
61
+ enumerable: true,
62
+ configurable: true,
63
+ writable: true,
64
+ value: new VersionsAPI.Versions(this._client)
65
+ });
66
+ Object.defineProperty(this, "runs", {
67
+ enumerable: true,
68
+ configurable: true,
69
+ writable: true,
70
+ value: new RunsAPI.Runs(this._client)
71
+ });
72
+ Object.defineProperty(this, "group", {
73
+ enumerable: true,
74
+ configurable: true,
75
+ writable: true,
76
+ value: new GroupAPI.Group(this._client)
77
+ });
78
+ Object.defineProperty(this, "experiments", {
79
+ enumerable: true,
80
+ configurable: true,
81
+ writable: true,
82
+ value: new ExperimentsAPI.Experiments(this._client)
83
+ });
84
+ Object.defineProperty(this, "share", {
85
+ enumerable: true,
86
+ configurable: true,
87
+ writable: true,
88
+ value: new ShareAPI.Share(this._client)
89
+ });
90
+ Object.defineProperty(this, "comparative", {
91
+ enumerable: true,
92
+ configurable: true,
93
+ writable: true,
94
+ value: new ComparativeAPI.Comparative(this._client)
95
+ });
96
+ Object.defineProperty(this, "splits", {
97
+ enumerable: true,
98
+ configurable: true,
99
+ writable: true,
100
+ value: new SplitsAPI.Splits(this._client)
101
+ });
102
+ }
103
+ /**
104
+ * Create a new dataset.
105
+ */
106
+ create(body, options) {
107
+ return this._client.post('/api/v1/datasets', { body, ...options });
108
+ }
109
+ /**
110
+ * Get a specific dataset.
111
+ */
112
+ retrieve(datasetID, options) {
113
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}`, options);
114
+ }
115
+ /**
116
+ * Update a specific dataset.
117
+ */
118
+ update(datasetID, body, options) {
119
+ return this._client.patch((0, path_js_1.path) `/api/v1/datasets/${datasetID}`, { body, ...options });
120
+ }
121
+ /**
122
+ * Get all datasets by query params and owner.
123
+ */
124
+ list(params = {}, options) {
125
+ const { datatype, ...query } = params ?? {};
126
+ return this._client.getAPIList('/api/v1/datasets', (pagination_js_1.OffsetPaginationTopLevelArray), {
127
+ query: { data_type: datatype, ...query },
128
+ ...options,
129
+ });
130
+ }
131
+ /**
132
+ * Delete a specific dataset.
133
+ */
134
+ delete(datasetID, options) {
135
+ return this._client.delete((0, path_js_1.path) `/api/v1/datasets/${datasetID}`, options);
136
+ }
137
+ /**
138
+ * Clone a dataset.
139
+ */
140
+ clone(body, options) {
141
+ return this._client.post('/api/v1/datasets/clone', { body, ...options });
142
+ }
143
+ /**
144
+ * Download a dataset as CSV format.
145
+ */
146
+ retrieveCsv(datasetID, query = {}, options) {
147
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/csv`, { query, ...options });
148
+ }
149
+ /**
150
+ * Download a dataset as CSV format.
151
+ */
152
+ retrieveJSONL(datasetID, query = {}, options) {
153
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/jsonl`, { query, ...options });
154
+ }
155
+ /**
156
+ * Download a dataset as OpenAI Evals Jsonl format.
157
+ */
158
+ retrieveOpenAI(datasetID, query = {}, options) {
159
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/openai`, { query, ...options });
160
+ }
161
+ /**
162
+ * Download a dataset as OpenAI Jsonl format.
163
+ */
164
+ retrieveOpenAIFt(datasetID, query = {}, options) {
165
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/openai_ft`, { query, ...options });
166
+ }
167
+ /**
168
+ * Get dataset version by as_of or exact tag.
169
+ */
170
+ retrieveVersion(datasetID, query = {}, options) {
171
+ return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/version`, { query, ...options });
172
+ }
173
+ /**
174
+ * Set a tag on a dataset version.
175
+ */
176
+ updateTags(datasetID, body, options) {
177
+ return this._client.put((0, path_js_1.path) `/api/v1/datasets/${datasetID}/tags`, { body, ...options });
178
+ }
179
+ /**
180
+ * Create a new dataset from a CSV or JSONL file.
181
+ */
182
+ upload(body, options) {
183
+ return this._client.post('/api/v1/datasets/upload', (0, uploads_js_1.multipartFormRequestOptions)({ body, ...options }, this._client));
184
+ }
185
+ }
186
+ exports.Datasets = Datasets;
187
+ Datasets.Versions = versions_js_1.Versions;
188
+ Datasets.Runs = runs_js_1.Runs;
189
+ Datasets.Group = group_js_1.Group;
190
+ Datasets.Experiments = experiments_js_1.Experiments;
191
+ Datasets.Share = share_js_1.Share;
192
+ Datasets.Comparative = comparative_js_1.Comparative;
193
+ Datasets.Splits = splits_js_1.Splits;