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,246 @@
1
+ import { APIResource } from '../../core/resource.js';
2
+ import { APIPromise } from '../../core/api-promise.js';
3
+ import { OffsetPaginationInsightsClusteringJobs, type OffsetPaginationInsightsClusteringJobsParams, PagePromise } from '../../core/pagination.js';
4
+ import { RequestOptions } from '../../internal/request-options.js';
5
+ export declare class Insights extends APIResource {
6
+ /**
7
+ * Create an insights job.
8
+ */
9
+ create(sessionID: string, body: InsightCreateParams, options?: RequestOptions): APIPromise<InsightCreateResponse>;
10
+ /**
11
+ * Update a session cluster job.
12
+ */
13
+ update(jobID: string, params: InsightUpdateParams, options?: RequestOptions): APIPromise<InsightUpdateResponse>;
14
+ /**
15
+ * Get all clusters for a session.
16
+ */
17
+ list(sessionID: string, query?: InsightListParams | null | undefined, options?: RequestOptions): PagePromise<InsightListResponsesOffsetPaginationInsightsClusteringJobs, InsightListResponse>;
18
+ /**
19
+ * Delete a session cluster job.
20
+ */
21
+ delete(jobID: string, params: InsightDeleteParams, options?: RequestOptions): APIPromise<InsightDeleteResponse>;
22
+ /**
23
+ * Get a specific cluster job for a session.
24
+ */
25
+ retrieveJob(jobID: string, params: InsightRetrieveJobParams, options?: RequestOptions): APIPromise<InsightRetrieveJobResponse>;
26
+ /**
27
+ * Get all runs for a cluster job, optionally filtered by cluster.
28
+ */
29
+ retrieveRuns(jobID: string, params: InsightRetrieveRunsParams, options?: RequestOptions): APIPromise<InsightRetrieveRunsResponse>;
30
+ }
31
+ export type InsightListResponsesOffsetPaginationInsightsClusteringJobs = OffsetPaginationInsightsClusteringJobs<InsightListResponse>;
32
+ /**
33
+ * Request to create a run clustering job.
34
+ */
35
+ export interface CreateRunClusteringJobRequest {
36
+ attribute_schemas?: {
37
+ [key: string]: unknown;
38
+ } | null;
39
+ cluster_model?: string | null;
40
+ config_id?: string | null;
41
+ end_time?: string | null;
42
+ filter?: string | null;
43
+ hierarchy?: Array<number> | null;
44
+ is_scheduled?: boolean;
45
+ last_n_hours?: number | null;
46
+ model?: 'openai' | 'anthropic';
47
+ name?: string | null;
48
+ partitions?: {
49
+ [key: string]: string;
50
+ } | null;
51
+ sample?: number | null;
52
+ start_time?: string | null;
53
+ summary_model?: string | null;
54
+ summary_prompt?: string | null;
55
+ user_context?: {
56
+ [key: string]: string;
57
+ } | null;
58
+ validate_model_secrets?: boolean;
59
+ }
60
+ /**
61
+ * Response to creating a run clustering job.
62
+ */
63
+ export interface InsightCreateResponse {
64
+ id: string;
65
+ name: string;
66
+ status: string;
67
+ error?: string | null;
68
+ }
69
+ /**
70
+ * Response to update a session cluster job.
71
+ */
72
+ export interface InsightUpdateResponse {
73
+ name: string;
74
+ status: string;
75
+ }
76
+ /**
77
+ * Session cluster job
78
+ */
79
+ export interface InsightListResponse {
80
+ id: string;
81
+ created_at: string;
82
+ name: string;
83
+ status: string;
84
+ config_id?: string | null;
85
+ end_time?: string | null;
86
+ error?: string | null;
87
+ metadata?: {
88
+ [key: string]: unknown;
89
+ } | null;
90
+ shape?: {
91
+ [key: string]: number;
92
+ } | null;
93
+ start_time?: string | null;
94
+ }
95
+ /**
96
+ * Response to delete a session cluster job.
97
+ */
98
+ export interface InsightDeleteResponse {
99
+ id: string;
100
+ message: string;
101
+ }
102
+ /**
103
+ * Response to get a specific cluster job for a session.
104
+ */
105
+ export interface InsightRetrieveJobResponse {
106
+ id: string;
107
+ clusters: Array<InsightRetrieveJobResponse.Cluster>;
108
+ created_at: string;
109
+ name: string;
110
+ status: string;
111
+ config_id?: string | null;
112
+ end_time?: string | null;
113
+ error?: string | null;
114
+ metadata?: {
115
+ [key: string]: unknown;
116
+ } | null;
117
+ /**
118
+ * High level summary of an insights job that pulls out patterns and specific
119
+ * traces.
120
+ */
121
+ report?: InsightRetrieveJobResponse.Report | null;
122
+ shape?: {
123
+ [key: string]: number;
124
+ } | null;
125
+ start_time?: string | null;
126
+ }
127
+ export declare namespace InsightRetrieveJobResponse {
128
+ /**
129
+ * A single cluster of runs.
130
+ */
131
+ interface Cluster {
132
+ id: string;
133
+ description: string;
134
+ level: number;
135
+ name: string;
136
+ num_runs: number;
137
+ stats: {
138
+ [key: string]: unknown;
139
+ } | null;
140
+ parent_id?: string | null;
141
+ parent_name?: string | null;
142
+ }
143
+ /**
144
+ * High level summary of an insights job that pulls out patterns and specific
145
+ * traces.
146
+ */
147
+ interface Report {
148
+ created_at?: string | null;
149
+ highlighted_traces?: Array<Report.HighlightedTrace>;
150
+ key_points?: Array<string>;
151
+ title?: string | null;
152
+ }
153
+ namespace Report {
154
+ /**
155
+ * A trace highlighted in an insights report summary. Up to 10 per insights job.
156
+ */
157
+ interface HighlightedTrace {
158
+ highlight_reason: string;
159
+ rank: number;
160
+ run_id: string;
161
+ cluster_id?: string | null;
162
+ cluster_name?: string | null;
163
+ summary?: string | null;
164
+ }
165
+ }
166
+ }
167
+ export interface InsightRetrieveRunsResponse {
168
+ offset: number | null;
169
+ runs: Array<{
170
+ [key: string]: unknown;
171
+ }>;
172
+ }
173
+ export interface InsightCreateParams {
174
+ attribute_schemas?: {
175
+ [key: string]: unknown;
176
+ } | null;
177
+ cluster_model?: string | null;
178
+ config_id?: string | null;
179
+ end_time?: string | null;
180
+ filter?: string | null;
181
+ hierarchy?: Array<number> | null;
182
+ is_scheduled?: boolean;
183
+ last_n_hours?: number | null;
184
+ model?: 'openai' | 'anthropic';
185
+ name?: string | null;
186
+ partitions?: {
187
+ [key: string]: string;
188
+ } | null;
189
+ sample?: number | null;
190
+ start_time?: string | null;
191
+ summary_model?: string | null;
192
+ summary_prompt?: string | null;
193
+ user_context?: {
194
+ [key: string]: string;
195
+ } | null;
196
+ validate_model_secrets?: boolean;
197
+ }
198
+ export interface InsightUpdateParams {
199
+ /**
200
+ * Path param
201
+ */
202
+ session_id: string;
203
+ /**
204
+ * Body param
205
+ */
206
+ name: string;
207
+ }
208
+ export interface InsightListParams extends OffsetPaginationInsightsClusteringJobsParams {
209
+ config_id?: string | null;
210
+ legacy?: boolean | null;
211
+ }
212
+ export interface InsightDeleteParams {
213
+ session_id: string;
214
+ }
215
+ export interface InsightRetrieveJobParams {
216
+ session_id: string;
217
+ }
218
+ export interface InsightRetrieveRunsParams {
219
+ /**
220
+ * Path param
221
+ */
222
+ session_id: string;
223
+ /**
224
+ * Query param
225
+ */
226
+ attribute_sort_key?: string | null;
227
+ /**
228
+ * Query param
229
+ */
230
+ attribute_sort_order?: 'asc' | 'desc' | null;
231
+ /**
232
+ * Query param
233
+ */
234
+ cluster_id?: string | null;
235
+ /**
236
+ * Query param
237
+ */
238
+ limit?: number;
239
+ /**
240
+ * Query param
241
+ */
242
+ offset?: number;
243
+ }
244
+ export declare namespace Insights {
245
+ export { type CreateRunClusteringJobRequest as CreateRunClusteringJobRequest, type InsightCreateResponse as InsightCreateResponse, type InsightUpdateResponse as InsightUpdateResponse, type InsightListResponse as InsightListResponse, type InsightDeleteResponse as InsightDeleteResponse, type InsightRetrieveJobResponse as InsightRetrieveJobResponse, type InsightRetrieveRunsResponse as InsightRetrieveRunsResponse, type InsightListResponsesOffsetPaginationInsightsClusteringJobs as InsightListResponsesOffsetPaginationInsightsClusteringJobs, type InsightCreateParams as InsightCreateParams, type InsightUpdateParams as InsightUpdateParams, type InsightListParams as InsightListParams, type InsightDeleteParams as InsightDeleteParams, type InsightRetrieveJobParams as InsightRetrieveJobParams, type InsightRetrieveRunsParams as InsightRetrieveRunsParams, };
246
+ }
@@ -0,0 +1,50 @@
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 { OffsetPaginationInsightsClusteringJobs, } from '../../core/pagination.js';
5
+ import { path } from '../../internal/utils/path.js';
6
+ export class Insights extends APIResource {
7
+ /**
8
+ * Create an insights job.
9
+ */
10
+ create(sessionID, body, options) {
11
+ return this._client.post(path `/api/v1/sessions/${sessionID}/insights`, { body, ...options });
12
+ }
13
+ /**
14
+ * Update a session cluster job.
15
+ */
16
+ update(jobID, params, options) {
17
+ const { session_id, ...body } = params;
18
+ return this._client.patch(path `/api/v1/sessions/${session_id}/insights/${jobID}`, { body, ...options });
19
+ }
20
+ /**
21
+ * Get all clusters for a session.
22
+ */
23
+ list(sessionID, query = {}, options) {
24
+ return this._client.getAPIList(path `/api/v1/sessions/${sessionID}/insights`, (OffsetPaginationInsightsClusteringJobs), { query, ...options });
25
+ }
26
+ /**
27
+ * Delete a session cluster job.
28
+ */
29
+ delete(jobID, params, options) {
30
+ const { session_id } = params;
31
+ return this._client.delete(path `/api/v1/sessions/${session_id}/insights/${jobID}`, options);
32
+ }
33
+ /**
34
+ * Get a specific cluster job for a session.
35
+ */
36
+ retrieveJob(jobID, params, options) {
37
+ const { session_id } = params;
38
+ return this._client.get(path `/api/v1/sessions/${session_id}/insights/${jobID}`, options);
39
+ }
40
+ /**
41
+ * Get all runs for a cluster job, optionally filtered by cluster.
42
+ */
43
+ retrieveRuns(jobID, params, options) {
44
+ const { session_id, ...query } = params;
45
+ return this._client.get(path `/api/v1/sessions/${session_id}/insights/${jobID}/runs`, {
46
+ query,
47
+ ...options,
48
+ });
49
+ }
50
+ }
@@ -0,0 +1,109 @@
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.Sessions = void 0;
39
+ const resource_js_1 = require("../../core/resource.cjs");
40
+ const InsightsAPI = __importStar(require("./insights.cjs"));
41
+ const insights_js_1 = require("./insights.cjs");
42
+ const pagination_js_1 = require("../../core/pagination.cjs");
43
+ const headers_js_1 = require("../../internal/headers.cjs");
44
+ const path_js_1 = require("../../internal/utils/path.cjs");
45
+ class Sessions extends resource_js_1.APIResource {
46
+ constructor() {
47
+ super(...arguments);
48
+ Object.defineProperty(this, "insights", {
49
+ enumerable: true,
50
+ configurable: true,
51
+ writable: true,
52
+ value: new InsightsAPI.Insights(this._client)
53
+ });
54
+ }
55
+ /**
56
+ * Create a new session.
57
+ */
58
+ create(params, options) {
59
+ const { upsert, ...body } = params;
60
+ return this._client.post('/api/v1/sessions', { query: { upsert }, body, ...options });
61
+ }
62
+ /**
63
+ * Get a specific session.
64
+ */
65
+ retrieve(sessionID, params = {}, options) {
66
+ const { accept, ...query } = params ?? {};
67
+ return this._client.get((0, path_js_1.path) `/api/v1/sessions/${sessionID}`, {
68
+ query,
69
+ ...options,
70
+ headers: (0, headers_js_1.buildHeaders)([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
71
+ });
72
+ }
73
+ /**
74
+ * Update a session.
75
+ */
76
+ update(sessionID, body, options) {
77
+ return this._client.patch((0, path_js_1.path) `/api/v1/sessions/${sessionID}`, { body, ...options });
78
+ }
79
+ /**
80
+ * Get all sessions.
81
+ */
82
+ list(params = {}, options) {
83
+ const { accept, ...query } = params ?? {};
84
+ return this._client.getAPIList('/api/v1/sessions', (pagination_js_1.OffsetPaginationTopLevelArray), {
85
+ query,
86
+ ...options,
87
+ headers: (0, headers_js_1.buildHeaders)([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
88
+ });
89
+ }
90
+ /**
91
+ * Delete a specific session.
92
+ */
93
+ delete(sessionID, options) {
94
+ return this._client.delete((0, path_js_1.path) `/api/v1/sessions/${sessionID}`, options);
95
+ }
96
+ /**
97
+ * Get a prebuilt dashboard for a tracing project.
98
+ */
99
+ dashboard(sessionID, params, options) {
100
+ const { accept, ...body } = params;
101
+ return this._client.post((0, path_js_1.path) `/api/v1/sessions/${sessionID}/dashboard`, {
102
+ body,
103
+ ...options,
104
+ headers: (0, headers_js_1.buildHeaders)([{ ...(accept != null ? { accept: accept } : undefined) }, options?.headers]),
105
+ });
106
+ }
107
+ }
108
+ exports.Sessions = Sessions;
109
+ Sessions.Insights = insights_js_1.Insights;