langsmith 0.7.14 → 0.7.16

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 (61) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +10 -5
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/core/pagination.cjs +29 -1
  5. package/dist/_openapi_client/core/pagination.d.ts +11 -0
  6. package/dist/_openapi_client/core/pagination.js +27 -0
  7. package/dist/_openapi_client/resources/datasets/datasets.cjs +0 -130
  8. package/dist/_openapi_client/resources/datasets/datasets.d.ts +3 -271
  9. package/dist/_openapi_client/resources/datasets/datasets.js +0 -130
  10. package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +1 -1
  11. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +9 -9
  12. package/dist/_openapi_client/resources/datasets/experiment-runs.js +1 -1
  13. package/dist/_openapi_client/resources/index.cjs +4 -2
  14. package/dist/_openapi_client/resources/index.d.ts +3 -2
  15. package/dist/_openapi_client/resources/index.js +2 -1
  16. package/dist/_openapi_client/resources/issues.cjs +31 -0
  17. package/dist/_openapi_client/resources/issues.d.ts +78 -0
  18. package/dist/_openapi_client/resources/issues.js +27 -0
  19. package/dist/_openapi_client/resources/runs.cjs +69 -15
  20. package/dist/_openapi_client/resources/runs.d.ts +806 -1
  21. package/dist/_openapi_client/resources/runs.js +67 -1
  22. package/dist/_openapi_client/resources/sessions.d.ts +1 -1
  23. package/dist/client.cjs +1 -5
  24. package/dist/client.d.ts +2 -5
  25. package/dist/client.js +1 -5
  26. package/dist/experimental/anthropic/context.cjs +1 -0
  27. package/dist/experimental/anthropic/context.js +1 -0
  28. package/dist/index.cjs +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.js +1 -1
  31. package/dist/utils/constants.cjs +1 -1
  32. package/dist/utils/constants.d.ts +1 -1
  33. package/dist/utils/constants.js +1 -1
  34. package/dist/utils/env.cjs +1 -1
  35. package/dist/utils/env.d.ts +0 -7
  36. package/dist/utils/env.js +1 -1
  37. package/package.json +10 -10
  38. package/dist/_openapi_client/resources/datasets/comparative.cjs +0 -22
  39. package/dist/_openapi_client/resources/datasets/comparative.d.ts +0 -55
  40. package/dist/_openapi_client/resources/datasets/comparative.js +0 -18
  41. package/dist/_openapi_client/resources/datasets/runs.cjs +0 -22
  42. package/dist/_openapi_client/resources/datasets/runs.d.ts +0 -172
  43. package/dist/_openapi_client/resources/datasets/runs.js +0 -18
  44. package/dist/_openapi_client/resources/datasets/share.cjs +0 -32
  45. package/dist/_openapi_client/resources/datasets/share.d.ts +0 -28
  46. package/dist/_openapi_client/resources/datasets/share.js +0 -28
  47. package/dist/_openapi_client/resources/datasets/splits.cjs +0 -22
  48. package/dist/_openapi_client/resources/datasets/splits.d.ts +0 -30
  49. package/dist/_openapi_client/resources/datasets/splits.js +0 -18
  50. package/dist/_openapi_client/resources/datasets/versions.cjs +0 -23
  51. package/dist/_openapi_client/resources/datasets/versions.d.ts +0 -36
  52. package/dist/_openapi_client/resources/datasets/versions.js +0 -19
  53. package/dist/_openapi_client/resources/runs/index.cjs +0 -9
  54. package/dist/_openapi_client/resources/runs/index.d.ts +0 -2
  55. package/dist/_openapi_client/resources/runs/index.js +0 -4
  56. package/dist/_openapi_client/resources/runs/rules.cjs +0 -9
  57. package/dist/_openapi_client/resources/runs/rules.d.ts +0 -3
  58. package/dist/_openapi_client/resources/runs/rules.js +0 -5
  59. package/dist/_openapi_client/resources/runs/runs.cjs +0 -115
  60. package/dist/_openapi_client/resources/runs/runs.d.ts +0 -800
  61. package/dist/_openapi_client/resources/runs/runs.js +0 -78
@@ -1 +1,806 @@
1
- export * from './runs/index.js';
1
+ import { APIResource } from '../core/resource.js';
2
+ import * as SessionsAPI from './sessions.js';
3
+ import { APIPromise } from '../core/api-promise.js';
4
+ import { ItemsCursorPostPagination, type ItemsCursorPostPaginationParams, PagePromise } from '../core/pagination.js';
5
+ import { RequestOptions } from '../internal/request-options.js';
6
+ export declare class Runs extends APIResource {
7
+ /**
8
+ * **Alpha:** The request and response contract may change; Returns a paginated
9
+ * list of runs for the given projects within min/max start_time. Supports filters,
10
+ * cursor pagination, and `selects` to select fields to return.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * // Automatically fetches more pages as needed.
15
+ * for await (const run of client.runs.queryV2()) {
16
+ * // ...
17
+ * }
18
+ * ```
19
+ */
20
+ queryV2(params: RunQueryV2Params, options?: RequestOptions): PagePromise<RunsItemsCursorPostPagination, Run>;
21
+ /**
22
+ * **Alpha:** The request and response contract may change; Returns one run by ID
23
+ * for the given session and start_time. Use the `selects` query parameter
24
+ * (repeatable) to select fields to return.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const run = await client.runs.retrieveV2(
29
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
30
+ * {
31
+ * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
32
+ * start_time: '2019-12-27T18:11:19.117Z',
33
+ * },
34
+ * );
35
+ * ```
36
+ */
37
+ retrieveV2(runID: string, params: RunRetrieveV2Params, options?: RequestOptions): APIPromise<Run>;
38
+ retrieve: (runID: string, params: RunRetrieveV2Params, options?: RequestOptions) => APIPromise<Run>;
39
+ query: (params: RunQueryV2Params, options?: RequestOptions) => PagePromise<RunsItemsCursorPostPagination, Run>;
40
+ }
41
+ export type RunsItemsCursorPostPagination = ItemsCursorPostPagination<Run>;
42
+ export interface ResponseBodyForRunsGenerateQuery {
43
+ feedback_urls: {
44
+ [key: string]: string;
45
+ };
46
+ filter: string;
47
+ }
48
+ export interface Run {
49
+ /**
50
+ * `id` is this run's UUID.
51
+ */
52
+ id?: string;
53
+ /**
54
+ * `app_path` identifies the application code location that produced this run, if
55
+ * recorded.
56
+ */
57
+ app_path?: string;
58
+ /**
59
+ * `attachments` maps each attachment file name to a pre-signed HTTPS download URL.
60
+ */
61
+ attachments?: {
62
+ [key: string]: string;
63
+ };
64
+ /**
65
+ * `completion_cost` is estimated USD cost for the completion.
66
+ */
67
+ completion_cost?: number;
68
+ /**
69
+ * `completion_cost_details` is the per-category USD breakdown of
70
+ * `completion_cost`. Categories mirror `completion_token_details`. Returned only
71
+ * when the `COMPLETION_COST_DETAILS` field is requested.
72
+ */
73
+ completion_cost_details?: Run.CompletionCostDetails;
74
+ /**
75
+ * `completion_token_details` is the per-category breakdown of `completion_tokens`.
76
+ * Category names are model-specific (for example `reasoning`, `audio`). Returned
77
+ * only when the `COMPLETION_TOKEN_DETAILS` field is requested.
78
+ */
79
+ completion_token_details?: Run.CompletionTokenDetails;
80
+ /**
81
+ * `completion_tokens` is the completion-side token count.
82
+ */
83
+ completion_tokens?: number;
84
+ /**
85
+ * `dotted_order` is the hierarchical ordering key for trace trees.
86
+ */
87
+ dotted_order?: string;
88
+ /**
89
+ * `end_time` is when the run ended (RFC3339 date-time). JSON null if the run has
90
+ * not finished yet.
91
+ */
92
+ end_time?: string;
93
+ /**
94
+ * `error` is the error message when `status` indicates failure.
95
+ */
96
+ error?: string;
97
+ /**
98
+ * `error_preview` is a truncated plain-text error snippet.
99
+ */
100
+ error_preview?: string;
101
+ /**
102
+ * `events` is the ordered list of run events (for example streaming tokens).
103
+ */
104
+ events?: Array<Run.Event>;
105
+ /**
106
+ * `extra` is additional runtime JSON attached to the run.
107
+ */
108
+ extra?: {
109
+ [key: string]: unknown;
110
+ };
111
+ /**
112
+ * `feedback_stats` aggregates feedback scores keyed by feedback key.
113
+ */
114
+ feedback_stats?: {
115
+ [key: string]: Run.FeedbackStats;
116
+ };
117
+ /**
118
+ * `first_token_time` is when the first output token was produced (RFC3339
119
+ * date-time), when recorded for streamed runs.
120
+ */
121
+ first_token_time?: string;
122
+ /**
123
+ * `inputs` is the run input payload (arbitrary JSON object).
124
+ */
125
+ inputs?: {
126
+ [key: string]: unknown;
127
+ };
128
+ /**
129
+ * `inputs_preview` is a truncated plain-text preview of inputs.
130
+ */
131
+ inputs_preview?: string;
132
+ /**
133
+ * `is_in_dataset` is true when this run is linked to a dataset example.
134
+ */
135
+ is_in_dataset?: boolean;
136
+ /**
137
+ * `is_root` is true when this run has no parent (it is the trace root).
138
+ */
139
+ is_root?: boolean;
140
+ /**
141
+ * `latency_seconds` is wall-clock duration from start to end in seconds.
142
+ */
143
+ latency_seconds?: number;
144
+ /**
145
+ * `manifest` is the serialized configuration of the traced component (for example
146
+ * the model parameters, prompt template, or pipeline definition), when recorded.
147
+ */
148
+ manifest?: {
149
+ [key: string]: unknown;
150
+ };
151
+ /**
152
+ * `metadata` is arbitrary user-defined JSON metadata.
153
+ */
154
+ metadata?: {
155
+ [key: string]: unknown;
156
+ };
157
+ /**
158
+ * `name` is a human-readable label for the run (for example the model name,
159
+ * function name, or step name chosen when the run was traced).
160
+ */
161
+ name?: string;
162
+ /**
163
+ * `outputs` is the run output payload (arbitrary JSON object).
164
+ */
165
+ outputs?: {
166
+ [key: string]: unknown;
167
+ };
168
+ /**
169
+ * `outputs_preview` is a truncated plain-text preview of outputs.
170
+ */
171
+ outputs_preview?: string;
172
+ /**
173
+ * `parent_run_ids` lists ancestor run UUIDs from the trace root down to the direct
174
+ * parent.
175
+ */
176
+ parent_run_ids?: Array<string>;
177
+ /**
178
+ * `price_model_id` identifies the pricing model UUID used for cost estimates, when
179
+ * recorded.
180
+ */
181
+ price_model_id?: string;
182
+ /**
183
+ * `project_id` is the tracing project UUID this run was logged to.
184
+ */
185
+ project_id?: string;
186
+ /**
187
+ * `prompt_cost` is estimated USD cost for the prompt.
188
+ */
189
+ prompt_cost?: number;
190
+ /**
191
+ * `prompt_cost_details` is the per-category USD breakdown of `prompt_cost`.
192
+ * Categories mirror `prompt_token_details`. Returned only when the
193
+ * `PROMPT_COST_DETAILS` field is requested.
194
+ */
195
+ prompt_cost_details?: Run.PromptCostDetails;
196
+ /**
197
+ * `prompt_token_details` is the per-category breakdown of `prompt_tokens`.
198
+ * Category names are model-specific (for example `cache_read`, `cache_write`).
199
+ * Returned only when the `PROMPT_TOKEN_DETAILS` field is requested.
200
+ */
201
+ prompt_token_details?: Run.PromptTokenDetails;
202
+ /**
203
+ * `prompt_tokens` is the prompt-side token count.
204
+ */
205
+ prompt_tokens?: number;
206
+ /**
207
+ * `reference_dataset_id` is the dataset UUID for the reference example, if any.
208
+ */
209
+ reference_dataset_id?: string;
210
+ /**
211
+ * `reference_example_id` is the dataset example UUID this run was compared
212
+ * against, if any.
213
+ */
214
+ reference_example_id?: string;
215
+ /**
216
+ * `run_type` identifies what kind of operation this run represents (for example an
217
+ * LLM call, a tool invocation, or a chain step). See the `RunType` enum for
218
+ * allowed values.
219
+ */
220
+ run_type?: 'TOOL' | 'CHAIN' | 'LLM' | 'RETRIEVER' | 'EMBEDDING' | 'PROMPT' | 'PARSER';
221
+ /**
222
+ * `share_url` is the fully-qualified URL of this run's public view, rooted at the
223
+ * deployment's LangSmith app origin (for example
224
+ * `https://smith.langchain.com/public/4f7a1b2c-8d9e-4a0b-9c1d-2e3f4a5b6c7d/r`). It
225
+ * is returned only when `SHARE_URL` is included in `selects`, and only when the
226
+ * run has been explicitly shared; the URL remains stable until the run is
227
+ * unshared. Anyone with this URL can view the run anonymously, so treat it as a
228
+ * secret and do not log it.
229
+ */
230
+ share_url?: string;
231
+ /**
232
+ * `start_time` is when the run started (RFC3339 date-time).
233
+ */
234
+ start_time?: string;
235
+ /**
236
+ * `status` is the completion status of the run.
237
+ */
238
+ status?: 'SUCCESS' | 'ERROR' | 'PENDING';
239
+ /**
240
+ * `tags` lists user-defined tags on this run.
241
+ */
242
+ tags?: Array<string>;
243
+ /**
244
+ * `thread_evaluation_time` is thread-level evaluation timing (RFC3339 date-time),
245
+ * when recorded.
246
+ */
247
+ thread_evaluation_time?: string;
248
+ /**
249
+ * `thread_id` is the conversation thread UUID this run belongs to, if any.
250
+ */
251
+ thread_id?: string;
252
+ /**
253
+ * `total_cost` is total estimated USD cost (prompt plus completion).
254
+ */
255
+ total_cost?: number;
256
+ /**
257
+ * `total_tokens` is prompt plus completion tokens.
258
+ */
259
+ total_tokens?: number;
260
+ /**
261
+ * `trace_id` is the root trace UUID; for a root run it matches `id`.
262
+ */
263
+ trace_id?: string;
264
+ }
265
+ export declare namespace Run {
266
+ /**
267
+ * `completion_cost_details` is the per-category USD breakdown of
268
+ * `completion_cost`. Categories mirror `completion_token_details`. Returned only
269
+ * when the `COMPLETION_COST_DETAILS` field is requested.
270
+ */
271
+ interface CompletionCostDetails {
272
+ /**
273
+ * `raw` maps each category name to its estimated USD cost.
274
+ */
275
+ raw?: {
276
+ [key: string]: number;
277
+ };
278
+ }
279
+ /**
280
+ * `completion_token_details` is the per-category breakdown of `completion_tokens`.
281
+ * Category names are model-specific (for example `reasoning`, `audio`). Returned
282
+ * only when the `COMPLETION_TOKEN_DETAILS` field is requested.
283
+ */
284
+ interface CompletionTokenDetails {
285
+ /**
286
+ * `raw` maps each category name to its completion-token count.
287
+ */
288
+ raw?: {
289
+ [key: string]: number;
290
+ };
291
+ }
292
+ interface Event {
293
+ /**
294
+ * `kwargs` is the event payload — an opaque JSON object whose shape depends on
295
+ * `name` and on the emitting SDK. For example LangChain emits `{"token": {...}}`
296
+ * for `new_token` events, tool-call start/end details for tool events, and
297
+ * arbitrary user-defined payloads for custom events. Clients should treat `kwargs`
298
+ * as untyped JSON: do not assume specific keys exist for a given `name`, and
299
+ * tolerate additional unknown keys appearing over time.
300
+ */
301
+ kwargs?: unknown;
302
+ /**
303
+ * `name` is the event kind. Common values emitted by the LangChain/LangSmith
304
+ * tracer SDKs include `"start"`, `"end"`, and `"new_token"`, but applications may
305
+ * emit arbitrary strings for their own instrumentation.
306
+ */
307
+ name?: string;
308
+ /**
309
+ * `time` is when the event occurred (RFC3339 date-time with millisecond
310
+ * precision).
311
+ */
312
+ time?: string;
313
+ }
314
+ interface FeedbackStats {
315
+ /**
316
+ * `avg` is the arithmetic mean of numeric feedback scores for this key on the run,
317
+ * or `null` when no numeric score has been recorded (for example purely
318
+ * categorical feedback).
319
+ */
320
+ avg?: number;
321
+ /**
322
+ * `comments` is a sample of human-readable comments attached to feedback points
323
+ * for this key, in no particular order. May be empty; is not exhaustive when many
324
+ * comments exist.
325
+ */
326
+ comments?: Array<string>;
327
+ /**
328
+ * `contains_thread_feedback` is true when at least one feedback point for this key
329
+ * was submitted at the thread level (rather than at an individual run). Always
330
+ * false on responses that already describe a single run in isolation.
331
+ */
332
+ contains_thread_feedback?: boolean;
333
+ /**
334
+ * `errors` is the number of feedback points recorded as errors rather than
335
+ * successful scores (for example an automated evaluator that raised an exception).
336
+ * Defaults to 0 when no errors occurred.
337
+ */
338
+ errors?: number;
339
+ /**
340
+ * `max` is the largest numeric feedback score recorded for this key on the run, or
341
+ * `null` when no numeric score has been recorded.
342
+ */
343
+ max?: number;
344
+ /**
345
+ * `min` is the smallest numeric feedback score recorded for this key on the run,
346
+ * or `null` when no numeric score has been recorded.
347
+ */
348
+ min?: number;
349
+ /**
350
+ * `n` is the number of feedback points recorded for this key on the run. For
351
+ * numeric feedback this is the sample size behind `avg`, `min`, `max`, and
352
+ * `stdev`; for categorical feedback it is the sum of the `values` counts.
353
+ */
354
+ n?: number;
355
+ /**
356
+ * `sources` is a sample of feedback sources for this key. Each entry is either a
357
+ * plain string identifier (for example `"api"`, `"app"`, `"model"`) or a JSON
358
+ * object describing a synthetic source (for example
359
+ * `{"type": "__ls_composite_feedback"}` for a computed aggregate). Clients must
360
+ * tolerate both shapes.
361
+ */
362
+ sources?: Array<unknown>;
363
+ /**
364
+ * `stdev` is the sample standard deviation of numeric feedback scores for this key
365
+ * on the run, or `null` when it cannot be computed (for example fewer than two
366
+ * numeric scores, or purely categorical feedback).
367
+ */
368
+ stdev?: number;
369
+ /**
370
+ * `values` is the distribution of categorical feedback labels for this key,
371
+ * mapping each label to its occurrence count. Empty (`{}`) for purely numeric
372
+ * feedback.
373
+ */
374
+ values?: {
375
+ [key: string]: number;
376
+ };
377
+ }
378
+ /**
379
+ * `prompt_cost_details` is the per-category USD breakdown of `prompt_cost`.
380
+ * Categories mirror `prompt_token_details`. Returned only when the
381
+ * `PROMPT_COST_DETAILS` field is requested.
382
+ */
383
+ interface PromptCostDetails {
384
+ /**
385
+ * `raw` maps each category name to its estimated USD cost.
386
+ */
387
+ raw?: {
388
+ [key: string]: number;
389
+ };
390
+ }
391
+ /**
392
+ * `prompt_token_details` is the per-category breakdown of `prompt_tokens`.
393
+ * Category names are model-specific (for example `cache_read`, `cache_write`).
394
+ * Returned only when the `PROMPT_TOKEN_DETAILS` field is requested.
395
+ */
396
+ interface PromptTokenDetails {
397
+ /**
398
+ * `raw` maps each category name to its prompt-token count.
399
+ */
400
+ raw?: {
401
+ [key: string]: number;
402
+ };
403
+ }
404
+ }
405
+ export interface RunIngest {
406
+ id?: string;
407
+ dotted_order?: string;
408
+ end_time?: string;
409
+ error?: string;
410
+ events?: Array<{
411
+ [key: string]: unknown;
412
+ }>;
413
+ extra?: {
414
+ [key: string]: unknown;
415
+ };
416
+ input_attachments?: {
417
+ [key: string]: unknown;
418
+ };
419
+ inputs?: {
420
+ [key: string]: unknown;
421
+ };
422
+ name?: string;
423
+ output_attachments?: {
424
+ [key: string]: unknown;
425
+ };
426
+ outputs?: {
427
+ [key: string]: unknown;
428
+ };
429
+ parent_run_id?: string;
430
+ reference_example_id?: string;
431
+ run_type?: 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
432
+ serialized?: {
433
+ [key: string]: unknown;
434
+ };
435
+ session_id?: string;
436
+ session_name?: string;
437
+ start_time?: string;
438
+ status?: string;
439
+ tags?: Array<string>;
440
+ trace_id?: string;
441
+ }
442
+ /**
443
+ * Run schema.
444
+ */
445
+ export interface RunSchema {
446
+ id: string;
447
+ app_path: string;
448
+ dotted_order: string;
449
+ name: string;
450
+ /**
451
+ * Enum for run types.
452
+ */
453
+ run_type: RunTypeEnum;
454
+ session_id: string;
455
+ status: string;
456
+ trace_id: string;
457
+ child_run_ids?: Array<string> | null;
458
+ completion_cost?: string | null;
459
+ completion_cost_details?: {
460
+ [key: string]: string;
461
+ } | null;
462
+ completion_token_details?: {
463
+ [key: string]: number;
464
+ } | null;
465
+ completion_tokens?: number;
466
+ direct_child_run_ids?: Array<string> | null;
467
+ end_time?: string | null;
468
+ error?: string | null;
469
+ events?: Array<{
470
+ [key: string]: unknown;
471
+ }> | null;
472
+ execution_order?: number;
473
+ extra?: {
474
+ [key: string]: unknown;
475
+ } | null;
476
+ feedback_stats?: {
477
+ [key: string]: {
478
+ [key: string]: unknown;
479
+ };
480
+ } | null;
481
+ first_token_time?: string | null;
482
+ in_dataset?: boolean | null;
483
+ inputs?: {
484
+ [key: string]: unknown;
485
+ } | null;
486
+ inputs_preview?: string | null;
487
+ inputs_s3_urls?: {
488
+ [key: string]: unknown;
489
+ } | null;
490
+ last_queued_at?: string | null;
491
+ manifest_id?: string | null;
492
+ manifest_s3_id?: string | null;
493
+ messages?: Array<{
494
+ [key: string]: unknown;
495
+ }> | null;
496
+ outputs?: {
497
+ [key: string]: unknown;
498
+ } | null;
499
+ outputs_preview?: string | null;
500
+ outputs_s3_urls?: {
501
+ [key: string]: unknown;
502
+ } | null;
503
+ parent_run_id?: string | null;
504
+ parent_run_ids?: Array<string> | null;
505
+ price_model_id?: string | null;
506
+ prompt_cost?: string | null;
507
+ prompt_cost_details?: {
508
+ [key: string]: string;
509
+ } | null;
510
+ prompt_token_details?: {
511
+ [key: string]: number;
512
+ } | null;
513
+ prompt_tokens?: number;
514
+ reference_dataset_id?: string | null;
515
+ reference_example_id?: string | null;
516
+ s3_urls?: {
517
+ [key: string]: unknown;
518
+ } | null;
519
+ serialized?: {
520
+ [key: string]: unknown;
521
+ } | null;
522
+ share_token?: string | null;
523
+ start_time?: string;
524
+ tags?: Array<string> | null;
525
+ thread_id?: string | null;
526
+ total_cost?: string | null;
527
+ total_tokens?: number;
528
+ trace_first_received_at?: string | null;
529
+ trace_max_start_time?: string | null;
530
+ trace_min_start_time?: string | null;
531
+ trace_tier?: 'longlived' | 'shortlived' | null;
532
+ trace_upgrade?: boolean;
533
+ ttl_seconds?: number | null;
534
+ }
535
+ /**
536
+ * Query params for run stats.
537
+ */
538
+ export interface RunStatsQueryParams {
539
+ id?: Array<string> | null;
540
+ /**
541
+ * Enum for run data source types.
542
+ */
543
+ data_source_type?: RunsFilterDataSourceTypeEnum | null;
544
+ end_time?: string | null;
545
+ error?: boolean | null;
546
+ execution_order?: number | null;
547
+ filter?: string | null;
548
+ /**
549
+ * Group by param for run stats.
550
+ */
551
+ group_by?: SessionsAPI.RunStatsGroupBy | null;
552
+ groups?: Array<string | null> | null;
553
+ include_details?: boolean;
554
+ is_root?: boolean | null;
555
+ parent_run?: string | null;
556
+ query?: string | null;
557
+ reference_example?: Array<string> | null;
558
+ /**
559
+ * Enum for run types.
560
+ */
561
+ run_type?: RunTypeEnum | null;
562
+ search_filter?: string | null;
563
+ select?: Array<'run_count' | 'latency_p50' | 'latency_p99' | 'latency_avg' | 'first_token_p50' | 'first_token_p99' | 'total_tokens' | 'prompt_tokens' | 'completion_tokens' | 'median_tokens' | 'completion_tokens_p50' | 'prompt_tokens_p50' | 'tokens_p99' | 'completion_tokens_p99' | 'prompt_tokens_p99' | 'last_run_start_time' | 'feedback_stats' | 'thread_feedback_stats' | 'run_facets' | 'error_rate' | 'streaming_rate' | 'total_cost' | 'prompt_cost' | 'completion_cost' | 'cost_p50' | 'cost_p99' | 'session_feedback_stats' | 'all_run_stats' | 'all_token_stats' | 'group_count' | 'prompt_token_details' | 'completion_token_details' | 'prompt_cost_details' | 'completion_cost_details'> | null;
564
+ session?: Array<string> | null;
565
+ skip_pagination?: boolean | null;
566
+ start_time?: string | null;
567
+ trace?: string | null;
568
+ trace_filter?: string | null;
569
+ tree_filter?: string | null;
570
+ use_experimental_search?: boolean;
571
+ }
572
+ /**
573
+ * Enum for run types.
574
+ */
575
+ export type RunTypeEnum = 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
576
+ /**
577
+ * Enum for run data source types.
578
+ */
579
+ export type RunsFilterDataSourceTypeEnum = 'current' | 'historical' | 'lite' | 'root_lite' | 'runs_feedbacks_rmt_wide';
580
+ export interface RunQueryV2Params extends ItemsCursorPostPaginationParams {
581
+ /**
582
+ * Body param: `filter` narrows results to runs matching this LangSmith filter
583
+ * expression, evaluated against each individual run. For example: and(eq(run_type,
584
+ * "llm"), gt(latency, 5)) or eq(status, "error"). See
585
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
586
+ * for syntax.
587
+ */
588
+ filter?: string;
589
+ /**
590
+ * Body param: `has_error` filters to runs that errored (true) or completed without
591
+ * error (false).
592
+ */
593
+ has_error?: boolean;
594
+ /**
595
+ * Body param: `ids` optionally limits the request to these run UUIDs.
596
+ */
597
+ ids?: Array<string>;
598
+ /**
599
+ * Body param: `is_root` returns only root runs (true) or only non-root runs
600
+ * (false).
601
+ */
602
+ is_root?: boolean;
603
+ /**
604
+ * Body param: `max_start_time` is the upper bound for run `start_time` (RFC3339).
605
+ * Defaults to now.
606
+ */
607
+ max_start_time?: string;
608
+ /**
609
+ * Body param: `min_start_time` is the lower bound for run `start_time` (RFC3339).
610
+ * Defaults to 1 day ago.
611
+ */
612
+ min_start_time?: string;
613
+ /**
614
+ * Body param: `project_ids` lists tracing project UUIDs to query. Required unless
615
+ * `reference_dataset_id` is set. Mutually exclusive with `reference_dataset_id` —
616
+ * set exactly one of them.
617
+ */
618
+ project_ids?: Array<string>;
619
+ /**
620
+ * Body param: `reference_dataset_id` resolves session IDs server-side from the
621
+ * dataset. Required unless `project_ids` is set. Mutually exclusive with
622
+ * `project_ids` — set exactly one of them. When provided and `min_start_time` is
623
+ * omitted, the server derives it from the earliest session creation date.
624
+ */
625
+ reference_dataset_id?: string;
626
+ /**
627
+ * Body param: `reference_examples` optionally limits to runs linked to these
628
+ * dataset example UUIDs.
629
+ */
630
+ reference_examples?: Array<string>;
631
+ /**
632
+ * Body param: `run_type`, when set, restricts results to runs whose `run_type`
633
+ * equals this value.
634
+ */
635
+ run_type?: 'TOOL' | 'CHAIN' | 'LLM' | 'RETRIEVER' | 'EMBEDDING' | 'PROMPT' | 'PARSER';
636
+ /**
637
+ * Body param: `selects` lists which properties to include on each returned run. If
638
+ * omitted, only `id` is returned. Properties not listed are omitted from each run
639
+ * object.
640
+ */
641
+ selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'EVENTS' | 'INPUTS' | 'INPUTS_PREVIEW' | 'OUTPUTS' | 'OUTPUTS_PREVIEW' | 'MANIFEST' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_EXAMPLE_ID' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'APP_PATH' | 'ATTACHMENTS' | 'THREAD_EVALUATION_TIME' | 'IS_IN_DATASET' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
642
+ /**
643
+ * Body param: `trace_filter` narrows results to runs whose root trace matches this
644
+ * LangSmith filter expression. Use this to filter by properties of the trace's
645
+ * root run — for example eq(status, "success") to include only traces that
646
+ * completed without error. See
647
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
648
+ * for syntax.
649
+ */
650
+ trace_filter?: string;
651
+ /**
652
+ * Body param: `trace_id` optionally limits results to runs belonging to this trace
653
+ * UUID.
654
+ */
655
+ trace_id?: string;
656
+ /**
657
+ * Body param: `tree_filter` narrows results to runs that belong to a trace
658
+ * containing at least one run matching this LangSmith filter expression anywhere
659
+ * in the run tree (not just the root). Use this to find runs inside traces that
660
+ * involved a specific tool, tag, or model — for example has(tags, "production") or
661
+ * eq(name, "my_tool"). See
662
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
663
+ * for syntax.
664
+ */
665
+ tree_filter?: string;
666
+ /**
667
+ * Header param: application/json
668
+ */
669
+ Accept?: string;
670
+ }
671
+ export interface RunRetrieveV2Params {
672
+ /**
673
+ * Query param: `project_id` is the UUID of the tracing project that owns the run.
674
+ */
675
+ project_id: string;
676
+ /**
677
+ * Query param: `start_time` is the run's `start_time` (RFC3339 date-time), used
678
+ * together with `project_id` to locate the run.
679
+ */
680
+ start_time: string;
681
+ /**
682
+ * Query param: `selects` lists which properties to include on the returned run
683
+ * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
684
+ * omitted, only `id` is returned.
685
+ */
686
+ selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'EVENTS' | 'INPUTS' | 'INPUTS_PREVIEW' | 'OUTPUTS' | 'OUTPUTS_PREVIEW' | 'MANIFEST' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_EXAMPLE_ID' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'APP_PATH' | 'ATTACHMENTS' | 'THREAD_EVALUATION_TIME' | 'IS_IN_DATASET' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
687
+ /**
688
+ * Header param: application/json
689
+ */
690
+ Accept?: string;
691
+ }
692
+ export interface RunRetrieveParams {
693
+ /**
694
+ * Query param: `project_id` is the UUID of the tracing project that owns the run.
695
+ */
696
+ project_id: string;
697
+ /**
698
+ * Query param: `start_time` is the run's `start_time` (RFC3339 date-time), used
699
+ * together with `project_id` to locate the run.
700
+ */
701
+ start_time: string;
702
+ /**
703
+ * Query param: `selects` lists which properties to include on the returned run
704
+ * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
705
+ * omitted, only `id` is returned.
706
+ */
707
+ selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'EVENTS' | 'INPUTS' | 'INPUTS_PREVIEW' | 'OUTPUTS' | 'OUTPUTS_PREVIEW' | 'MANIFEST' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_EXAMPLE_ID' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'APP_PATH' | 'ATTACHMENTS' | 'THREAD_EVALUATION_TIME' | 'IS_IN_DATASET' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
708
+ /**
709
+ * Header param: application/json
710
+ */
711
+ Accept?: string;
712
+ }
713
+ export interface RunQueryParams extends ItemsCursorPostPaginationParams {
714
+ /**
715
+ * Body param: `filter` narrows results to runs matching this LangSmith filter
716
+ * expression, evaluated against each individual run. For example: and(eq(run_type,
717
+ * "llm"), gt(latency, 5)) or eq(status, "error"). See
718
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
719
+ * for syntax.
720
+ */
721
+ filter?: string;
722
+ /**
723
+ * Body param: `has_error` filters to runs that errored (true) or completed without
724
+ * error (false).
725
+ */
726
+ has_error?: boolean;
727
+ /**
728
+ * Body param: `ids` optionally limits the request to these run UUIDs.
729
+ */
730
+ ids?: Array<string>;
731
+ /**
732
+ * Body param: `is_root` returns only root runs (true) or only non-root runs
733
+ * (false).
734
+ */
735
+ is_root?: boolean;
736
+ /**
737
+ * Body param: `max_start_time` is the upper bound for run `start_time` (RFC3339).
738
+ * Defaults to now.
739
+ */
740
+ max_start_time?: string;
741
+ /**
742
+ * Body param: `min_start_time` is the lower bound for run `start_time` (RFC3339).
743
+ * Defaults to 1 day ago.
744
+ */
745
+ min_start_time?: string;
746
+ /**
747
+ * Body param: `project_ids` lists tracing project UUIDs to query. Required unless
748
+ * `reference_dataset_id` is set. Mutually exclusive with `reference_dataset_id` —
749
+ * set exactly one of them.
750
+ */
751
+ project_ids?: Array<string>;
752
+ /**
753
+ * Body param: `reference_dataset_id` resolves session IDs server-side from the
754
+ * dataset. Required unless `project_ids` is set. Mutually exclusive with
755
+ * `project_ids` — set exactly one of them. When provided and `min_start_time` is
756
+ * omitted, the server derives it from the earliest session creation date.
757
+ */
758
+ reference_dataset_id?: string;
759
+ /**
760
+ * Body param: `reference_examples` optionally limits to runs linked to these
761
+ * dataset example UUIDs.
762
+ */
763
+ reference_examples?: Array<string>;
764
+ /**
765
+ * Body param: `run_type`, when set, restricts results to runs whose `run_type`
766
+ * equals this value.
767
+ */
768
+ run_type?: 'TOOL' | 'CHAIN' | 'LLM' | 'RETRIEVER' | 'EMBEDDING' | 'PROMPT' | 'PARSER';
769
+ /**
770
+ * Body param: `selects` lists which properties to include on each returned run. If
771
+ * omitted, only `id` is returned. Properties not listed are omitted from each run
772
+ * object.
773
+ */
774
+ selects?: Array<'ID' | 'NAME' | 'RUN_TYPE' | 'STATUS' | 'START_TIME' | 'END_TIME' | 'LATENCY_SECONDS' | 'FIRST_TOKEN_TIME' | 'ERROR' | 'ERROR_PREVIEW' | 'EXTRA' | 'METADATA' | 'EVENTS' | 'INPUTS' | 'INPUTS_PREVIEW' | 'OUTPUTS' | 'OUTPUTS_PREVIEW' | 'MANIFEST' | 'PARENT_RUN_IDS' | 'PROJECT_ID' | 'TRACE_ID' | 'THREAD_ID' | 'DOTTED_ORDER' | 'IS_ROOT' | 'REFERENCE_EXAMPLE_ID' | 'REFERENCE_DATASET_ID' | 'TOTAL_TOKENS' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_COST' | 'PROMPT_COST' | 'COMPLETION_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'PRICE_MODEL_ID' | 'TAGS' | 'APP_PATH' | 'ATTACHMENTS' | 'THREAD_EVALUATION_TIME' | 'IS_IN_DATASET' | 'SHARE_URL' | 'FEEDBACK_STATS'>;
775
+ /**
776
+ * Body param: `trace_filter` narrows results to runs whose root trace matches this
777
+ * LangSmith filter expression. Use this to filter by properties of the trace's
778
+ * root run — for example eq(status, "success") to include only traces that
779
+ * completed without error. See
780
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
781
+ * for syntax.
782
+ */
783
+ trace_filter?: string;
784
+ /**
785
+ * Body param: `trace_id` optionally limits results to runs belonging to this trace
786
+ * UUID.
787
+ */
788
+ trace_id?: string;
789
+ /**
790
+ * Body param: `tree_filter` narrows results to runs that belong to a trace
791
+ * containing at least one run matching this LangSmith filter expression anywhere
792
+ * in the run tree (not just the root). Use this to find runs inside traces that
793
+ * involved a specific tool, tag, or model — for example has(tags, "production") or
794
+ * eq(name, "my_tool"). See
795
+ * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
796
+ * for syntax.
797
+ */
798
+ tree_filter?: string;
799
+ /**
800
+ * Header param: application/json
801
+ */
802
+ Accept?: string;
803
+ }
804
+ export declare namespace Runs {
805
+ export { type ResponseBodyForRunsGenerateQuery as ResponseBodyForRunsGenerateQuery, type Run as Run, type RunIngest as RunIngest, type RunSchema as RunSchema, type RunStatsQueryParams as RunStatsQueryParams, type RunTypeEnum as RunTypeEnum, type RunsFilterDataSourceTypeEnum as RunsFilterDataSourceTypeEnum, type RunsItemsCursorPostPagination as RunsItemsCursorPostPagination, type RunQueryV2Params as RunQueryV2Params, type RunRetrieveV2Params as RunRetrieveV2Params, type RunRetrieveParams as RunRetrieveParams, type RunQueryParams as RunQueryParams, };
806
+ }