langsmith 0.7.10 → 0.7.12

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