langsmith 0.7.15 → 0.7.17

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