langsmith 0.8.3 → 0.8.4

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 (38) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +5 -2
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +2 -2
  5. package/dist/_openapi_client/resources/index.cjs +4 -2
  6. package/dist/_openapi_client/resources/index.d.ts +2 -1
  7. package/dist/_openapi_client/resources/index.js +2 -1
  8. package/dist/_openapi_client/resources/issues.d.ts +7 -1
  9. package/dist/_openapi_client/resources/public/public.cjs +54 -0
  10. package/dist/_openapi_client/resources/public/public.d.ts +9 -0
  11. package/dist/_openapi_client/resources/public/public.js +17 -0
  12. package/dist/_openapi_client/resources/public/runs.cjs +56 -0
  13. package/dist/_openapi_client/resources/public/runs.d.ts +76 -0
  14. package/dist/_openapi_client/resources/public/runs.js +52 -0
  15. package/dist/_openapi_client/resources/runs/index.cjs +9 -0
  16. package/dist/_openapi_client/resources/runs/index.d.ts +2 -0
  17. package/dist/_openapi_client/resources/runs/index.js +4 -0
  18. package/dist/_openapi_client/resources/runs/runs.cjs +128 -0
  19. package/dist/_openapi_client/resources/runs/runs.d.ts +854 -0
  20. package/dist/_openapi_client/resources/runs/runs.js +91 -0
  21. package/dist/_openapi_client/resources/runs/share.cjs +42 -0
  22. package/dist/_openapi_client/resources/runs/share.d.ts +50 -0
  23. package/dist/_openapi_client/resources/runs/share.js +38 -0
  24. package/dist/_openapi_client/resources/runs.cjs +15 -69
  25. package/dist/_openapi_client/resources/runs.d.ts +1 -820
  26. package/dist/_openapi_client/resources/runs.js +1 -67
  27. package/dist/_openapi_client/resources/traces.d.ts +2 -2
  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/run_trees.cjs +8 -0
  32. package/dist/run_trees.js +8 -0
  33. package/dist/utils/constants.cjs +1 -1
  34. package/dist/utils/constants.d.ts +1 -1
  35. package/dist/utils/constants.js +1 -1
  36. package/dist/wrappers/openai.cjs +6 -0
  37. package/dist/wrappers/openai.js +6 -0
  38. package/package.json +6 -2
@@ -1,820 +1 @@
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_dataset_id?: 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
- /**
568
- * Filter runs by trace ID. When set, limit and cursor-based pagination are not
569
- * applied — all runs in the trace are returned in a single response.
570
- */
571
- trace?: string | null;
572
- trace_filter?: string | null;
573
- tree_filter?: string | null;
574
- use_experimental_search?: boolean;
575
- }
576
- export declare namespace RunStatsQueryParams {
577
- /**
578
- * Group by param for run stats.
579
- */
580
- interface GroupBy {
581
- attribute: 'name' | 'run_type' | 'tag' | 'metadata';
582
- max_groups?: number;
583
- path?: string | null;
584
- }
585
- }
586
- /**
587
- * Enum for run types.
588
- */
589
- export type RunTypeEnum = 'tool' | 'chain' | 'llm' | 'retriever' | 'embedding' | 'prompt' | 'parser';
590
- /**
591
- * Enum for run data source types.
592
- */
593
- export type RunsFilterDataSourceTypeEnum = 'current' | 'historical' | 'lite' | 'root_lite' | 'runs_feedbacks_rmt_wide';
594
- export interface RunQueryV2Params extends ItemsCursorPostPaginationParams {
595
- /**
596
- * Body param: `filter` narrows results to runs matching this LangSmith filter
597
- * expression, evaluated against each individual run. For example: and(eq(run_type,
598
- * "llm"), gt(latency, 5)) or eq(status, "error"). See
599
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
600
- * for syntax.
601
- */
602
- filter?: string;
603
- /**
604
- * Body param: `has_error` filters to runs that errored (true) or completed without
605
- * error (false).
606
- */
607
- has_error?: boolean;
608
- /**
609
- * Body param: `ids` optionally limits the request to these run UUIDs.
610
- */
611
- ids?: Array<string>;
612
- /**
613
- * Body param: `is_root` returns only root runs (true) or only non-root runs
614
- * (false).
615
- */
616
- is_root?: boolean;
617
- /**
618
- * Body param: `max_start_time` is the upper bound for run `start_time` (RFC3339).
619
- * Defaults to now.
620
- */
621
- max_start_time?: string;
622
- /**
623
- * Body param: `min_start_time` is the lower bound for run `start_time` (RFC3339).
624
- * Defaults to 1 day ago.
625
- */
626
- min_start_time?: string;
627
- /**
628
- * Body param: `project_ids` lists tracing project UUIDs to query. Required unless
629
- * `reference_dataset_id` is set. Mutually exclusive with `reference_dataset_id` —
630
- * set exactly one of them.
631
- */
632
- project_ids?: Array<string>;
633
- /**
634
- * Body param: `reference_dataset_id` resolves session IDs server-side from the
635
- * dataset. Required unless `project_ids` is set. Mutually exclusive with
636
- * `project_ids` — set exactly one of them. When provided and `min_start_time` is
637
- * omitted, the server derives it from the earliest session creation date.
638
- */
639
- reference_dataset_id?: string;
640
- /**
641
- * Body param: `reference_examples` optionally limits to runs linked to these
642
- * dataset example UUIDs.
643
- */
644
- reference_examples?: Array<string>;
645
- /**
646
- * Body param: `run_type`, when set, restricts results to runs whose `run_type`
647
- * equals this value.
648
- */
649
- run_type?: 'TOOL' | 'CHAIN' | 'LLM' | 'RETRIEVER' | 'EMBEDDING' | 'PROMPT' | 'PARSER';
650
- /**
651
- * Body param: `selects` lists which properties to include on each returned run. If
652
- * omitted, only `id` is returned. Properties not listed are omitted from each run
653
- * object.
654
- */
655
- 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'>;
656
- /**
657
- * Body param: `trace_filter` narrows results to runs whose root trace matches this
658
- * LangSmith filter expression. Use this to filter by properties of the trace's
659
- * root run — for example eq(status, "success") to include only traces that
660
- * completed without error. See
661
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
662
- * for syntax.
663
- */
664
- trace_filter?: string;
665
- /**
666
- * Body param: `trace_id` optionally limits results to runs belonging to this trace
667
- * UUID.
668
- */
669
- trace_id?: string;
670
- /**
671
- * Body param: `tree_filter` narrows results to runs that belong to a trace
672
- * containing at least one run matching this LangSmith filter expression anywhere
673
- * in the run tree (not just the root). Use this to find runs inside traces that
674
- * involved a specific tool, tag, or model — for example has(tags, "production") or
675
- * eq(name, "my_tool"). See
676
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
677
- * for syntax.
678
- */
679
- tree_filter?: string;
680
- /**
681
- * Header param: application/json
682
- */
683
- Accept?: string;
684
- }
685
- export interface RunRetrieveV2Params {
686
- /**
687
- * Query param: `project_id` is the UUID of the tracing project that owns the run.
688
- */
689
- project_id: string;
690
- /**
691
- * Query param: `start_time` is the run's `start_time` (RFC3339 date-time), used
692
- * together with `project_id` to locate the run.
693
- */
694
- start_time: string;
695
- /**
696
- * Query param: `selects` lists which properties to include on the returned run
697
- * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
698
- * omitted, only `id` is returned.
699
- */
700
- 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'>;
701
- /**
702
- * Header param: application/json
703
- */
704
- Accept?: string;
705
- }
706
- export interface RunRetrieveParams {
707
- /**
708
- * Query param: `project_id` is the UUID of the tracing project that owns the run.
709
- */
710
- project_id: string;
711
- /**
712
- * Query param: `start_time` is the run's `start_time` (RFC3339 date-time), used
713
- * together with `project_id` to locate the run.
714
- */
715
- start_time: string;
716
- /**
717
- * Query param: `selects` lists which properties to include on the returned run
718
- * (repeatable query parameter). Accepts any value of the `RunSelectField` enum. If
719
- * omitted, only `id` is returned.
720
- */
721
- 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'>;
722
- /**
723
- * Header param: application/json
724
- */
725
- Accept?: string;
726
- }
727
- export interface RunQueryParams extends ItemsCursorPostPaginationParams {
728
- /**
729
- * Body param: `filter` narrows results to runs matching this LangSmith filter
730
- * expression, evaluated against each individual run. For example: and(eq(run_type,
731
- * "llm"), gt(latency, 5)) or eq(status, "error"). See
732
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
733
- * for syntax.
734
- */
735
- filter?: string;
736
- /**
737
- * Body param: `has_error` filters to runs that errored (true) or completed without
738
- * error (false).
739
- */
740
- has_error?: boolean;
741
- /**
742
- * Body param: `ids` optionally limits the request to these run UUIDs.
743
- */
744
- ids?: Array<string>;
745
- /**
746
- * Body param: `is_root` returns only root runs (true) or only non-root runs
747
- * (false).
748
- */
749
- is_root?: boolean;
750
- /**
751
- * Body param: `max_start_time` is the upper bound for run `start_time` (RFC3339).
752
- * Defaults to now.
753
- */
754
- max_start_time?: string;
755
- /**
756
- * Body param: `min_start_time` is the lower bound for run `start_time` (RFC3339).
757
- * Defaults to 1 day ago.
758
- */
759
- min_start_time?: string;
760
- /**
761
- * Body param: `project_ids` lists tracing project UUIDs to query. Required unless
762
- * `reference_dataset_id` is set. Mutually exclusive with `reference_dataset_id` —
763
- * set exactly one of them.
764
- */
765
- project_ids?: Array<string>;
766
- /**
767
- * Body param: `reference_dataset_id` resolves session IDs server-side from the
768
- * dataset. Required unless `project_ids` is set. Mutually exclusive with
769
- * `project_ids` — set exactly one of them. When provided and `min_start_time` is
770
- * omitted, the server derives it from the earliest session creation date.
771
- */
772
- reference_dataset_id?: string;
773
- /**
774
- * Body param: `reference_examples` optionally limits to runs linked to these
775
- * dataset example UUIDs.
776
- */
777
- reference_examples?: Array<string>;
778
- /**
779
- * Body param: `run_type`, when set, restricts results to runs whose `run_type`
780
- * equals this value.
781
- */
782
- run_type?: 'TOOL' | 'CHAIN' | 'LLM' | 'RETRIEVER' | 'EMBEDDING' | 'PROMPT' | 'PARSER';
783
- /**
784
- * Body param: `selects` lists which properties to include on each returned run. If
785
- * omitted, only `id` is returned. Properties not listed are omitted from each run
786
- * object.
787
- */
788
- 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'>;
789
- /**
790
- * Body param: `trace_filter` narrows results to runs whose root trace matches this
791
- * LangSmith filter expression. Use this to filter by properties of the trace's
792
- * root run — for example eq(status, "success") to include only traces that
793
- * completed without error. See
794
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
795
- * for syntax.
796
- */
797
- trace_filter?: string;
798
- /**
799
- * Body param: `trace_id` optionally limits results to runs belonging to this trace
800
- * UUID.
801
- */
802
- trace_id?: string;
803
- /**
804
- * Body param: `tree_filter` narrows results to runs that belong to a trace
805
- * containing at least one run matching this LangSmith filter expression anywhere
806
- * in the run tree (not just the root). Use this to find runs inside traces that
807
- * involved a specific tool, tag, or model — for example has(tags, "production") or
808
- * eq(name, "my_tool"). See
809
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
810
- * for syntax.
811
- */
812
- tree_filter?: string;
813
- /**
814
- * Header param: application/json
815
- */
816
- Accept?: string;
817
- }
818
- export declare namespace Runs {
819
- 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, };
820
- }
1
+ export * from './runs/index.js';