@rawdash/connector-langsmith 0.1.0

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.
package/README.md ADDED
@@ -0,0 +1,137 @@
1
+ <!-- This file is generated from connector metadata by scripts/generate-connector-docs.ts. Do not edit by hand. -->
2
+
3
+ # @rawdash/connector-langsmith
4
+
5
+ [![npm version](https://img.shields.io/npm/v/@rawdash/connector-langsmith)](https://www.npmjs.com/package/@rawdash/connector-langsmith)
6
+ [![license](https://img.shields.io/npm/l/@rawdash/connector-langsmith)](https://github.com/rawdash/rawdash/blob/main/LICENSE)
7
+
8
+ Sync LangChain runs, daily run rollups (count, tokens, cost, latency), and feedback scores from a LangSmith tenant.
9
+
10
+ ## Install
11
+
12
+ ```sh
13
+ npm install @rawdash/connector-langsmith
14
+ ```
15
+
16
+ ## Authentication
17
+
18
+ A LangSmith API key with read access is required. The key is sent as the `x-api-key` header on every request.
19
+
20
+ 1. Open LangSmith -> Settings -> API Keys and create a Personal Access Token (or Service key) with read access.
21
+ 2. Copy the key (it is shown once).
22
+ 3. Set `endpoint` to your LangSmith region: https://api.smith.langchain.com (US, default), https://eu.api.smith.langchain.com (EU), or your self-hosted origin (no trailing slash).
23
+ 4. Store the API key as a secret and reference it from config as `apiKey: secret("LANGSMITH_API_KEY")`.
24
+
25
+ ## Configuration
26
+
27
+ | Field | Type | Required | Description |
28
+ | -------------- | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
29
+ | `apiKey` | secret | Yes | LangSmith API key with read access to the tenant. Create one in LangSmith -> Settings -> API Keys. |
30
+ | `endpoint` | string | No | LangSmith API base URL. Defaults to https://api.smith.langchain.com (US cloud). Use https://eu.api.smith.langchain.com for the EU region or your self-hosted origin. No trailing slash. |
31
+ | `lookbackDays` | number | No | How many calendar days of history to backfill on a full sync. Defaults to 30. |
32
+ | `resources` | array | No | Which LangSmith resources to sync. Omit to sync all of them. Both `runs` and `runs_per_day` are produced from the same upstream query, so listing either pulls runs. |
33
+
34
+ ## Resources
35
+
36
+ - **`langsmith_run`** _(entity)_ - LangSmith run rows, keyed by id, with name, owning session/project, parent run, run type, status, start/end timestamps, total/prompt/completion tokens, total/prompt/completion cost in USD, and end-to-end latency in milliseconds.
37
+ - Endpoint: `POST /api/v1/runs/query`
38
+ - Runs upsert by id on every run. Trace input/output payloads are not stored.
39
+ - `name`: Run name set by the SDK.
40
+ - `runType`: Run type (chain, tool, llm, embedding, parser, retriever).
41
+ - `status`: Run status (success, error, pending).
42
+ - `sessionId`: Owning session (project) id, if any.
43
+ - `sessionName`: Owning session (project) name, if any.
44
+ - `parentRunId`: Parent run id for nested runs.
45
+ - `startTime`: ISO timestamp of run start.
46
+ - `endTime`: ISO timestamp of run end, if completed.
47
+ - `totalTokens`: Aggregate token count across the run.
48
+ - `promptTokens`: Prompt token count for the run.
49
+ - `completionTokens`: Completion token count for the run.
50
+ - `totalCost`: Aggregate run cost in USD.
51
+ - `latencyMs`: End-to-end latency in milliseconds.
52
+ - `error`: Error message if the run failed.
53
+ - **`langsmith_runs_per_day`** _(metric)_ - Per-run samples used to roll runs up to daily totals at query time. One sample is emitted per run at its start timestamp, tagged with project, run type, and status. The sample value is 1 (so summing yields the run count); token, cost, and latency are exposed as additional attribute fields.
54
+ - Endpoint: `POST /api/v1/runs/query`
55
+ - Unit: runs
56
+ - Granularity: Per-run (query-time rollup)
57
+ - Dimensions: `sessionId`, `sessionName`, `runType`, `status`, `count`, `totalTokens`, `promptTokens`, `completionTokens`, `costUsd`, `latencyMs`
58
+ - No server-side aggregation - widgets group by day, project, or run type to produce the rollup.
59
+ - **`langsmith_feedback`** _(metric)_ - Feedback rows from LangSmith, one sample per feedback row at its created_at timestamp. The sample value is the numeric score (zero for non-numeric feedback) and the attribute `count` is 1 so summing yields feedback counts per (day, project, key).
60
+ - Endpoint: `GET /api/v1/feedback`
61
+ - Unit: score
62
+ - Granularity: Per-feedback (query-time rollup)
63
+ - Dimensions: `key`, `sessionId`, `runId`, `count`, `score`, `hasNumericScore`
64
+ - Non-numeric feedback (string, boolean, JSON value) is still emitted but with score 0; use `count` to count rows and average `score` for numeric trends.
65
+
66
+ ## Example
67
+
68
+ ```ts
69
+ import {
70
+ defineConfig,
71
+ defineDashboard,
72
+ defineMetric,
73
+ secret,
74
+ } from '@rawdash/core';
75
+
76
+ const langsmith = {
77
+ name: 'langsmith',
78
+ connectorId: 'langsmith',
79
+ config: {
80
+ apiKey: secret('LANGSMITH_API_KEY'),
81
+ endpoint: 'https://api.smith.langchain.com',
82
+ lookbackDays: 30,
83
+ },
84
+ };
85
+
86
+ export default defineConfig({
87
+ connectors: [langsmith],
88
+ dashboards: {
89
+ llm_observability: defineDashboard({
90
+ widgets: {
91
+ runs_today: {
92
+ kind: 'stat',
93
+ title: 'Runs today',
94
+ metric: defineMetric({
95
+ connector: langsmith,
96
+ shape: 'metric',
97
+ name: 'langsmith_runs_per_day',
98
+ fn: 'sum',
99
+ field: 'count',
100
+ }),
101
+ },
102
+ spend_today: {
103
+ kind: 'stat',
104
+ title: 'LLM spend today (USD)',
105
+ metric: defineMetric({
106
+ connector: langsmith,
107
+ shape: 'metric',
108
+ name: 'langsmith_runs_per_day',
109
+ fn: 'sum',
110
+ field: 'costUsd',
111
+ }),
112
+ },
113
+ },
114
+ }),
115
+ },
116
+ });
117
+ ```
118
+
119
+ ## Rate limits
120
+
121
+ LangSmith applies per-tenant rate limits and returns 429 with Retry-After on overrun; the shared HTTP client honors that header.
122
+
123
+ ## Limitations
124
+
125
+ - Run input/output payloads are not synced - only the run envelope plus aggregated cost, token, and latency.
126
+ - Datasets, examples, prompts, and evaluation runs are out of scope for the initial release.
127
+ - Feedback non-numeric values (string, boolean, JSON) are still counted but do not contribute to the score sample.
128
+
129
+ ## Links
130
+
131
+ - [Rawdash docs](https://rawdash.dev/docs/connectors/)
132
+ - [LangSmith API docs](https://docs.smith.langchain.com/reference)
133
+ - [GitHub](https://github.com/rawdash/rawdash)
134
+
135
+ ## License
136
+
137
+ Apache-2.0
@@ -0,0 +1,429 @@
1
+ import { BaseConnector, ConnectorContext, SyncOptions, StorageHandle, SyncResult, ConnectorDoc } from '@rawdash/core';
2
+ import { z } from 'zod';
3
+
4
+ declare const configFields: z.ZodObject<{
5
+ apiKey: z.ZodObject<{
6
+ $secret: z.ZodString;
7
+ }, z.core.$strip>;
8
+ endpoint: z.ZodDefault<z.ZodString>;
9
+ lookbackDays: z.ZodOptional<z.ZodNumber>;
10
+ resources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
11
+ runs: "runs";
12
+ runs_per_day: "runs_per_day";
13
+ feedback: "feedback";
14
+ }>>>;
15
+ }, z.core.$strip>;
16
+ declare const doc: ConnectorDoc;
17
+ interface LangSmithSettings {
18
+ endpoint: string;
19
+ lookbackDays?: number;
20
+ resources?: readonly LangSmithResource[];
21
+ }
22
+ declare const langsmithCredentials: {
23
+ apiKey: {
24
+ description: string;
25
+ auth: "required";
26
+ };
27
+ };
28
+ type LangSmithCredentials = typeof langsmithCredentials;
29
+ type LangSmithResource = 'runs' | 'runs_per_day' | 'feedback';
30
+ declare const langsmithResources: {
31
+ readonly langsmith_run: {
32
+ readonly shape: "entity";
33
+ readonly filterable: [{
34
+ readonly field: "sessionId";
35
+ readonly ops: ["eq"];
36
+ }, {
37
+ readonly field: "runType";
38
+ readonly ops: ["eq"];
39
+ readonly values: ["chain", "tool", "llm", "embedding", "parser", "retriever"];
40
+ }, {
41
+ readonly field: "status";
42
+ readonly ops: ["eq"];
43
+ readonly values: ["success", "error", "pending"];
44
+ }];
45
+ readonly description: "LangSmith run rows, keyed by id, with name, owning session/project, parent run, run type, status, start/end timestamps, total/prompt/completion tokens, total/prompt/completion cost in USD, and end-to-end latency in milliseconds.";
46
+ readonly endpoint: "POST /api/v1/runs/query";
47
+ readonly notes: "Runs upsert by id on every run. Trace input/output payloads are not stored.";
48
+ readonly fields: [{
49
+ readonly name: "name";
50
+ readonly description: "Run name set by the SDK.";
51
+ }, {
52
+ readonly name: "runType";
53
+ readonly description: "Run type (chain, tool, llm, embedding, parser, retriever).";
54
+ }, {
55
+ readonly name: "status";
56
+ readonly description: "Run status (success, error, pending).";
57
+ }, {
58
+ readonly name: "sessionId";
59
+ readonly description: "Owning session (project) id, if any.";
60
+ }, {
61
+ readonly name: "sessionName";
62
+ readonly description: "Owning session (project) name, if any.";
63
+ }, {
64
+ readonly name: "parentRunId";
65
+ readonly description: "Parent run id for nested runs.";
66
+ }, {
67
+ readonly name: "startTime";
68
+ readonly description: "ISO timestamp of run start.";
69
+ }, {
70
+ readonly name: "endTime";
71
+ readonly description: "ISO timestamp of run end, if completed.";
72
+ }, {
73
+ readonly name: "totalTokens";
74
+ readonly description: "Aggregate token count across the run.";
75
+ }, {
76
+ readonly name: "promptTokens";
77
+ readonly description: "Prompt token count for the run.";
78
+ }, {
79
+ readonly name: "completionTokens";
80
+ readonly description: "Completion token count for the run.";
81
+ }, {
82
+ readonly name: "totalCost";
83
+ readonly description: "Aggregate run cost in USD.";
84
+ }, {
85
+ readonly name: "latencyMs";
86
+ readonly description: "End-to-end latency in milliseconds.";
87
+ }, {
88
+ readonly name: "error";
89
+ readonly description: "Error message if the run failed.";
90
+ }];
91
+ readonly responses: {
92
+ readonly runs: z.ZodObject<{
93
+ runs: z.ZodArray<z.ZodObject<{
94
+ id: z.ZodString;
95
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
96
+ run_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
97
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
98
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ session_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
100
+ parent_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
101
+ start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
102
+ end_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
103
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
104
+ total_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
105
+ prompt_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
106
+ completion_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
107
+ total_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
108
+ prompt_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
109
+ completion_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
110
+ latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
111
+ }, z.core.$strip>>;
112
+ cursors: z.ZodOptional<z.ZodNullable<z.ZodObject<{
113
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
+ }, z.core.$strip>>>;
115
+ }, z.core.$strip>;
116
+ };
117
+ };
118
+ readonly langsmith_runs_per_day: {
119
+ readonly shape: "metric";
120
+ readonly description: "Per-run samples used to roll runs up to daily totals at query time. One sample is emitted per run at its start timestamp, tagged with project, run type, and status. The sample value is 1 (so summing yields the run count); token, cost, and latency are exposed as additional attribute fields.";
121
+ readonly endpoint: "POST /api/v1/runs/query";
122
+ readonly unit: "runs";
123
+ readonly granularity: "Per-run (query-time rollup)";
124
+ readonly notes: "No server-side aggregation - widgets group by day, project, or run type to produce the rollup.";
125
+ readonly dimensions: [{
126
+ readonly name: "sessionId";
127
+ readonly description: "Owning session (project) id, if any.";
128
+ }, {
129
+ readonly name: "sessionName";
130
+ readonly description: "Owning session (project) name, if any.";
131
+ }, {
132
+ readonly name: "runType";
133
+ readonly description: "Run type (chain, tool, llm, embedding, ...).";
134
+ }, {
135
+ readonly name: "status";
136
+ readonly description: "Run status (success, error, pending).";
137
+ }, {
138
+ readonly name: "count";
139
+ readonly description: "One per run; sum to get run counts. Also exposed as the sample value.";
140
+ }, {
141
+ readonly name: "totalTokens";
142
+ readonly description: "Total tokens consumed by the run.";
143
+ }, {
144
+ readonly name: "promptTokens";
145
+ readonly description: "Prompt tokens consumed by the run.";
146
+ }, {
147
+ readonly name: "completionTokens";
148
+ readonly description: "Completion tokens produced by the run.";
149
+ }, {
150
+ readonly name: "costUsd";
151
+ readonly description: "Aggregate run cost in USD.";
152
+ }, {
153
+ readonly name: "latencyMs";
154
+ readonly description: "End-to-end run latency in milliseconds.";
155
+ }];
156
+ readonly responses: {};
157
+ };
158
+ readonly langsmith_feedback: {
159
+ readonly shape: "metric";
160
+ readonly description: "Feedback rows from LangSmith, one sample per feedback row at its created_at timestamp. The sample value is the numeric score (zero for non-numeric feedback) and the attribute `count` is 1 so summing yields feedback counts per (day, project, key).";
161
+ readonly endpoint: "GET /api/v1/feedback";
162
+ readonly unit: "score";
163
+ readonly granularity: "Per-feedback (query-time rollup)";
164
+ readonly notes: "Non-numeric feedback (string, boolean, JSON value) is still emitted but with score 0; use `count` to count rows and average `score` for numeric trends.";
165
+ readonly dimensions: [{
166
+ readonly name: "key";
167
+ readonly description: "Feedback key as set by the SDK or annotator.";
168
+ }, {
169
+ readonly name: "sessionId";
170
+ readonly description: "Owning session (project) id, if known.";
171
+ }, {
172
+ readonly name: "runId";
173
+ readonly description: "Run the feedback is attached to, if any.";
174
+ }, {
175
+ readonly name: "count";
176
+ readonly description: "One per feedback row; sum to count rows.";
177
+ }, {
178
+ readonly name: "score";
179
+ readonly description: "Numeric score, or 0 for non-numeric feedback. Also exposed as the sample value.";
180
+ }, {
181
+ readonly name: "hasNumericScore";
182
+ readonly description: "1 if the feedback row had a numeric score, 0 otherwise; sum these to compute strict numeric counts.";
183
+ }];
184
+ readonly responses: {
185
+ readonly feedback: z.ZodArray<z.ZodObject<{
186
+ id: z.ZodString;
187
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
188
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
189
+ key: z.ZodString;
190
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
191
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
192
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
193
+ modified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
194
+ }, z.core.$strip>>;
195
+ };
196
+ };
197
+ };
198
+ declare const id = "langsmith";
199
+ declare class LangSmithConnector extends BaseConnector<LangSmithSettings, LangSmithCredentials> {
200
+ static readonly id = "langsmith";
201
+ static readonly resources: {
202
+ readonly langsmith_run: {
203
+ readonly shape: "entity";
204
+ readonly filterable: [{
205
+ readonly field: "sessionId";
206
+ readonly ops: ["eq"];
207
+ }, {
208
+ readonly field: "runType";
209
+ readonly ops: ["eq"];
210
+ readonly values: ["chain", "tool", "llm", "embedding", "parser", "retriever"];
211
+ }, {
212
+ readonly field: "status";
213
+ readonly ops: ["eq"];
214
+ readonly values: ["success", "error", "pending"];
215
+ }];
216
+ readonly description: "LangSmith run rows, keyed by id, with name, owning session/project, parent run, run type, status, start/end timestamps, total/prompt/completion tokens, total/prompt/completion cost in USD, and end-to-end latency in milliseconds.";
217
+ readonly endpoint: "POST /api/v1/runs/query";
218
+ readonly notes: "Runs upsert by id on every run. Trace input/output payloads are not stored.";
219
+ readonly fields: [{
220
+ readonly name: "name";
221
+ readonly description: "Run name set by the SDK.";
222
+ }, {
223
+ readonly name: "runType";
224
+ readonly description: "Run type (chain, tool, llm, embedding, parser, retriever).";
225
+ }, {
226
+ readonly name: "status";
227
+ readonly description: "Run status (success, error, pending).";
228
+ }, {
229
+ readonly name: "sessionId";
230
+ readonly description: "Owning session (project) id, if any.";
231
+ }, {
232
+ readonly name: "sessionName";
233
+ readonly description: "Owning session (project) name, if any.";
234
+ }, {
235
+ readonly name: "parentRunId";
236
+ readonly description: "Parent run id for nested runs.";
237
+ }, {
238
+ readonly name: "startTime";
239
+ readonly description: "ISO timestamp of run start.";
240
+ }, {
241
+ readonly name: "endTime";
242
+ readonly description: "ISO timestamp of run end, if completed.";
243
+ }, {
244
+ readonly name: "totalTokens";
245
+ readonly description: "Aggregate token count across the run.";
246
+ }, {
247
+ readonly name: "promptTokens";
248
+ readonly description: "Prompt token count for the run.";
249
+ }, {
250
+ readonly name: "completionTokens";
251
+ readonly description: "Completion token count for the run.";
252
+ }, {
253
+ readonly name: "totalCost";
254
+ readonly description: "Aggregate run cost in USD.";
255
+ }, {
256
+ readonly name: "latencyMs";
257
+ readonly description: "End-to-end latency in milliseconds.";
258
+ }, {
259
+ readonly name: "error";
260
+ readonly description: "Error message if the run failed.";
261
+ }];
262
+ readonly responses: {
263
+ readonly runs: z.ZodObject<{
264
+ runs: z.ZodArray<z.ZodObject<{
265
+ id: z.ZodString;
266
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
267
+ run_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
268
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
269
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
270
+ session_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
271
+ parent_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
272
+ start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
273
+ end_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
274
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
275
+ total_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
276
+ prompt_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
277
+ completion_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
278
+ total_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
279
+ prompt_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
280
+ completion_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
281
+ latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
282
+ }, z.core.$strip>>;
283
+ cursors: z.ZodOptional<z.ZodNullable<z.ZodObject<{
284
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
+ }, z.core.$strip>>>;
286
+ }, z.core.$strip>;
287
+ };
288
+ };
289
+ readonly langsmith_runs_per_day: {
290
+ readonly shape: "metric";
291
+ readonly description: "Per-run samples used to roll runs up to daily totals at query time. One sample is emitted per run at its start timestamp, tagged with project, run type, and status. The sample value is 1 (so summing yields the run count); token, cost, and latency are exposed as additional attribute fields.";
292
+ readonly endpoint: "POST /api/v1/runs/query";
293
+ readonly unit: "runs";
294
+ readonly granularity: "Per-run (query-time rollup)";
295
+ readonly notes: "No server-side aggregation - widgets group by day, project, or run type to produce the rollup.";
296
+ readonly dimensions: [{
297
+ readonly name: "sessionId";
298
+ readonly description: "Owning session (project) id, if any.";
299
+ }, {
300
+ readonly name: "sessionName";
301
+ readonly description: "Owning session (project) name, if any.";
302
+ }, {
303
+ readonly name: "runType";
304
+ readonly description: "Run type (chain, tool, llm, embedding, ...).";
305
+ }, {
306
+ readonly name: "status";
307
+ readonly description: "Run status (success, error, pending).";
308
+ }, {
309
+ readonly name: "count";
310
+ readonly description: "One per run; sum to get run counts. Also exposed as the sample value.";
311
+ }, {
312
+ readonly name: "totalTokens";
313
+ readonly description: "Total tokens consumed by the run.";
314
+ }, {
315
+ readonly name: "promptTokens";
316
+ readonly description: "Prompt tokens consumed by the run.";
317
+ }, {
318
+ readonly name: "completionTokens";
319
+ readonly description: "Completion tokens produced by the run.";
320
+ }, {
321
+ readonly name: "costUsd";
322
+ readonly description: "Aggregate run cost in USD.";
323
+ }, {
324
+ readonly name: "latencyMs";
325
+ readonly description: "End-to-end run latency in milliseconds.";
326
+ }];
327
+ readonly responses: {};
328
+ };
329
+ readonly langsmith_feedback: {
330
+ readonly shape: "metric";
331
+ readonly description: "Feedback rows from LangSmith, one sample per feedback row at its created_at timestamp. The sample value is the numeric score (zero for non-numeric feedback) and the attribute `count` is 1 so summing yields feedback counts per (day, project, key).";
332
+ readonly endpoint: "GET /api/v1/feedback";
333
+ readonly unit: "score";
334
+ readonly granularity: "Per-feedback (query-time rollup)";
335
+ readonly notes: "Non-numeric feedback (string, boolean, JSON value) is still emitted but with score 0; use `count` to count rows and average `score` for numeric trends.";
336
+ readonly dimensions: [{
337
+ readonly name: "key";
338
+ readonly description: "Feedback key as set by the SDK or annotator.";
339
+ }, {
340
+ readonly name: "sessionId";
341
+ readonly description: "Owning session (project) id, if known.";
342
+ }, {
343
+ readonly name: "runId";
344
+ readonly description: "Run the feedback is attached to, if any.";
345
+ }, {
346
+ readonly name: "count";
347
+ readonly description: "One per feedback row; sum to count rows.";
348
+ }, {
349
+ readonly name: "score";
350
+ readonly description: "Numeric score, or 0 for non-numeric feedback. Also exposed as the sample value.";
351
+ }, {
352
+ readonly name: "hasNumericScore";
353
+ readonly description: "1 if the feedback row had a numeric score, 0 otherwise; sum these to compute strict numeric counts.";
354
+ }];
355
+ readonly responses: {
356
+ readonly feedback: z.ZodArray<z.ZodObject<{
357
+ id: z.ZodString;
358
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
359
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
360
+ key: z.ZodString;
361
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
362
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
363
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
364
+ modified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
365
+ }, z.core.$strip>>;
366
+ };
367
+ };
368
+ };
369
+ static readonly schemas: {
370
+ readonly runs: z.ZodObject<{
371
+ runs: z.ZodArray<z.ZodObject<{
372
+ id: z.ZodString;
373
+ name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
374
+ run_type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
375
+ status: z.ZodOptional<z.ZodNullable<z.ZodString>>;
376
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
377
+ session_name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
378
+ parent_run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
379
+ start_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
380
+ end_time: z.ZodOptional<z.ZodNullable<z.ZodString>>;
381
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
382
+ total_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
383
+ prompt_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
384
+ completion_tokens: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
385
+ total_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
386
+ prompt_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
387
+ completion_cost: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
388
+ latency: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
389
+ }, z.core.$strip>>;
390
+ cursors: z.ZodOptional<z.ZodNullable<z.ZodObject<{
391
+ next: z.ZodOptional<z.ZodNullable<z.ZodString>>;
392
+ }, z.core.$strip>>>;
393
+ }, z.core.$strip>;
394
+ } & {
395
+ readonly feedback: z.ZodArray<z.ZodObject<{
396
+ id: z.ZodString;
397
+ run_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
398
+ session_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
399
+ key: z.ZodString;
400
+ score: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
401
+ comment: z.ZodOptional<z.ZodNullable<z.ZodString>>;
402
+ created_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
403
+ modified_at: z.ZodOptional<z.ZodNullable<z.ZodString>>;
404
+ }, z.core.$strip>>;
405
+ } & Readonly<Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
406
+ static create(input: unknown, ctx?: ConnectorContext): LangSmithConnector;
407
+ readonly id = "langsmith";
408
+ readonly credentials: {
409
+ apiKey: {
410
+ description: string;
411
+ auth: "required";
412
+ };
413
+ };
414
+ private get baseUrl();
415
+ private buildHeaders;
416
+ private windowStartIso;
417
+ private wantsRunEntity;
418
+ private wantsRunsPerDay;
419
+ private wantsFeedback;
420
+ private fetchRunsPage;
421
+ private writeRunsBatch;
422
+ private fetchFeedbackPage;
423
+ private writeFeedbackBatch;
424
+ private activePhases;
425
+ private clearScopeOnFirstPage;
426
+ sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<SyncResult>;
427
+ }
428
+
429
+ export { LangSmithConnector, type LangSmithResource, type LangSmithSettings, configFields, LangSmithConnector as default, doc, id, langsmithResources as resources };