langsmith 0.7.14 → 0.7.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/dist/_openapi_client/client.cjs +9 -1
  2. package/dist/_openapi_client/client.d.ts +10 -5
  3. package/dist/_openapi_client/client.js +9 -1
  4. package/dist/_openapi_client/core/pagination.cjs +29 -1
  5. package/dist/_openapi_client/core/pagination.d.ts +11 -0
  6. package/dist/_openapi_client/core/pagination.js +27 -0
  7. package/dist/_openapi_client/resources/datasets/datasets.cjs +0 -130
  8. package/dist/_openapi_client/resources/datasets/datasets.d.ts +3 -271
  9. package/dist/_openapi_client/resources/datasets/datasets.js +0 -130
  10. package/dist/_openapi_client/resources/datasets/experiment-runs.cjs +1 -1
  11. package/dist/_openapi_client/resources/datasets/experiment-runs.d.ts +9 -9
  12. package/dist/_openapi_client/resources/datasets/experiment-runs.js +1 -1
  13. package/dist/_openapi_client/resources/index.cjs +4 -2
  14. package/dist/_openapi_client/resources/index.d.ts +3 -2
  15. package/dist/_openapi_client/resources/index.js +2 -1
  16. package/dist/_openapi_client/resources/issues.cjs +31 -0
  17. package/dist/_openapi_client/resources/issues.d.ts +78 -0
  18. package/dist/_openapi_client/resources/issues.js +27 -0
  19. package/dist/_openapi_client/resources/runs.cjs +69 -15
  20. package/dist/_openapi_client/resources/runs.d.ts +806 -1
  21. package/dist/_openapi_client/resources/runs.js +67 -1
  22. package/dist/_openapi_client/resources/sessions.d.ts +1 -1
  23. package/dist/client.cjs +1 -5
  24. package/dist/client.d.ts +2 -5
  25. package/dist/client.js +1 -5
  26. package/dist/experimental/anthropic/context.cjs +1 -0
  27. package/dist/experimental/anthropic/context.js +1 -0
  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/utils/constants.cjs +1 -1
  32. package/dist/utils/constants.d.ts +1 -1
  33. package/dist/utils/constants.js +1 -1
  34. package/dist/utils/env.cjs +1 -1
  35. package/dist/utils/env.d.ts +0 -7
  36. package/dist/utils/env.js +1 -1
  37. package/package.json +10 -10
  38. package/dist/_openapi_client/resources/datasets/comparative.cjs +0 -22
  39. package/dist/_openapi_client/resources/datasets/comparative.d.ts +0 -55
  40. package/dist/_openapi_client/resources/datasets/comparative.js +0 -18
  41. package/dist/_openapi_client/resources/datasets/runs.cjs +0 -22
  42. package/dist/_openapi_client/resources/datasets/runs.d.ts +0 -172
  43. package/dist/_openapi_client/resources/datasets/runs.js +0 -18
  44. package/dist/_openapi_client/resources/datasets/share.cjs +0 -32
  45. package/dist/_openapi_client/resources/datasets/share.d.ts +0 -28
  46. package/dist/_openapi_client/resources/datasets/share.js +0 -28
  47. package/dist/_openapi_client/resources/datasets/splits.cjs +0 -22
  48. package/dist/_openapi_client/resources/datasets/splits.d.ts +0 -30
  49. package/dist/_openapi_client/resources/datasets/splits.js +0 -18
  50. package/dist/_openapi_client/resources/datasets/versions.cjs +0 -23
  51. package/dist/_openapi_client/resources/datasets/versions.d.ts +0 -36
  52. package/dist/_openapi_client/resources/datasets/versions.js +0 -19
  53. package/dist/_openapi_client/resources/runs/index.cjs +0 -9
  54. package/dist/_openapi_client/resources/runs/index.d.ts +0 -2
  55. package/dist/_openapi_client/resources/runs/index.js +0 -4
  56. package/dist/_openapi_client/resources/runs/rules.cjs +0 -9
  57. package/dist/_openapi_client/resources/runs/rules.d.ts +0 -3
  58. package/dist/_openapi_client/resources/runs/rules.js +0 -5
  59. package/dist/_openapi_client/resources/runs/runs.cjs +0 -115
  60. package/dist/_openapi_client/resources/runs/runs.d.ts +0 -800
  61. package/dist/_openapi_client/resources/runs/runs.js +0 -78
@@ -1,3 +1,69 @@
1
1
  // @ts-nocheck
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- export * from './runs/index.js';
3
+ import { APIResource } from '../core/resource.js';
4
+ import { ItemsCursorPostPagination, } from '../core/pagination.js';
5
+ import { buildHeaders } from '../internal/headers.js';
6
+ import { path } from '../internal/utils/path.js';
7
+ export class Runs extends APIResource {
8
+ constructor() {
9
+ super(...arguments);
10
+ Object.defineProperty(this, "retrieve", {
11
+ enumerable: true,
12
+ configurable: true,
13
+ writable: true,
14
+ value: this.retrieveV2
15
+ });
16
+ Object.defineProperty(this, "query", {
17
+ enumerable: true,
18
+ configurable: true,
19
+ writable: true,
20
+ value: this.queryV2
21
+ });
22
+ }
23
+ /**
24
+ * **Alpha:** The request and response contract may change; Returns a paginated
25
+ * list of runs for the given projects within min/max start_time. Supports filters,
26
+ * cursor pagination, and `selects` to select fields to return.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * // Automatically fetches more pages as needed.
31
+ * for await (const run of client.runs.queryV2()) {
32
+ * // ...
33
+ * }
34
+ * ```
35
+ */
36
+ queryV2(params, options) {
37
+ const { Accept, ...body } = params;
38
+ return this._client.getAPIList('/v2/runs/query', (ItemsCursorPostPagination), {
39
+ body,
40
+ method: 'post',
41
+ ...options,
42
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
43
+ });
44
+ }
45
+ /**
46
+ * **Alpha:** The request and response contract may change; Returns one run by ID
47
+ * for the given session and start_time. Use the `selects` query parameter
48
+ * (repeatable) to select fields to return.
49
+ *
50
+ * @example
51
+ * ```ts
52
+ * const run = await client.runs.retrieveV2(
53
+ * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
54
+ * {
55
+ * project_id: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
56
+ * start_time: '2019-12-27T18:11:19.117Z',
57
+ * },
58
+ * );
59
+ * ```
60
+ */
61
+ retrieveV2(runID, params, options) {
62
+ const { Accept, ...query } = params;
63
+ return this._client.get(path `/v2/runs/${runID}`, {
64
+ query,
65
+ ...options,
66
+ headers: buildHeaders([{ ...(Accept != null ? { Accept: Accept } : undefined) }, options?.headers]),
67
+ });
68
+ }
69
+ }
@@ -381,7 +381,7 @@ export interface RunStatsGroupBy {
381
381
  max_groups?: number;
382
382
  path?: string | null;
383
383
  }
384
- export type SessionSortableColumns = 'name' | 'start_time' | 'last_run_start_time' | 'latency_p50' | 'latency_p99' | 'error_rate' | 'feedback' | 'runs_count';
384
+ export type SessionSortableColumns = 'name' | 'start_time' | 'last_run_start_time' | 'latency_p50' | 'latency_p99' | 'error_rate' | 'feedback';
385
385
  /**
386
386
  * Timedelta input.
387
387
  */
package/dist/client.cjs CHANGED
@@ -972,7 +972,7 @@ class Client {
972
972
  const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
973
973
  return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
974
974
  }
975
- get onlineEvaluators() {
975
+ get evaluators() {
976
976
  return this.openAPIClient.onlineEvaluators;
977
977
  }
978
978
  get runs() {
@@ -982,10 +982,6 @@ class Client {
982
982
  get sandboxes() {
983
983
  return this.openAPIClient.sandboxes;
984
984
  }
985
- /** Access the projects resource. */
986
- get projects() {
987
- return this.openAPIClient.sessions;
988
- }
989
985
  /** Access the v2 datasets resource (experimentRuns, etc.). */
990
986
  get datasets() {
991
987
  return this.openAPIClient.datasets;
package/dist/client.d.ts CHANGED
@@ -3,11 +3,10 @@ import { AsyncCallerParams } from "./utils/async_caller.js";
3
3
  import { ComparativeExperiment, DataType, Dataset, DatasetDiffInfo, DatasetShareSchema, Example, ExampleCreate, ExampleUpdate, ExampleUpdateWithoutId, Feedback, FeedbackConfig, FeedbackIngestToken, KVMap, LangChainBaseMessage, LangSmithSettings, LikePromptResponse, Prompt, PromptCommit, PromptSortField, Run, RunCreate, RunUpdate, ScoreType, TimeDelta, TracerSession, TracerSessionResult, ValueType, AnnotationQueue, RunWithAnnotationQueueInfo, Attachments, UploadExamplesResponse, UpdateExamplesResponse, DatasetVersion, AnnotationQueueWithDetails, AnnotationQueueRubricItem, FeedbackConfigSchema, AgentContext, SkillContext, Entry } from "./schemas.js";
4
4
  import { type TracingMode } from "./utils/env.js";
5
5
  import { EvaluationResult, EvaluationResults } from "./evaluation/evaluator.js";
6
- import { OnlineEvaluators } from "./_openapi_client/resources/online-evaluators.js";
6
+ import { OnlineEvaluators as Evaluators } from "./_openapi_client/resources/online-evaluators.js";
7
7
  import { Runs as OpenAPIRuns } from "./_openapi_client/resources/runs.js";
8
8
  import { Sandboxes } from "./_openapi_client/resources/sandboxes/sandboxes.js";
9
9
  import { Datasets } from "./_openapi_client/resources/datasets/datasets.js";
10
- import { Sessions } from "./_openapi_client/resources/sessions.js";
11
10
  import { PromptCache } from "./utils/prompt_cache/index.js";
12
11
  import { ProfileAuth } from "./utils/profiles.js";
13
12
  export interface ClientConfig {
@@ -514,12 +513,10 @@ export declare class Client implements LangSmithTracingClientInterface {
514
513
  private _getOpenAPIBaseUrl;
515
514
  private _newOpenAPIClient;
516
515
  private _getPlatformEndpointPath;
517
- get onlineEvaluators(): OnlineEvaluators;
516
+ get evaluators(): Evaluators;
518
517
  get runs(): OpenAPIRuns;
519
518
  /** Access the v2 sandboxes resource (registries, snapshots, boxes). */
520
519
  get sandboxes(): Sandboxes;
521
- /** Access the projects resource. */
522
- get projects(): Sessions;
523
520
  /** Access the v2 datasets resource (experimentRuns, etc.). */
524
521
  get datasets(): Datasets;
525
522
  private processInputs;
package/dist/client.js CHANGED
@@ -933,7 +933,7 @@ export class Client {
933
933
  const needsV1Prefix = this.apiUrl.slice(-3) !== "/v1" && this.apiUrl.slice(-4) !== "/v1/";
934
934
  return needsV1Prefix ? `/v1/platform/${path}` : `/platform/${path}`;
935
935
  }
936
- get onlineEvaluators() {
936
+ get evaluators() {
937
937
  return this.openAPIClient.onlineEvaluators;
938
938
  }
939
939
  get runs() {
@@ -943,10 +943,6 @@ export class Client {
943
943
  get sandboxes() {
944
944
  return this.openAPIClient.sandboxes;
945
945
  }
946
- /** Access the projects resource. */
947
- get projects() {
948
- return this.openAPIClient.sessions;
949
- }
950
946
  /** Access the v2 datasets resource (experimentRuns, etc.). */
951
947
  get datasets() {
952
948
  return this.openAPIClient.datasets;
@@ -144,6 +144,7 @@ class StreamManager {
144
144
  this.namespaces["root"].extra.metadata.is_error = message.is_error;
145
145
  this.namespaces["root"].extra.metadata.num_turns = message.num_turns;
146
146
  this.namespaces["root"].extra.metadata.session_id = message.session_id;
147
+ this.namespaces["root"].extra.metadata.thread_id = message.session_id;
147
148
  this.namespaces["root"].extra.metadata.duration_ms = message.duration_ms;
148
149
  this.namespaces["root"].extra.metadata.duration_api_ms =
149
150
  message.duration_api_ms;
@@ -141,6 +141,7 @@ export class StreamManager {
141
141
  this.namespaces["root"].extra.metadata.is_error = message.is_error;
142
142
  this.namespaces["root"].extra.metadata.num_turns = message.num_turns;
143
143
  this.namespaces["root"].extra.metadata.session_id = message.session_id;
144
+ this.namespaces["root"].extra.metadata.thread_id = message.session_id;
144
145
  this.namespaces["root"].extra.metadata.duration_ms = message.duration_ms;
145
146
  this.namespaces["root"].extra.metadata.duration_api_ms =
146
147
  message.duration_api_ms;
package/dist/index.cjs CHANGED
@@ -20,6 +20,6 @@ Object.defineProperty(exports, "PromptCache", { enumerable: true, get: function
20
20
  Object.defineProperty(exports, "configureGlobalPromptCache", { enumerable: true, get: function () { return index_js_1.configureGlobalPromptCache; } });
21
21
  Object.defineProperty(exports, "promptCacheSingleton", { enumerable: true, get: function () { return index_js_1.promptCacheSingleton; } });
22
22
  // Update using pnpm bump-version
23
- exports.__version__ = "0.7.14";
23
+ exports.__version__ = "0.7.16";
24
24
  // Metadata key to hide a traced run from LangSmith's Messages View.
25
25
  exports.LS_MESSAGE_VIEW_EXCLUDE = "ls_message_view_exclude";
package/dist/index.d.ts CHANGED
@@ -6,5 +6,5 @@ export { getDefaultProjectName } from "./utils/project.js";
6
6
  export { uuid7, uuid7FromTime } from "./uuid.js";
7
7
  export { isTracingEnabled } from "./utils/guard.js";
8
8
  export { Cache, PromptCache, type CacheConfig, type CacheMetrics, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
9
- export declare const __version__ = "0.7.14";
9
+ export declare const __version__ = "0.7.16";
10
10
  export declare const LS_MESSAGE_VIEW_EXCLUDE: "ls_message_view_exclude";
package/dist/index.js CHANGED
@@ -6,6 +6,6 @@ export { uuid7, uuid7FromTime } from "./uuid.js";
6
6
  export { isTracingEnabled } from "./utils/guard.js";
7
7
  export { Cache, PromptCache, configureGlobalPromptCache, promptCacheSingleton, } from "./utils/prompt_cache/index.js";
8
8
  // Update using pnpm bump-version
9
- export const __version__ = "0.7.14";
9
+ export const __version__ = "0.7.16";
10
10
  // Metadata key to hide a traced run from LangSmith's Messages View.
11
11
  export const LS_MESSAGE_VIEW_EXCLUDE = "ls_message_view_exclude";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports._MIN_BACKEND_VERSION = void 0;
4
- exports._MIN_BACKEND_VERSION = "0.16.6rc1";
4
+ exports._MIN_BACKEND_VERSION = "0.16.10rc1";
@@ -1 +1 @@
1
- export declare const _MIN_BACKEND_VERSION = "0.16.6rc1";
1
+ export declare const _MIN_BACKEND_VERSION = "0.16.10rc1";
@@ -1 +1 @@
1
- export const _MIN_BACKEND_VERSION = "0.16.6rc1";
1
+ export const _MIN_BACKEND_VERSION = "0.16.10rc1";
@@ -24,7 +24,7 @@ const isJsDom = () => (typeof window !== "undefined" && window.name === "nodejs"
24
24
  exports.isJsDom = isJsDom;
25
25
  // Supabase Edge Function provides a `Deno` global object
26
26
  // without `version` property
27
- const isDeno = () => typeof Deno !== "undefined";
27
+ const isDeno = () => typeof globalThis.Deno !== "undefined";
28
28
  exports.isDeno = isDeno;
29
29
  // Mark not-as-node if in Supabase Edge Function
30
30
  const isNode = () => typeof process !== "undefined" &&
@@ -1,10 +1,3 @@
1
- declare global {
2
- const Deno: {
3
- version: {
4
- deno: string;
5
- };
6
- } | undefined;
7
- }
8
1
  export declare const isBrowser: () => boolean;
9
2
  export declare const isWebWorker: () => boolean;
10
3
  export declare const isJsDom: () => boolean;
package/dist/utils/env.js CHANGED
@@ -9,7 +9,7 @@ export const isJsDom = () => (typeof window !== "undefined" && window.name === "
9
9
  (typeof navigator !== "undefined" && navigator.userAgent.includes("jsdom"));
10
10
  // Supabase Edge Function provides a `Deno` global object
11
11
  // without `version` property
12
- export const isDeno = () => typeof Deno !== "undefined";
12
+ export const isDeno = () => typeof globalThis.Deno !== "undefined";
13
13
  // Mark not-as-node if in Supabase Edge Function
14
14
  export const isNode = () => typeof process !== "undefined" &&
15
15
  typeof process.versions !== "undefined" &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "langsmith",
3
- "version": "0.7.14",
3
+ "version": "0.7.16",
4
4
  "description": "Client library to connect to the LangSmith Observability and Evaluation Platform.",
5
5
  "packageManager": "pnpm@10.33.0",
6
6
  "files": [
@@ -156,12 +156,12 @@
156
156
  "p-queue": "6.6.2"
157
157
  },
158
158
  "devDependencies": {
159
- "@ai-sdk/openai": "4.0.0-beta.74",
160
- "@ai-sdk/provider": "4.0.0-beta.19",
159
+ "@ai-sdk/openai": "4.0.4",
160
+ "@ai-sdk/provider": "4.0.1",
161
161
  "@ai-sdk/anthropic": "4.0.0-beta.67",
162
162
  "@anthropic-ai/claude-agent-sdk": "^0.3.150",
163
163
  "@anthropic-ai/sdk": "^0.98.0",
164
- "@babel/preset-env": "^7.22.4",
164
+ "@babel/preset-env": "^8.0.2",
165
165
  "@faker-js/faker": "^8.4.1",
166
166
  "@google/genai": "^2.0.1",
167
167
  "@jest/globals": "^30.4.1",
@@ -169,11 +169,11 @@
169
169
  "@langchain/core": "^0.3.72",
170
170
  "@langchain/langgraph": "^0.3.6",
171
171
  "@langchain/openai": "^0.6.17",
172
- "@openai/agents": "^0.11.5",
172
+ "@openai/agents": "^0.12.0",
173
173
  "@opentelemetry/api": "^1.9.0",
174
- "@opentelemetry/auto-instrumentations-node": "^0.76.0",
174
+ "@opentelemetry/auto-instrumentations-node": "^0.77.0",
175
175
  "@opentelemetry/context-async-hooks": "^2.6.1",
176
- "@opentelemetry/sdk-node": "^0.218.0",
176
+ "@opentelemetry/sdk-node": "^0.219.0",
177
177
  "@opentelemetry/sdk-trace-base": "^2.0.0",
178
178
  "@opentelemetry/sdk-trace-node": "^2.0.0",
179
179
  "@tsconfig/recommended": "^1.0.2",
@@ -182,8 +182,8 @@
182
182
  "@types/node-fetch": "^2.6.12",
183
183
  "@types/semver": "^7.7.1",
184
184
  "@types/ws": "^8.18.1",
185
- "@typescript-eslint/eslint-plugin": "^5.59.8",
186
- "@typescript-eslint/parser": "^5.59.8",
185
+ "@typescript-eslint/eslint-plugin": "^8.62.1",
186
+ "@typescript-eslint/parser": "^8.62.1",
187
187
  "ai": "7.0.0-beta.178",
188
188
  "babel-jest": "^30.2.0",
189
189
  "cross-env": "^10.1.0",
@@ -194,7 +194,7 @@
194
194
  "msw": "^2.11.2",
195
195
  "node-fetch": "^3.3.2",
196
196
  "openai": "^6.18.0",
197
- "oxfmt": "^0.47.0",
197
+ "oxfmt": "^0.57.0",
198
198
  "oxlint": "^1.62.0",
199
199
  "semver": "^7.7.4",
200
200
  "ts-jest": "^29.1.0",
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Comparative = void 0;
6
- const resource_js_1 = require("../../core/resource.cjs");
7
- const path_js_1 = require("../../internal/utils/path.cjs");
8
- class Comparative extends resource_js_1.APIResource {
9
- /**
10
- * Create a comparative experiment.
11
- */
12
- create(body, options) {
13
- return this._client.post('/api/v1/datasets/comparative', { body, ...options });
14
- }
15
- /**
16
- * Delete a specific comparative experiment.
17
- */
18
- delete(comparativeExperimentID, options) {
19
- return this._client.delete((0, path_js_1.path) `/api/v1/datasets/comparative/${comparativeExperimentID}`, options);
20
- }
21
- }
22
- exports.Comparative = Comparative;
@@ -1,55 +0,0 @@
1
- import { APIResource } from '../../core/resource.js';
2
- import { APIPromise } from '../../core/api-promise.js';
3
- import { RequestOptions } from '../../internal/request-options.js';
4
- export declare class Comparative extends APIResource {
5
- /**
6
- * Create a comparative experiment.
7
- */
8
- create(body: ComparativeCreateParams, options?: RequestOptions): APIPromise<ComparativeCreateResponse>;
9
- /**
10
- * Delete a specific comparative experiment.
11
- */
12
- delete(comparativeExperimentID: string, options?: RequestOptions): APIPromise<unknown>;
13
- }
14
- /**
15
- * Simple experiment info schema for use with comparative experiments
16
- */
17
- export interface SimpleExperimentInfo {
18
- id: string;
19
- name: string;
20
- }
21
- /**
22
- * Enum for available comparative experiment columns to sort by.
23
- */
24
- export type SortByComparativeExperimentColumn = 'name' | 'created_at';
25
- /**
26
- * ComparativeExperiment schema.
27
- */
28
- export interface ComparativeCreateResponse {
29
- id: string;
30
- created_at: string;
31
- modified_at: string;
32
- reference_dataset_id: string;
33
- tenant_id: string;
34
- description?: string | null;
35
- extra?: {
36
- [key: string]: unknown;
37
- } | null;
38
- name?: string | null;
39
- }
40
- export type ComparativeDeleteResponse = unknown;
41
- export interface ComparativeCreateParams {
42
- experiment_ids: Array<string>;
43
- id?: string;
44
- created_at?: string;
45
- description?: string | null;
46
- extra?: {
47
- [key: string]: unknown;
48
- } | null;
49
- modified_at?: string;
50
- name?: string | null;
51
- reference_dataset_id?: string | null;
52
- }
53
- export declare namespace Comparative {
54
- export { type SimpleExperimentInfo as SimpleExperimentInfo, type SortByComparativeExperimentColumn as SortByComparativeExperimentColumn, type ComparativeCreateResponse as ComparativeCreateResponse, type ComparativeDeleteResponse as ComparativeDeleteResponse, type ComparativeCreateParams as ComparativeCreateParams, };
55
- }
@@ -1,18 +0,0 @@
1
- // @ts-nocheck
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- import { APIResource } from '../../core/resource.js';
4
- import { path } from '../../internal/utils/path.js';
5
- export class Comparative extends APIResource {
6
- /**
7
- * Create a comparative experiment.
8
- */
9
- create(body, options) {
10
- return this._client.post('/api/v1/datasets/comparative', { body, ...options });
11
- }
12
- /**
13
- * Delete a specific comparative experiment.
14
- */
15
- delete(comparativeExperimentID, options) {
16
- return this._client.delete(path `/api/v1/datasets/comparative/${comparativeExperimentID}`, options);
17
- }
18
- }
@@ -1,22 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Runs = void 0;
6
- const resource_js_1 = require("../../core/resource.cjs");
7
- const path_js_1 = require("../../internal/utils/path.cjs");
8
- class Runs extends resource_js_1.APIResource {
9
- /**
10
- * Fetch examples for a dataset, and fetch the runs for each example if they are
11
- * associated with the given session_ids.
12
- */
13
- create(datasetID, params, options) {
14
- const { format, ...body } = params;
15
- return this._client.post((0, path_js_1.path) `/api/v1/datasets/${datasetID}/runs`, {
16
- query: { format },
17
- body,
18
- ...options,
19
- });
20
- }
21
- }
22
- exports.Runs = Runs;
@@ -1,172 +0,0 @@
1
- import { APIResource } from '../../core/resource.js';
2
- import * as RunsAPI_ from '../runs/runs.js';
3
- import { APIPromise } from '../../core/api-promise.js';
4
- import { RequestOptions } from '../../internal/request-options.js';
5
- export declare class Runs extends APIResource {
6
- /**
7
- * Fetch examples for a dataset, and fetch the runs for each example if they are
8
- * associated with the given session_ids.
9
- */
10
- create(datasetID: string, params: RunCreateParams, options?: RequestOptions): APIPromise<RunCreateResponse | null>;
11
- }
12
- /**
13
- * Example schema with list of runs from ClickHouse.
14
- *
15
- * For non-grouped endpoint (/datasets/{dataset_id}/runs): runs from single
16
- * session. For grouped endpoint (/datasets/{dataset_id}/group/runs): flat array of
17
- * runs from all sessions, where each run has a session_id field for frontend to
18
- * determine column placement.
19
- */
20
- export interface ExampleWithRunsCh {
21
- id: string;
22
- dataset_id: string;
23
- inputs: {
24
- [key: string]: unknown;
25
- };
26
- name: string;
27
- runs: Array<ExampleWithRunsCh.Run>;
28
- attachment_urls?: {
29
- [key: string]: unknown;
30
- } | null;
31
- created_at?: string;
32
- metadata?: {
33
- [key: string]: unknown;
34
- } | null;
35
- modified_at?: string | null;
36
- outputs?: {
37
- [key: string]: unknown;
38
- } | null;
39
- source_run_id?: string | null;
40
- }
41
- export declare namespace ExampleWithRunsCh {
42
- /**
43
- * Run schema for comparison view.
44
- */
45
- interface Run {
46
- id: string;
47
- name: string;
48
- /**
49
- * Enum for run types.
50
- */
51
- run_type: RunsAPI_.RunTypeEnum;
52
- session_id: string;
53
- status: string;
54
- trace_id: string;
55
- app_path?: string | null;
56
- completion_cost?: string | null;
57
- completion_tokens?: number | null;
58
- dotted_order?: string | null;
59
- end_time?: string | null;
60
- error?: string | null;
61
- events?: Array<{
62
- [key: string]: unknown;
63
- }> | null;
64
- execution_order?: number;
65
- extra?: {
66
- [key: string]: unknown;
67
- } | null;
68
- feedback_stats?: {
69
- [key: string]: {
70
- [key: string]: unknown;
71
- };
72
- } | null;
73
- first_token_time?: string | null;
74
- inputs?: {
75
- [key: string]: unknown;
76
- } | null;
77
- inputs_preview?: string | null;
78
- inputs_s3_urls?: {
79
- [key: string]: unknown;
80
- } | null;
81
- manifest_id?: string | null;
82
- manifest_s3_id?: string | null;
83
- outputs?: {
84
- [key: string]: unknown;
85
- } | null;
86
- outputs_preview?: string | null;
87
- outputs_s3_urls?: {
88
- [key: string]: unknown;
89
- } | null;
90
- parent_run_id?: string | null;
91
- prompt_cost?: string | null;
92
- prompt_tokens?: number | null;
93
- reference_example_id?: string | null;
94
- s3_urls?: {
95
- [key: string]: unknown;
96
- } | null;
97
- serialized?: {
98
- [key: string]: unknown;
99
- } | null;
100
- start_time?: string;
101
- tags?: Array<string> | null;
102
- total_cost?: string | null;
103
- total_tokens?: number | null;
104
- trace_max_start_time?: string | null;
105
- trace_min_start_time?: string | null;
106
- }
107
- }
108
- export interface QueryExampleSchemaWithRuns {
109
- session_ids: Array<string>;
110
- comparative_experiment_id?: string | null;
111
- example_ids?: Array<string> | null;
112
- filters?: {
113
- [key: string]: Array<string>;
114
- } | null;
115
- include_annotator_detail?: boolean;
116
- limit?: number;
117
- offset?: number;
118
- preview?: boolean;
119
- sort_params?: SortParamsForRunsComparisonView | null;
120
- }
121
- export interface SortParamsForRunsComparisonView {
122
- sort_by: string;
123
- sort_order?: 'ASC' | 'DESC';
124
- }
125
- export type RunCreateResponse = Array<ExampleWithRunsCh>;
126
- export interface RunCreateParams {
127
- /**
128
- * Body param
129
- */
130
- session_ids: Array<string>;
131
- /**
132
- * Query param: Response format, e.g., 'csv'
133
- */
134
- format?: 'csv' | null;
135
- /**
136
- * Body param
137
- */
138
- comparative_experiment_id?: string | null;
139
- /**
140
- * Body param
141
- */
142
- example_ids?: Array<string> | null;
143
- /**
144
- * Body param
145
- */
146
- filters?: {
147
- [key: string]: Array<string>;
148
- } | null;
149
- /**
150
- * Body param
151
- */
152
- include_annotator_detail?: boolean;
153
- /**
154
- * Body param
155
- */
156
- limit?: number | null;
157
- /**
158
- * Body param
159
- */
160
- offset?: number;
161
- /**
162
- * Body param
163
- */
164
- preview?: boolean;
165
- /**
166
- * Body param
167
- */
168
- sort_params?: SortParamsForRunsComparisonView | null;
169
- }
170
- export declare namespace Runs {
171
- export { type ExampleWithRunsCh as ExampleWithRunsCh, type QueryExampleSchemaWithRuns as QueryExampleSchemaWithRuns, type SortParamsForRunsComparisonView as SortParamsForRunsComparisonView, type RunCreateResponse as RunCreateResponse, type RunCreateParams as RunCreateParams, };
172
- }
@@ -1,18 +0,0 @@
1
- // @ts-nocheck
2
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
- import { APIResource } from '../../core/resource.js';
4
- import { path } from '../../internal/utils/path.js';
5
- export class Runs extends APIResource {
6
- /**
7
- * Fetch examples for a dataset, and fetch the runs for each example if they are
8
- * associated with the given session_ids.
9
- */
10
- create(datasetID, params, options) {
11
- const { format, ...body } = params;
12
- return this._client.post(path `/api/v1/datasets/${datasetID}/runs`, {
13
- query: { format },
14
- body,
15
- ...options,
16
- });
17
- }
18
- }
@@ -1,32 +0,0 @@
1
- "use strict";
2
- // @ts-nocheck
3
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
4
- Object.defineProperty(exports, "__esModule", { value: true });
5
- exports.Share = void 0;
6
- const resource_js_1 = require("../../core/resource.cjs");
7
- const path_js_1 = require("../../internal/utils/path.cjs");
8
- class Share extends resource_js_1.APIResource {
9
- /**
10
- * Share a dataset.
11
- */
12
- create(datasetID, params = {}, options) {
13
- const { share_projects } = params ?? {};
14
- return this._client.put((0, path_js_1.path) `/api/v1/datasets/${datasetID}/share`, {
15
- query: { share_projects },
16
- ...options,
17
- });
18
- }
19
- /**
20
- * Get the state of sharing a dataset
21
- */
22
- retrieve(datasetID, options) {
23
- return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/share`, options);
24
- }
25
- /**
26
- * Unshare a dataset.
27
- */
28
- deleteAll(datasetID, options) {
29
- return this._client.delete((0, path_js_1.path) `/api/v1/datasets/${datasetID}/share`, options);
30
- }
31
- }
32
- exports.Share = Share;