langsmith 0.10.7 → 0.10.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/dist/_openapi_client/client.cjs +26 -2
  2. package/dist/_openapi_client/client.d.ts +15 -6
  3. package/dist/_openapi_client/client.js +27 -3
  4. package/dist/_openapi_client/internal/detect-platform.cjs +1 -1
  5. package/dist/_openapi_client/internal/detect-platform.js +1 -1
  6. package/dist/_openapi_client/resources/annotation-queues/items.cjs +13 -6
  7. package/dist/_openapi_client/resources/annotation-queues/items.d.ts +33 -8
  8. package/dist/_openapi_client/resources/annotation-queues/items.js +13 -6
  9. package/dist/_openapi_client/resources/datasets/datasets.cjs +9 -0
  10. package/dist/_openapi_client/resources/datasets/datasets.d.ts +4 -0
  11. package/dist/_openapi_client/resources/datasets/datasets.js +9 -0
  12. package/dist/_openapi_client/resources/datasets/examples.cjs +26 -0
  13. package/dist/_openapi_client/resources/datasets/examples.d.ts +23 -0
  14. package/dist/_openapi_client/resources/datasets/examples.js +22 -0
  15. package/dist/_openapi_client/resources/fleet/fleet.cjs +54 -0
  16. package/dist/_openapi_client/resources/fleet/fleet.d.ts +9 -0
  17. package/dist/_openapi_client/resources/fleet/fleet.js +17 -0
  18. package/dist/_openapi_client/resources/fleet/threads.cjs +18 -0
  19. package/dist/_openapi_client/resources/fleet/threads.d.ts +19 -0
  20. package/dist/_openapi_client/resources/fleet/threads.js +14 -0
  21. package/dist/_openapi_client/resources/index.cjs +8 -2
  22. package/dist/_openapi_client/resources/index.d.ts +6 -3
  23. package/dist/_openapi_client/resources/index.js +5 -2
  24. package/dist/_openapi_client/resources/info.d.ts +6 -0
  25. package/dist/_openapi_client/resources/issues.cjs +2 -2
  26. package/dist/_openapi_client/resources/issues.d.ts +188 -4
  27. package/dist/_openapi_client/resources/issues.js +2 -2
  28. package/dist/_openapi_client/resources/online-evaluators.cjs +7 -4
  29. package/dist/_openapi_client/resources/online-evaluators.d.ts +63 -4
  30. package/dist/_openapi_client/resources/online-evaluators.js +7 -4
  31. package/dist/_openapi_client/resources/product-feedback.cjs +33 -0
  32. package/dist/_openapi_client/resources/product-feedback.d.ts +77 -0
  33. package/dist/_openapi_client/resources/product-feedback.js +29 -0
  34. package/dist/_openapi_client/resources/runs/runs.d.ts +26 -16
  35. package/dist/_openapi_client/resources/sandboxes/boxes.cjs +44 -4
  36. package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +256 -21
  37. package/dist/_openapi_client/resources/sandboxes/boxes.js +44 -4
  38. package/dist/_openapi_client/resources/sandboxes/registries.d.ts +10 -2
  39. package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +13 -0
  40. package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +169 -14
  41. package/dist/_openapi_client/resources/sandboxes/sandboxes.js +13 -0
  42. package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +10 -6
  43. package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +37 -6
  44. package/dist/_openapi_client/resources/sandboxes/snapshots.js +10 -6
  45. package/dist/_openapi_client/resources/sessions.cjs +23 -0
  46. package/dist/_openapi_client/resources/sessions.d.ts +732 -0
  47. package/dist/_openapi_client/resources/sessions.js +19 -0
  48. package/dist/_openapi_client/resources/threads/index.cjs +9 -0
  49. package/dist/_openapi_client/resources/threads/index.d.ts +2 -0
  50. package/dist/_openapi_client/resources/threads/index.js +4 -0
  51. package/dist/_openapi_client/resources/threads/share.cjs +61 -0
  52. package/dist/_openapi_client/resources/threads/share.d.ts +71 -0
  53. package/dist/_openapi_client/resources/threads/share.js +57 -0
  54. package/dist/_openapi_client/resources/threads/threads.cjs +143 -0
  55. package/dist/_openapi_client/resources/threads/threads.d.ts +973 -0
  56. package/dist/_openapi_client/resources/threads/threads.js +106 -0
  57. package/dist/_openapi_client/resources/threads.cjs +15 -67
  58. package/dist/_openapi_client/resources/threads.d.ts +1 -709
  59. package/dist/_openapi_client/resources/threads.js +1 -65
  60. package/dist/_openapi_client/resources/traces.d.ts +7 -1
  61. package/dist/_openapi_client/version.cjs +1 -1
  62. package/dist/_openapi_client/version.js +1 -1
  63. package/dist/address.cjs +176 -99
  64. package/dist/address.d.ts +63 -8
  65. package/dist/address.js +170 -90
  66. package/dist/anonymizer/index.cjs +1 -1
  67. package/dist/anonymizer/index.js +1 -1
  68. package/dist/client.cjs +39 -19
  69. package/dist/client.d.ts +20 -4
  70. package/dist/client.js +34 -14
  71. package/dist/experimental/otel/exporter.cjs +21 -4
  72. package/dist/experimental/otel/exporter.d.ts +4 -2
  73. package/dist/experimental/otel/exporter.js +21 -4
  74. package/dist/index.cjs +5 -2
  75. package/dist/index.d.ts +2 -2
  76. package/dist/index.js +2 -2
  77. package/dist/run_trees.cjs +26 -43
  78. package/dist/run_trees.d.ts +4 -4
  79. package/dist/run_trees.js +23 -40
  80. package/dist/sandbox/client.cjs +33 -4
  81. package/dist/sandbox/client.d.ts +4 -0
  82. package/dist/sandbox/client.js +34 -5
  83. package/dist/sandbox/command_handle.cjs +8 -0
  84. package/dist/sandbox/command_handle.js +8 -0
  85. package/dist/sandbox/sandbox.cjs +7 -0
  86. package/dist/sandbox/sandbox.js +7 -0
  87. package/dist/sandbox/service_url.cjs +9 -1
  88. package/dist/sandbox/service_url.d.ts +2 -1
  89. package/dist/sandbox/service_url.js +9 -1
  90. package/dist/sandbox/tracing.cjs +13 -0
  91. package/dist/sandbox/tracing.d.ts +1 -0
  92. package/dist/sandbox/tracing.js +10 -0
  93. package/dist/schemas.d.ts +3 -3
  94. package/dist/traceable.cjs +5 -4
  95. package/dist/traceable.js +4 -3
  96. package/dist/utils/{agent_addressing.cjs → addressing.cjs} +22 -23
  97. package/dist/utils/{agent_addressing.d.ts → addressing.d.ts} +5 -8
  98. package/dist/utils/{agent_addressing.js → addressing.js} +23 -23
  99. package/dist/utils/env.cjs +6 -4
  100. package/dist/utils/env.js +6 -4
  101. package/package.json +1 -1
@@ -1,709 +1 @@
1
- import { APIResource } from '../core/resource.js';
2
- import { APIPromise } from '../core/api-promise.js';
3
- import { ItemsCursorGetPagination, type ItemsCursorGetPaginationParams, ItemsCursorPostPagination, type ItemsCursorPostPaginationParams, PagePromise } from '../core/pagination.js';
4
- import { RequestOptions } from '../internal/request-options.js';
5
- export declare class Threads extends APIResource {
6
- /**
7
- * Retrieve all traces belonging to a specific thread within a project.
8
- *
9
- * Self-hosted deployments require LangSmith `v0.16` or later.
10
- *
11
- * @example
12
- * ```ts
13
- * // Automatically fetches more pages as needed.
14
- * for await (const threadTrace of client.threads.listTraces(
15
- * 'thread_id',
16
- * { project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e' },
17
- * )) {
18
- * // ...
19
- * }
20
- * ```
21
- */
22
- listTraces(threadID: string, query: ThreadListTracesParams, options?: RequestOptions): PagePromise<ThreadTracesItemsCursorGetPagination, ThreadTrace>;
23
- /**
24
- * Query threads within a project (session), with cursor-based pagination. Returns
25
- * threads matching the given time range and optional filters.
26
- *
27
- * Self-hosted deployments require LangSmith `v0.16` or later.
28
- *
29
- * @example
30
- * ```ts
31
- * // Automatically fetches more pages as needed.
32
- * for await (const thread of client.threads.query()) {
33
- * // ...
34
- * }
35
- * ```
36
- */
37
- query(body: ThreadQueryParams, options?: RequestOptions): PagePromise<ThreadsItemsCursorPostPagination, Thread>;
38
- /**
39
- * Compute aggregate stats for a single thread (turn count, latency percentiles,
40
- * token/cost sums, and detail breakdowns) within a project.
41
- *
42
- * Self-hosted deployments require LangSmith `v0.16` or later.
43
- *
44
- * @example
45
- * ```ts
46
- * const threadStats = await client.threads.stats(
47
- * 'thread_id',
48
- * {
49
- * selects: ['TURNS'],
50
- * session_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
51
- * },
52
- * );
53
- * ```
54
- */
55
- stats(threadID: string, query: ThreadStatsParams, options?: RequestOptions): APIPromise<ThreadStats>;
56
- }
57
- export type ThreadTracesItemsCursorGetPagination = ItemsCursorGetPagination<ThreadTrace>;
58
- export type ThreadsItemsCursorPostPagination = ItemsCursorPostPagination<Thread>;
59
- export interface Thread {
60
- /**
61
- * `count` is how many root traces (conversation turns) fall in this thread for the
62
- * query time range.
63
- */
64
- count?: number;
65
- /**
66
- * `feedback_stats` is the aggregated feedback across traces in the thread, keyed
67
- * by feedback key; shape matches `feedback_stats` on a single run.
68
- */
69
- feedback_stats?: {
70
- [key: string]: Thread.FeedbackStats;
71
- };
72
- /**
73
- * `first_inputs` is a truncated preview of inputs from the earliest trace in the
74
- * thread for the query window.
75
- */
76
- first_inputs?: string;
77
- /**
78
- * `first_trace_id` is the root trace UUID for the chronologically first trace in
79
- * the query time window.
80
- */
81
- first_trace_id?: string;
82
- /**
83
- * `last_error` is a short error summary from the most recent failing trace in the
84
- * thread. Absent when there is no error in the window.
85
- */
86
- last_error?: string;
87
- /**
88
- * `last_outputs` is a truncated preview of outputs from the latest trace in the
89
- * thread for the query window.
90
- */
91
- last_outputs?: string;
92
- /**
93
- * `last_trace_id` is the root trace UUID for the chronologically last trace in the
94
- * query time window.
95
- */
96
- last_trace_id?: string;
97
- /**
98
- * `latency_p50` is the approximate median end-to-end latency of traces in the
99
- * thread, in seconds.
100
- */
101
- latency_p50?: number;
102
- /**
103
- * `latency_p99` is the approximate 99th percentile end-to-end latency of traces in
104
- * the thread, in seconds.
105
- */
106
- latency_p99?: number;
107
- /**
108
- * `max_start_time` is the latest trace start time in the thread (RFC3339
109
- * date-time).
110
- */
111
- max_start_time?: string;
112
- /**
113
- * `min_start_time` is the earliest trace start time in the thread (RFC3339
114
- * date-time).
115
- */
116
- min_start_time?: string;
117
- /**
118
- * `num_errored_turns` is the count of root traces in the thread (within the query
119
- * window) whose status was an error.
120
- */
121
- num_errored_turns?: number;
122
- /**
123
- * `start_time` is a reference start time for this row (RFC3339 date-time), such as
124
- * for sorting.
125
- */
126
- start_time?: string;
127
- /**
128
- * `thread_id` identifies this conversation thread within the project from the
129
- * request body `project_id`.
130
- */
131
- thread_id?: string;
132
- /**
133
- * `total_cost` is the sum of estimated USD cost across those traces.
134
- */
135
- total_cost?: number;
136
- /**
137
- * `total_cost_details` sums per-category estimated USD cost across traces in the
138
- * thread. Keys mirror `total_token_details`.
139
- *
140
- * Example: `{"cache_read": 0.012, "reasoning": 0.008}`.
141
- */
142
- total_cost_details?: {
143
- [key: string]: number;
144
- };
145
- /**
146
- * `total_token_details` sums per-category token counts across traces in the
147
- * thread. Keys are model-specific category names (for example `cache_read`,
148
- * `cache_write`, `reasoning`, `audio`).
149
- *
150
- * Example: `{"cache_read": 400, "reasoning": 120}`.
151
- */
152
- total_token_details?: {
153
- [key: string]: number;
154
- };
155
- /**
156
- * `total_tokens` is the sum of token usage across those traces.
157
- */
158
- total_tokens?: number;
159
- /**
160
- * `trace_id` is a representative root trace UUID when the summary includes one,
161
- * for example for deep links.
162
- */
163
- trace_id?: string;
164
- }
165
- export declare namespace Thread {
166
- interface FeedbackStats {
167
- /**
168
- * `avg` is the arithmetic mean of numeric feedback scores for this key on the run,
169
- * or `null` when no numeric score has been recorded (for example purely
170
- * categorical feedback).
171
- */
172
- avg?: number;
173
- /**
174
- * `comments` is a sample of human-readable comments attached to feedback points
175
- * for this key, in no particular order. May be empty; is not exhaustive when many
176
- * comments exist.
177
- */
178
- comments?: Array<string>;
179
- /**
180
- * `contains_thread_feedback` is true when at least one feedback point for this key
181
- * was submitted at the thread level (rather than at an individual run). Always
182
- * false on responses that already describe a single run in isolation.
183
- */
184
- contains_thread_feedback?: boolean;
185
- /**
186
- * `errors` is the number of feedback points recorded as errors rather than
187
- * successful scores (for example an automated evaluator that raised an exception).
188
- * Defaults to 0 when no errors occurred.
189
- */
190
- errors?: number;
191
- /**
192
- * `max` is the largest numeric feedback score recorded for this key on the run, or
193
- * `null` when no numeric score has been recorded.
194
- */
195
- max?: number;
196
- /**
197
- * `min` is the smallest numeric feedback score recorded for this key on the run,
198
- * or `null` when no numeric score has been recorded.
199
- */
200
- min?: number;
201
- /**
202
- * `n` is the number of feedback points recorded for this key on the run. For
203
- * numeric feedback this is the sample size behind `avg`, `min`, `max`, and
204
- * `stdev`; for categorical feedback it is the sum of the `values` counts.
205
- */
206
- n?: number;
207
- /**
208
- * `sources` is a sample of feedback sources for this key. Each entry is either a
209
- * plain string identifier (for example `"api"`, `"app"`, `"model"`) or a JSON
210
- * object describing a synthetic source (for example
211
- * `{"type": "__ls_composite_feedback"}` for a computed aggregate). Clients must
212
- * tolerate both shapes.
213
- */
214
- sources?: Array<unknown>;
215
- /**
216
- * `stdev` is the sample standard deviation of numeric feedback scores for this key
217
- * on the run, or `null` when it cannot be computed (for example fewer than two
218
- * numeric scores, or purely categorical feedback).
219
- */
220
- stdev?: number;
221
- /**
222
- * `values` is the distribution of categorical feedback labels for this key,
223
- * mapping each label to its occurrence count. Empty (`{}`) for purely numeric
224
- * feedback.
225
- */
226
- values?: {
227
- [key: string]: number;
228
- };
229
- }
230
- }
231
- export interface ThreadStats {
232
- /**
233
- * `completion_cost` is the sum of per-trace completion costs across the thread, in
234
- * USD. Populated when `COMPLETION_COST` is selected.
235
- */
236
- completion_cost?: number;
237
- /**
238
- * `completion_cost_details` is the per-sub-category sum of completion cost details
239
- * across the thread. Populated when `COMPLETION_COST_DETAILS` is selected.
240
- */
241
- completion_cost_details?: ThreadStats.CompletionCostDetails;
242
- /**
243
- * `completion_token_details` is the per-sub-category sum of completion token
244
- * details across the thread. Populated when `COMPLETION_TOKEN_DETAILS` is
245
- * selected.
246
- */
247
- completion_token_details?: ThreadStats.CompletionTokenDetails;
248
- /**
249
- * `completion_tokens` is the sum of per-trace completion token counts across the
250
- * thread. Populated when `COMPLETION_TOKENS` is selected.
251
- */
252
- completion_tokens?: number;
253
- /**
254
- * `feedback_stats` aggregates run-level feedback across the thread's traces, keyed
255
- * by feedback key. Populated when `FEEDBACK_STATS` is selected.
256
- */
257
- feedback_stats?: {
258
- [key: string]: ThreadStats.FeedbackStats;
259
- };
260
- /**
261
- * `first_start_time` is the earliest trace start time in the thread (RFC3339).
262
- * Populated when `FIRST_START_TIME` is selected.
263
- */
264
- first_start_time?: string;
265
- /**
266
- * `last_end_time` is the latest trace end time in the thread (RFC3339). Populated
267
- * when `LAST_END_TIME` is selected.
268
- */
269
- last_end_time?: string;
270
- /**
271
- * `last_start_time` is the latest trace start time in the thread (RFC3339).
272
- * Populated when `LAST_START_TIME` is selected.
273
- */
274
- last_start_time?: string;
275
- /**
276
- * `latency_p50_seconds` is the approximate p50 of trace latency across the thread,
277
- * in seconds. Populated when `LATENCY_P50` is selected.
278
- */
279
- latency_p50_seconds?: number;
280
- /**
281
- * `latency_p99_seconds` is the approximate p99 of trace latency across the thread,
282
- * in seconds. Populated when `LATENCY_P99` is selected.
283
- */
284
- latency_p99_seconds?: number;
285
- /**
286
- * `prompt_cost` is the sum of per-trace prompt costs across the thread, in USD.
287
- * Populated when `PROMPT_COST` is selected.
288
- */
289
- prompt_cost?: number;
290
- /**
291
- * `prompt_cost_details` is the per-sub-category sum of prompt cost details across
292
- * the thread. Populated when `PROMPT_COST_DETAILS` is selected.
293
- */
294
- prompt_cost_details?: ThreadStats.PromptCostDetails;
295
- /**
296
- * `prompt_token_details` is the per-sub-category sum of prompt token details
297
- * across the thread. Populated when `PROMPT_TOKEN_DETAILS` is selected.
298
- */
299
- prompt_token_details?: ThreadStats.PromptTokenDetails;
300
- /**
301
- * `prompt_tokens` is the sum of per-trace prompt token counts across the thread.
302
- * Populated when `PROMPT_TOKENS` is selected.
303
- */
304
- prompt_tokens?: number;
305
- /**
306
- * `total_cost` is the sum of per-trace total costs across the thread, in USD.
307
- * Populated when `TOTAL_COST` is selected.
308
- */
309
- total_cost?: number;
310
- /**
311
- * `total_tokens` is the sum of per-trace total token counts across the thread.
312
- * Populated when `TOTAL_TOKENS` is selected.
313
- */
314
- total_tokens?: number;
315
- /**
316
- * `turns` is the number of distinct traces (turns) in the thread. Populated when
317
- * `TURNS` is selected.
318
- */
319
- turns?: number;
320
- }
321
- export declare namespace ThreadStats {
322
- /**
323
- * `completion_cost_details` is the per-sub-category sum of completion cost details
324
- * across the thread. Populated when `COMPLETION_COST_DETAILS` is selected.
325
- */
326
- interface CompletionCostDetails {
327
- /**
328
- * `raw` maps each category name to its estimated USD cost.
329
- */
330
- raw?: {
331
- [key: string]: number;
332
- };
333
- }
334
- /**
335
- * `completion_token_details` is the per-sub-category sum of completion token
336
- * details across the thread. Populated when `COMPLETION_TOKEN_DETAILS` is
337
- * selected.
338
- */
339
- interface CompletionTokenDetails {
340
- /**
341
- * `raw` maps each category name to its completion-token count.
342
- */
343
- raw?: {
344
- [key: string]: number;
345
- };
346
- }
347
- interface FeedbackStats {
348
- /**
349
- * `avg` is the arithmetic mean of numeric feedback scores for this key on the run,
350
- * or `null` when no numeric score has been recorded (for example purely
351
- * categorical feedback).
352
- */
353
- avg?: number;
354
- /**
355
- * `comments` is a sample of human-readable comments attached to feedback points
356
- * for this key, in no particular order. May be empty; is not exhaustive when many
357
- * comments exist.
358
- */
359
- comments?: Array<string>;
360
- /**
361
- * `contains_thread_feedback` is true when at least one feedback point for this key
362
- * was submitted at the thread level (rather than at an individual run). Always
363
- * false on responses that already describe a single run in isolation.
364
- */
365
- contains_thread_feedback?: boolean;
366
- /**
367
- * `errors` is the number of feedback points recorded as errors rather than
368
- * successful scores (for example an automated evaluator that raised an exception).
369
- * Defaults to 0 when no errors occurred.
370
- */
371
- errors?: number;
372
- /**
373
- * `max` is the largest numeric feedback score recorded for this key on the run, or
374
- * `null` when no numeric score has been recorded.
375
- */
376
- max?: number;
377
- /**
378
- * `min` is the smallest numeric feedback score recorded for this key on the run,
379
- * or `null` when no numeric score has been recorded.
380
- */
381
- min?: number;
382
- /**
383
- * `n` is the number of feedback points recorded for this key on the run. For
384
- * numeric feedback this is the sample size behind `avg`, `min`, `max`, and
385
- * `stdev`; for categorical feedback it is the sum of the `values` counts.
386
- */
387
- n?: number;
388
- /**
389
- * `sources` is a sample of feedback sources for this key. Each entry is either a
390
- * plain string identifier (for example `"api"`, `"app"`, `"model"`) or a JSON
391
- * object describing a synthetic source (for example
392
- * `{"type": "__ls_composite_feedback"}` for a computed aggregate). Clients must
393
- * tolerate both shapes.
394
- */
395
- sources?: Array<unknown>;
396
- /**
397
- * `stdev` is the sample standard deviation of numeric feedback scores for this key
398
- * on the run, or `null` when it cannot be computed (for example fewer than two
399
- * numeric scores, or purely categorical feedback).
400
- */
401
- stdev?: number;
402
- /**
403
- * `values` is the distribution of categorical feedback labels for this key,
404
- * mapping each label to its occurrence count. Empty (`{}`) for purely numeric
405
- * feedback.
406
- */
407
- values?: {
408
- [key: string]: number;
409
- };
410
- }
411
- /**
412
- * `prompt_cost_details` is the per-sub-category sum of prompt cost details across
413
- * the thread. Populated when `PROMPT_COST_DETAILS` is selected.
414
- */
415
- interface PromptCostDetails {
416
- /**
417
- * `raw` maps each category name to its estimated USD cost.
418
- */
419
- raw?: {
420
- [key: string]: number;
421
- };
422
- }
423
- /**
424
- * `prompt_token_details` is the per-sub-category sum of prompt token details
425
- * across the thread. Populated when `PROMPT_TOKEN_DETAILS` is selected.
426
- */
427
- interface PromptTokenDetails {
428
- /**
429
- * `raw` maps each category name to its prompt-token count.
430
- */
431
- raw?: {
432
- [key: string]: number;
433
- };
434
- }
435
- }
436
- export interface ThreadTrace {
437
- /**
438
- * `completion_cost` is the estimated USD cost for the completion. Omitted unless
439
- * included in `selects`.
440
- */
441
- completion_cost?: number;
442
- /**
443
- * `completion_cost_details` is the USD cost breakdown for completion-side
444
- * categories; per-category values are under `raw`. Omitted unless included in
445
- * `selects`.
446
- */
447
- completion_cost_details?: ThreadTrace.CompletionCostDetails;
448
- /**
449
- * `completion_token_details` is the completion-side token breakdown by category;
450
- * per-category counts are under `raw`. Omitted unless included in `selects`.
451
- */
452
- completion_token_details?: ThreadTrace.CompletionTokenDetails;
453
- /**
454
- * `completion_tokens` is the completion-side token count. Omitted unless included
455
- * in `selects`.
456
- */
457
- completion_tokens?: number;
458
- /**
459
- * `end_time` is when the root run ended (RFC3339 date-time). JSON null if the run
460
- * is still in progress. Omitted unless included in `selects`.
461
- */
462
- end_time?: string;
463
- /**
464
- * `error` is the full root run error message when the run failed. Omitted unless
465
- * included in `selects`.
466
- */
467
- error?: string;
468
- /**
469
- * `error_preview` is a short error summary when the run failed. Omitted unless
470
- * included in `selects`.
471
- */
472
- error_preview?: string;
473
- /**
474
- * `first_token_time` is when the first output token was produced (RFC3339
475
- * date-time), for streamed runs when that metadata exists. Omitted unless included
476
- * in `selects`.
477
- */
478
- first_token_time?: string;
479
- /**
480
- * `inputs` is the full root run input payload. Omitted unless included in
481
- * `selects`.
482
- */
483
- inputs?: unknown;
484
- /**
485
- * `inputs_preview` is a truncated text preview of inputs. Omitted unless included
486
- * in `selects`.
487
- */
488
- inputs_preview?: string;
489
- /**
490
- * `latency` is wall-clock duration from start to end in seconds. Omitted unless
491
- * included in `selects`.
492
- */
493
- latency?: number;
494
- /**
495
- * `name` is a human-readable label for the root run (for example the model name,
496
- * function name, or step name chosen when the run was traced). Omitted unless
497
- * included in `selects`.
498
- */
499
- name?: string;
500
- /**
501
- * `op` is a numeric code identifying the root run's `run_type` (for example LLM
502
- * vs. tool vs. chain). Encoded as a number for compatibility with legacy clients;
503
- * prefer the string `run_type` on `RunResponse` when available. Omitted unless
504
- * included in `selects`.
505
- */
506
- op?: number;
507
- /**
508
- * `outputs` is the full root run output payload. Omitted unless included in
509
- * `selects`.
510
- */
511
- outputs?: unknown;
512
- /**
513
- * `outputs_preview` is a truncated text preview of outputs. Omitted unless
514
- * included in `selects`.
515
- */
516
- outputs_preview?: string;
517
- /**
518
- * `prompt_cost` is the estimated USD cost for the prompt. Omitted unless included
519
- * in `selects`.
520
- */
521
- prompt_cost?: number;
522
- /**
523
- * `prompt_cost_details` is the USD cost breakdown for prompt-side categories;
524
- * per-category values are under `raw`. Omitted unless included in `selects`.
525
- */
526
- prompt_cost_details?: ThreadTrace.PromptCostDetails;
527
- /**
528
- * `prompt_token_details` is the prompt-side token breakdown by category;
529
- * per-category counts are under nested `raw`. Omitted unless included in
530
- * `selects`.
531
- */
532
- prompt_token_details?: ThreadTrace.PromptTokenDetails;
533
- /**
534
- * `prompt_tokens` is the prompt-side token count. Omitted unless included in
535
- * `selects`.
536
- */
537
- prompt_tokens?: number;
538
- /**
539
- * `start_time` is when the trace started (RFC3339 date-time). Omitted unless
540
- * included in `selects`.
541
- */
542
- start_time?: string;
543
- /**
544
- * `thread_id` is the conversation thread UUID that contains this trace. Matches
545
- * the `thread_id` path parameter of the request. Omitted unless included in
546
- * `selects`.
547
- */
548
- thread_id?: string;
549
- /**
550
- * `total_cost` is the estimated total USD cost for the root run. Omitted unless
551
- * included in `selects`.
552
- */
553
- total_cost?: number;
554
- /**
555
- * `total_tokens` is the total token count (prompt plus completion). Omitted unless
556
- * included in `selects`.
557
- */
558
- total_tokens?: number;
559
- /**
560
- * `trace_id` is the UUID of this trace (the root run). Returned when `TRACE_ID` is
561
- * in `selects`, or when `selects` is omitted entirely (sole fallback field).
562
- */
563
- trace_id?: string;
564
- }
565
- export declare namespace ThreadTrace {
566
- /**
567
- * `completion_cost_details` is the USD cost breakdown for completion-side
568
- * categories; per-category values are under `raw`. Omitted unless included in
569
- * `selects`.
570
- */
571
- interface CompletionCostDetails {
572
- /**
573
- * `raw` maps each category name to its estimated USD cost.
574
- */
575
- raw?: {
576
- [key: string]: number;
577
- };
578
- }
579
- /**
580
- * `completion_token_details` is the completion-side token breakdown by category;
581
- * per-category counts are under `raw`. Omitted unless included in `selects`.
582
- */
583
- interface CompletionTokenDetails {
584
- /**
585
- * `raw` maps each category name to its completion-token count.
586
- */
587
- raw?: {
588
- [key: string]: number;
589
- };
590
- }
591
- /**
592
- * `prompt_cost_details` is the USD cost breakdown for prompt-side categories;
593
- * per-category values are under `raw`. Omitted unless included in `selects`.
594
- */
595
- interface PromptCostDetails {
596
- /**
597
- * `raw` maps each category name to its estimated USD cost.
598
- */
599
- raw?: {
600
- [key: string]: number;
601
- };
602
- }
603
- /**
604
- * `prompt_token_details` is the prompt-side token breakdown by category;
605
- * per-category counts are under nested `raw`. Omitted unless included in
606
- * `selects`.
607
- */
608
- interface PromptTokenDetails {
609
- /**
610
- * `raw` maps each category name to its prompt-token count.
611
- */
612
- raw?: {
613
- [key: string]: number;
614
- };
615
- }
616
- }
617
- export interface ThreadListTracesParams extends ItemsCursorGetPaginationParams {
618
- /**
619
- * `project_id` is the tracing project UUID (required).
620
- */
621
- project_id: string;
622
- /**
623
- * `filter` narrows which traces are returned for this thread, using a LangSmith
624
- * filter expression evaluated against each root trace run. For example: eq(status,
625
- * "success") or has(tags, "production"). See
626
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
627
- * for syntax.
628
- */
629
- filter?: string;
630
- /**
631
- * `selects` lists which properties to include on each returned trace (repeatable
632
- * query parameter). Accepts any value of the `ThreadTraceSelectField` enum.
633
- * Properties not listed are omitted from each trace object; `trace_id` is always
634
- * returned.
635
- */
636
- selects?: Array<'THREAD_ID' | 'TRACE_ID' | 'OP' | 'PROMPT_TOKENS' | 'COMPLETION_TOKENS' | 'TOTAL_TOKENS' | 'START_TIME' | 'END_TIME' | 'LATENCY' | 'FIRST_TOKEN_TIME' | 'INPUTS_PREVIEW' | 'OUTPUTS_PREVIEW' | 'INPUTS' | 'OUTPUTS' | 'ERROR' | 'PROMPT_COST' | 'COMPLETION_COST' | 'TOTAL_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'NAME' | 'ERROR_PREVIEW'>;
637
- }
638
- export interface ThreadQueryParams extends ItemsCursorPostPaginationParams {
639
- /**
640
- * `filter` narrows which threads are returned, using a LangSmith filter expression
641
- * evaluated against each thread's root run. For example: has(tags, "production")
642
- * or eq(status, "error"). See
643
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
644
- * for syntax.
645
- */
646
- filter?: string;
647
- /**
648
- * `max_start_time` is the exclusive upper bound on thread activity (RFC3339
649
- * date-time). Defaults to now (UTC) when omitted.
650
- */
651
- max_start_time?: string;
652
- /**
653
- * `min_start_time` is the inclusive lower bound on thread activity (RFC3339
654
- * date-time). Defaults to 1 day before now (UTC) when omitted.
655
- */
656
- min_start_time?: string;
657
- /**
658
- * `project_id` is the tracing project UUID.
659
- */
660
- project_id?: string;
661
- /**
662
- * `thread_filter` narrows results using a LangSmith filter expression evaluated
663
- * against each complete thread summary. Self-hosted deployments require LangSmith
664
- * v0.17 or later; unsupported deployments return 501. See
665
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
666
- * for syntax.
667
- */
668
- thread_filter?: string;
669
- /**
670
- * `trace_filter` narrows results to threads containing at least one trace whose
671
- * root run matches this LangSmith filter expression. Trace-level aggregate fields
672
- * are evaluated using the complete trace summary. Self-hosted deployments require
673
- * LangSmith v0.17 or later; unsupported deployments return 501. See
674
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
675
- * for syntax.
676
- */
677
- trace_filter?: string;
678
- /**
679
- * `tree_filter` narrows results to threads containing at least one trace with a
680
- * matching run anywhere in its run tree. Self-hosted deployments require LangSmith
681
- * v0.17 or later; unsupported deployments return 501. See
682
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
683
- * for syntax.
684
- */
685
- tree_filter?: string;
686
- }
687
- export interface ThreadStatsParams {
688
- /**
689
- * `selects` lists which aggregate stats to compute and return (repeatable query
690
- * parameter). At least one value is required. Accepts any value of
691
- * `SingleThreadStatsSelectField`.
692
- */
693
- selects: Array<'TURNS' | 'FIRST_START_TIME' | 'LAST_START_TIME' | 'LAST_END_TIME' | 'LATENCY_P50' | 'LATENCY_P99' | 'PROMPT_TOKENS' | 'PROMPT_COST' | 'COMPLETION_TOKENS' | 'COMPLETION_COST' | 'TOTAL_TOKENS' | 'TOTAL_COST' | 'PROMPT_TOKEN_DETAILS' | 'COMPLETION_TOKEN_DETAILS' | 'PROMPT_COST_DETAILS' | 'COMPLETION_COST_DETAILS' | 'FEEDBACK_STATS'>;
694
- /**
695
- * `session_id` is the tracing project (session) UUID (required).
696
- */
697
- session_id: string;
698
- /**
699
- * `filter` narrows which of the thread's traces are aggregated, using a LangSmith
700
- * filter expression. For example: lt(start_time, "2025-01-01T00:00:00Z") or
701
- * eq(trace_id, "0190a1b2-c3d4-7ef0-a5b6-6ea3a82e9328"). See
702
- * https://docs.langchain.com/langsmith/trace-query-syntax#filter-query-language
703
- * for syntax.
704
- */
705
- filter?: string;
706
- }
707
- export declare namespace Threads {
708
- export { type Thread as Thread, type ThreadStats as ThreadStats, type ThreadTrace as ThreadTrace, type ThreadTracesItemsCursorGetPagination as ThreadTracesItemsCursorGetPagination, type ThreadsItemsCursorPostPagination as ThreadsItemsCursorPostPagination, type ThreadListTracesParams as ThreadListTracesParams, type ThreadQueryParams as ThreadQueryParams, type ThreadStatsParams as ThreadStatsParams, };
709
- }
1
+ export * from './threads/index.js';