langsmith 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +161 -15
- package/dist/_openapi_client/client.cjs +814 -0
- package/dist/_openapi_client/client.d.ts +247 -0
- package/dist/_openapi_client/client.js +777 -0
- package/dist/_openapi_client/core/api-promise.cjs +100 -0
- package/dist/_openapi_client/core/api-promise.d.ts +45 -0
- package/dist/_openapi_client/core/api-promise.js +96 -0
- package/dist/_openapi_client/core/error.cjs +134 -0
- package/dist/_openapi_client/core/error.d.ts +45 -0
- package/dist/_openapi_client/core/error.js +118 -0
- package/dist/_openapi_client/core/pagination.cjs +374 -0
- package/dist/_openapi_client/core/pagination.d.ts +157 -0
- package/dist/_openapi_client/core/pagination.js +361 -0
- package/dist/_openapi_client/core/resource.cjs +17 -0
- package/dist/_openapi_client/core/resource.d.ts +5 -0
- package/dist/_openapi_client/core/resource.js +13 -0
- package/dist/_openapi_client/core/uploads.cjs +5 -0
- package/dist/_openapi_client/core/uploads.d.ts +2 -0
- package/dist/_openapi_client/core/uploads.js +1 -0
- package/dist/_openapi_client/index.cjs +29 -0
- package/dist/_openapi_client/index.d.ts +6 -0
- package/dist/_openapi_client/index.js +8 -0
- package/dist/_openapi_client/internal/builtin-types.cjs +4 -0
- package/dist/_openapi_client/internal/builtin-types.d.ts +72 -0
- package/dist/_openapi_client/internal/builtin-types.js +3 -0
- package/dist/_openapi_client/internal/detect-platform.cjs +162 -0
- package/dist/_openapi_client/internal/detect-platform.d.ts +14 -0
- package/dist/_openapi_client/internal/detect-platform.js +157 -0
- package/dist/_openapi_client/internal/errors.cjs +41 -0
- package/dist/_openapi_client/internal/errors.d.ts +2 -0
- package/dist/_openapi_client/internal/errors.js +36 -0
- package/dist/_openapi_client/internal/headers.cjs +79 -0
- package/dist/_openapi_client/internal/headers.d.ts +5 -0
- package/dist/_openapi_client/internal/headers.js +74 -0
- package/dist/_openapi_client/internal/parse.cjs +40 -0
- package/dist/_openapi_client/internal/parse.d.ts +11 -0
- package/dist/_openapi_client/internal/parse.js +37 -0
- package/dist/_openapi_client/internal/qs/formats.cjs +12 -0
- package/dist/_openapi_client/internal/qs/formats.d.ts +6 -0
- package/dist/_openapi_client/internal/qs/formats.js +8 -0
- package/dist/_openapi_client/internal/qs/stringify.cjs +277 -0
- package/dist/_openapi_client/internal/qs/stringify.d.ts +2 -0
- package/dist/_openapi_client/internal/qs/stringify.js +274 -0
- package/dist/_openapi_client/internal/qs/types.cjs +2 -0
- package/dist/_openapi_client/internal/qs/types.d.ts +56 -0
- package/dist/_openapi_client/internal/qs/types.js +1 -0
- package/dist/_openapi_client/internal/qs/utils.cjs +230 -0
- package/dist/_openapi_client/internal/qs/utils.d.ts +14 -0
- package/dist/_openapi_client/internal/qs/utils.js +217 -0
- package/dist/_openapi_client/internal/request-options.cjs +14 -0
- package/dist/_openapi_client/internal/request-options.d.ts +74 -0
- package/dist/_openapi_client/internal/request-options.js +10 -0
- package/dist/_openapi_client/internal/shim-types.cjs +4 -0
- package/dist/_openapi_client/internal/shim-types.d.ts +16 -0
- package/dist/_openapi_client/internal/shim-types.js +3 -0
- package/dist/_openapi_client/internal/shims.cjs +92 -0
- package/dist/_openapi_client/internal/shims.d.ts +25 -0
- package/dist/_openapi_client/internal/shims.js +85 -0
- package/dist/_openapi_client/internal/to-file.cjs +91 -0
- package/dist/_openapi_client/internal/to-file.d.ts +44 -0
- package/dist/_openapi_client/internal/to-file.js +88 -0
- package/dist/_openapi_client/internal/types.cjs +4 -0
- package/dist/_openapi_client/internal/types.d.ts +62 -0
- package/dist/_openapi_client/internal/types.js +3 -0
- package/dist/_openapi_client/internal/uploads.cjs +140 -0
- package/dist/_openapi_client/internal/uploads.d.ts +41 -0
- package/dist/_openapi_client/internal/uploads.js +130 -0
- package/dist/_openapi_client/internal/utils/env.cjs +22 -0
- package/dist/_openapi_client/internal/utils/env.d.ts +8 -0
- package/dist/_openapi_client/internal/utils/env.js +18 -0
- package/dist/_openapi_client/internal/utils/log.cjs +88 -0
- package/dist/_openapi_client/internal/utils/log.d.ts +36 -0
- package/dist/_openapi_client/internal/utils/log.js +82 -0
- package/dist/_openapi_client/internal/utils/path.cjs +79 -0
- package/dist/_openapi_client/internal/utils/path.d.ts +14 -0
- package/dist/_openapi_client/internal/utils/path.js +74 -0
- package/dist/_openapi_client/internal/utils/query.cjs +42 -0
- package/dist/_openapi_client/internal/utils/query.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/query.js +6 -0
- package/dist/_openapi_client/internal/utils/sleep.cjs +7 -0
- package/dist/_openapi_client/internal/utils/sleep.d.ts +1 -0
- package/dist/_openapi_client/internal/utils/sleep.js +3 -0
- package/dist/_openapi_client/internal/utils/uuid.cjs +19 -0
- package/dist/_openapi_client/internal/utils/uuid.d.ts +4 -0
- package/dist/_openapi_client/internal/utils/uuid.js +15 -0
- package/dist/_openapi_client/internal/utils/values.cjs +112 -0
- package/dist/_openapi_client/internal/utils/values.d.ts +17 -0
- package/dist/_openapi_client/internal/utils/values.js +94 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.cjs +138 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.d.ts +367 -0
- package/dist/_openapi_client/resources/annotation-queues/annotation-queues.js +101 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.cjs +46 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.d.ts +128 -0
- package/dist/_openapi_client/resources/annotation-queues/runs.js +42 -0
- package/dist/_openapi_client/resources/commits.cjs +44 -0
- package/dist/_openapi_client/resources/commits.d.ts +204 -0
- package/dist/_openapi_client/resources/commits.js +40 -0
- package/dist/_openapi_client/resources/datasets/comparative.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/comparative.d.ts +55 -0
- package/dist/_openapi_client/resources/datasets/comparative.js +18 -0
- package/dist/_openapi_client/resources/datasets/datasets.cjs +193 -0
- package/dist/_openapi_client/resources/datasets/datasets.d.ts +374 -0
- package/dist/_openapi_client/resources/datasets/datasets.js +156 -0
- package/dist/_openapi_client/resources/datasets/experiments.cjs +16 -0
- package/dist/_openapi_client/resources/datasets/experiments.d.ts +23 -0
- package/dist/_openapi_client/resources/datasets/experiments.js +12 -0
- package/dist/_openapi_client/resources/datasets/group.cjs +17 -0
- package/dist/_openapi_client/resources/datasets/group.d.ts +160 -0
- package/dist/_openapi_client/resources/datasets/group.js +13 -0
- package/dist/_openapi_client/resources/datasets/runs.cjs +29 -0
- package/dist/_openapi_client/resources/datasets/runs.d.ts +216 -0
- package/dist/_openapi_client/resources/datasets/runs.js +25 -0
- package/dist/_openapi_client/resources/datasets/share.cjs +32 -0
- package/dist/_openapi_client/resources/datasets/share.d.ts +28 -0
- package/dist/_openapi_client/resources/datasets/share.js +28 -0
- package/dist/_openapi_client/resources/datasets/splits.cjs +22 -0
- package/dist/_openapi_client/resources/datasets/splits.d.ts +30 -0
- package/dist/_openapi_client/resources/datasets/splits.js +18 -0
- package/dist/_openapi_client/resources/datasets/versions.cjs +23 -0
- package/dist/_openapi_client/resources/datasets/versions.d.ts +36 -0
- package/dist/_openapi_client/resources/datasets/versions.js +19 -0
- package/dist/_openapi_client/resources/evaluators.cjs +15 -0
- package/dist/_openapi_client/resources/evaluators.d.ts +125 -0
- package/dist/_openapi_client/resources/evaluators.js +11 -0
- package/dist/_openapi_client/resources/examples/bulk.cjs +24 -0
- package/dist/_openapi_client/resources/examples/bulk.d.ts +78 -0
- package/dist/_openapi_client/resources/examples/bulk.js +20 -0
- package/dist/_openapi_client/resources/examples/examples.cjs +124 -0
- package/dist/_openapi_client/resources/examples/examples.d.ts +182 -0
- package/dist/_openapi_client/resources/examples/examples.js +87 -0
- package/dist/_openapi_client/resources/examples/validate.cjs +21 -0
- package/dist/_openapi_client/resources/examples/validate.d.ts +38 -0
- package/dist/_openapi_client/resources/examples/validate.js +17 -0
- package/dist/_openapi_client/resources/feedback/configs.cjs +24 -0
- package/dist/_openapi_client/resources/feedback/configs.d.ts +18 -0
- package/dist/_openapi_client/resources/feedback/configs.js +20 -0
- package/dist/_openapi_client/resources/feedback/feedback.cjs +98 -0
- package/dist/_openapi_client/resources/feedback/feedback.d.ts +275 -0
- package/dist/_openapi_client/resources/feedback/feedback.js +61 -0
- package/dist/_openapi_client/resources/feedback/tokens.cjs +35 -0
- package/dist/_openapi_client/resources/feedback/tokens.d.ts +130 -0
- package/dist/_openapi_client/resources/feedback/tokens.js +31 -0
- package/dist/_openapi_client/resources/index.cjs +35 -0
- package/dist/_openapi_client/resources/index.d.ts +15 -0
- package/dist/_openapi_client/resources/index.js +17 -0
- package/dist/_openapi_client/resources/info.cjs +15 -0
- package/dist/_openapi_client/resources/info.d.ts +51 -0
- package/dist/_openapi_client/resources/info.js +11 -0
- package/dist/_openapi_client/resources/online-evaluators.cjs +70 -0
- package/dist/_openapi_client/resources/online-evaluators.d.ts +284 -0
- package/dist/_openapi_client/resources/online-evaluators.js +66 -0
- package/dist/_openapi_client/resources/public/datasets.cjs +47 -0
- package/dist/_openapi_client/resources/public/datasets.d.ts +152 -0
- package/dist/_openapi_client/resources/public/datasets.js +43 -0
- package/dist/_openapi_client/resources/public/public.cjs +62 -0
- package/dist/_openapi_client/resources/public/public.d.ts +32 -0
- package/dist/_openapi_client/resources/public/public.js +25 -0
- package/dist/_openapi_client/resources/repos/directories.cjs +40 -0
- package/dist/_openapi_client/resources/repos/directories.d.ts +72 -0
- package/dist/_openapi_client/resources/repos/directories.js +36 -0
- package/dist/_openapi_client/resources/repos/repos.cjs +93 -0
- package/dist/_openapi_client/resources/repos/repos.d.ts +188 -0
- package/dist/_openapi_client/resources/repos/repos.js +56 -0
- package/dist/_openapi_client/resources/runs/rules.cjs +9 -0
- package/dist/_openapi_client/resources/runs/rules.d.ts +3 -0
- package/dist/_openapi_client/resources/runs/rules.js +5 -0
- package/dist/_openapi_client/resources/runs/runs.cjs +102 -0
- package/dist/_openapi_client/resources/runs/runs.d.ts +542 -0
- package/dist/_openapi_client/resources/runs/runs.js +65 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.cjs +86 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.d.ts +1121 -0
- package/dist/_openapi_client/resources/sandboxes/boxes.js +82 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.cjs +63 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.d.ts +13 -0
- package/dist/_openapi_client/resources/sandboxes/sandboxes.js +26 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.cjs +39 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.d.ts +130 -0
- package/dist/_openapi_client/resources/sandboxes/snapshots.js +35 -0
- package/dist/_openapi_client/resources/sessions/insights.cjs +54 -0
- package/dist/_openapi_client/resources/sessions/insights.d.ts +246 -0
- package/dist/_openapi_client/resources/sessions/insights.js +50 -0
- package/dist/_openapi_client/resources/sessions/sessions.cjs +109 -0
- package/dist/_openapi_client/resources/sessions/sessions.d.ts +674 -0
- package/dist/_openapi_client/resources/sessions/sessions.js +72 -0
- package/dist/_openapi_client/resources/settings.cjs +15 -0
- package/dist/_openapi_client/resources/settings.d.ts +18 -0
- package/dist/_openapi_client/resources/settings.js +11 -0
- package/dist/_openapi_client/resources/workspaces.cjs +35 -0
- package/dist/_openapi_client/resources/workspaces.d.ts +84 -0
- package/dist/_openapi_client/resources/workspaces.js +31 -0
- package/dist/_openapi_client/version.cjs +5 -0
- package/dist/_openapi_client/version.d.ts +1 -0
- package/dist/_openapi_client/version.js +2 -0
- package/dist/client.cjs +48 -19
- package/dist/client.d.ts +5 -0
- package/dist/client.js +29 -0
- package/dist/env.cjs +3 -3
- package/dist/env.d.ts +1 -1
- package/dist/env.js +1 -1
- package/dist/experimental/otel/exporter.cjs +1 -1
- package/dist/experimental/otel/exporter.js +2 -2
- package/dist/experimental/vercel/telemetry.cjs +1 -1
- package/dist/experimental/vercel/telemetry.js +2 -2
- package/dist/index.cjs +4 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/run_trees.cjs +1 -1
- package/dist/run_trees.js +2 -2
- package/dist/sandbox/client.cjs +11 -3
- package/dist/sandbox/client.js +11 -3
- package/dist/sandbox/index.cjs +8 -2
- package/dist/sandbox/index.d.ts +3 -2
- package/dist/sandbox/index.js +2 -1
- package/dist/sandbox/mounts.cjs +114 -0
- package/dist/sandbox/mounts.d.ts +24 -0
- package/dist/sandbox/mounts.js +109 -0
- package/dist/sandbox/proxy_config.cjs +90 -5
- package/dist/sandbox/proxy_config.d.ts +19 -4
- package/dist/sandbox/proxy_config.js +86 -4
- package/dist/sandbox/types.d.ts +92 -3
- package/dist/traceable.cjs +1 -1
- package/dist/traceable.js +2 -2
- package/dist/utils/guard.cjs +13 -0
- package/dist/utils/guard.d.ts +6 -0
- package/dist/utils/guard.js +10 -0
- package/dist/utils/jestlike/globals.cjs +1 -1
- package/dist/utils/jestlike/globals.js +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource.js';
|
|
2
|
+
import * as RunsAPI from './runs.js';
|
|
3
|
+
import { APIPromise } from '../../core/api-promise.js';
|
|
4
|
+
import { RequestOptions } from '../../internal/request-options.js';
|
|
5
|
+
export declare class Group 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
|
+
runs(datasetID: string, body: GroupRunsParams, options?: RequestOptions): APIPromise<GroupRunsResponse>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Response for grouped comparison view of dataset examples.
|
|
14
|
+
*
|
|
15
|
+
* Returns dataset examples grouped by a run metadata value (e.g., model='gpt-4').
|
|
16
|
+
* Optional filters are applied to all runs before grouping.
|
|
17
|
+
*
|
|
18
|
+
* Shows:
|
|
19
|
+
*
|
|
20
|
+
* - Which examples were executed with each metadata value
|
|
21
|
+
* - Per-session aggregate statistics for runs on those examples
|
|
22
|
+
* - The actual example data with their associated runs
|
|
23
|
+
*
|
|
24
|
+
* Used for comparing how different sessions performed on the same set of examples.
|
|
25
|
+
*/
|
|
26
|
+
export interface GroupRunsResponse {
|
|
27
|
+
groups: Array<GroupRunsResponse.Group>;
|
|
28
|
+
}
|
|
29
|
+
export declare namespace GroupRunsResponse {
|
|
30
|
+
/**
|
|
31
|
+
* Group of examples with a specific metadata value across multiple sessions.
|
|
32
|
+
*
|
|
33
|
+
* Extends RunGroupBase with:
|
|
34
|
+
*
|
|
35
|
+
* - group_key: metadata value that defines this group
|
|
36
|
+
* - sessions: per-session stats for runs matching this metadata value
|
|
37
|
+
* - examples: shared examples across all sessions (intersection logic) with flat
|
|
38
|
+
* array of runs (each run has session_id field for frontend to determine column)
|
|
39
|
+
* - example_count: unique example count (pagination-aware, same across all
|
|
40
|
+
* sessions due to intersection)
|
|
41
|
+
*
|
|
42
|
+
* Inherited from RunGroupBase:
|
|
43
|
+
*
|
|
44
|
+
* - filter: metadata filter for this group (e.g., "and(eq(is_root, true),
|
|
45
|
+
* and(eq(metadata_key, 'model'), eq(metadata_value, 'gpt-4')))")
|
|
46
|
+
* - count: total run count across all sessions (includes duplicate runs)
|
|
47
|
+
* - total_tokens, total_cost: aggregate across sessions
|
|
48
|
+
* - min_start_time, max_start_time: time range across sessions
|
|
49
|
+
* - latency_p50, latency_p99: aggregate latency stats across sessions
|
|
50
|
+
* - feedback_stats: weighted average feedback across sessions
|
|
51
|
+
*
|
|
52
|
+
* Additional aggregate stats:
|
|
53
|
+
*
|
|
54
|
+
* - prompt_tokens, completion_tokens: separate token counts
|
|
55
|
+
* - prompt_cost, completion_cost: separate costs
|
|
56
|
+
* - error_rate: average error rate
|
|
57
|
+
*/
|
|
58
|
+
interface Group {
|
|
59
|
+
example_count: number;
|
|
60
|
+
examples: Array<RunsAPI.ExampleWithRunsCh>;
|
|
61
|
+
filter: string;
|
|
62
|
+
group_key: string | number;
|
|
63
|
+
sessions: Array<Group.Session>;
|
|
64
|
+
completion_cost?: string | null;
|
|
65
|
+
completion_tokens?: number | null;
|
|
66
|
+
count?: number | null;
|
|
67
|
+
error_rate?: number | null;
|
|
68
|
+
feedback_stats?: {
|
|
69
|
+
[key: string]: unknown;
|
|
70
|
+
} | null;
|
|
71
|
+
latency_p50?: number | null;
|
|
72
|
+
latency_p99?: number | null;
|
|
73
|
+
max_start_time?: string | null;
|
|
74
|
+
min_start_time?: string | null;
|
|
75
|
+
prompt_cost?: string | null;
|
|
76
|
+
prompt_tokens?: number | null;
|
|
77
|
+
total_cost?: string | null;
|
|
78
|
+
total_tokens?: number | null;
|
|
79
|
+
}
|
|
80
|
+
namespace Group {
|
|
81
|
+
/**
|
|
82
|
+
* TracerSession stats filtered to runs matching a specific metadata value.
|
|
83
|
+
*
|
|
84
|
+
* Extends TracerSession with:
|
|
85
|
+
*
|
|
86
|
+
* - example_count: unique examples (vs run_count = total runs including
|
|
87
|
+
* duplicates)
|
|
88
|
+
* - filter: ClickHouse filter for fetching runs in this session/group
|
|
89
|
+
* - min/max_start_time: time range for runs in this session/group
|
|
90
|
+
*/
|
|
91
|
+
interface Session {
|
|
92
|
+
id: string;
|
|
93
|
+
filter: string;
|
|
94
|
+
tenant_id: string;
|
|
95
|
+
completion_cost?: string | null;
|
|
96
|
+
completion_tokens?: number | null;
|
|
97
|
+
default_dataset_id?: string | null;
|
|
98
|
+
description?: string | null;
|
|
99
|
+
end_time?: string | null;
|
|
100
|
+
error_rate?: number | null;
|
|
101
|
+
example_count?: number | null;
|
|
102
|
+
experiment_progress?: Session.ExperimentProgress | null;
|
|
103
|
+
extra?: {
|
|
104
|
+
[key: string]: unknown;
|
|
105
|
+
} | null;
|
|
106
|
+
feedback_stats?: {
|
|
107
|
+
[key: string]: unknown;
|
|
108
|
+
} | null;
|
|
109
|
+
first_token_p50?: number | null;
|
|
110
|
+
first_token_p99?: number | null;
|
|
111
|
+
last_run_start_time?: string | null;
|
|
112
|
+
last_run_start_time_live?: string | null;
|
|
113
|
+
latency_p50?: number | null;
|
|
114
|
+
latency_p99?: number | null;
|
|
115
|
+
max_start_time?: string | null;
|
|
116
|
+
min_start_time?: string | null;
|
|
117
|
+
name?: string;
|
|
118
|
+
prompt_cost?: string | null;
|
|
119
|
+
prompt_tokens?: number | null;
|
|
120
|
+
reference_dataset_id?: string | null;
|
|
121
|
+
run_count?: number | null;
|
|
122
|
+
run_facets?: Array<{
|
|
123
|
+
[key: string]: unknown;
|
|
124
|
+
}> | null;
|
|
125
|
+
session_feedback_stats?: {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
} | null;
|
|
128
|
+
start_time?: string;
|
|
129
|
+
streaming_rate?: number | null;
|
|
130
|
+
test_run_number?: number | null;
|
|
131
|
+
total_cost?: string | null;
|
|
132
|
+
total_tokens?: number | null;
|
|
133
|
+
trace_tier?: 'longlived' | 'shortlived' | null;
|
|
134
|
+
}
|
|
135
|
+
namespace Session {
|
|
136
|
+
interface ExperimentProgress {
|
|
137
|
+
evaluator_progress: {
|
|
138
|
+
[key: string]: number;
|
|
139
|
+
};
|
|
140
|
+
expected_run_count: number;
|
|
141
|
+
run_progress: number;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
export interface GroupRunsParams {
|
|
147
|
+
group_by: 'run_metadata' | 'example_metadata';
|
|
148
|
+
metadata_key: string;
|
|
149
|
+
session_ids: Array<string>;
|
|
150
|
+
filters?: {
|
|
151
|
+
[key: string]: Array<string>;
|
|
152
|
+
} | null;
|
|
153
|
+
limit?: number;
|
|
154
|
+
offset?: number;
|
|
155
|
+
per_group_limit?: number;
|
|
156
|
+
preview?: boolean;
|
|
157
|
+
}
|
|
158
|
+
export declare namespace Group {
|
|
159
|
+
export { type GroupRunsResponse as GroupRunsResponse, type GroupRunsParams as GroupRunsParams };
|
|
160
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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 Group 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
|
+
runs(datasetID, body, options) {
|
|
11
|
+
return this._client.post(path `/api/v1/datasets/${datasetID}/group/runs`, { body, ...options });
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
* Fetch the number of regressions/improvements for each example in a dataset,
|
|
23
|
+
* between sessions[0] and sessions[1].
|
|
24
|
+
*/
|
|
25
|
+
delta(datasetID, body, options) {
|
|
26
|
+
return this._client.post((0, path_js_1.path) `/api/v1/datasets/${datasetID}/runs/delta`, { body, ...options });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.Runs = Runs;
|
|
@@ -0,0 +1,216 @@
|
|
|
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
|
+
* Fetch the number of regressions/improvements for each example in a dataset,
|
|
13
|
+
* between sessions[0] and sessions[1].
|
|
14
|
+
*/
|
|
15
|
+
delta(datasetID: string, body: RunDeltaParams, options?: RequestOptions): APIPromise<SessionFeedbackDelta>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Example schema with list of runs from ClickHouse.
|
|
19
|
+
*
|
|
20
|
+
* For non-grouped endpoint (/datasets/{dataset_id}/runs): runs from single
|
|
21
|
+
* session. For grouped endpoint (/datasets/{dataset_id}/group/runs): flat array of
|
|
22
|
+
* runs from all sessions, where each run has a session_id field for frontend to
|
|
23
|
+
* determine column placement.
|
|
24
|
+
*/
|
|
25
|
+
export interface ExampleWithRunsCh {
|
|
26
|
+
id: string;
|
|
27
|
+
dataset_id: string;
|
|
28
|
+
inputs: {
|
|
29
|
+
[key: string]: unknown;
|
|
30
|
+
};
|
|
31
|
+
name: string;
|
|
32
|
+
runs: Array<ExampleWithRunsCh.Run>;
|
|
33
|
+
attachment_urls?: {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
} | null;
|
|
36
|
+
created_at?: string;
|
|
37
|
+
metadata?: {
|
|
38
|
+
[key: string]: unknown;
|
|
39
|
+
} | null;
|
|
40
|
+
modified_at?: string | null;
|
|
41
|
+
outputs?: {
|
|
42
|
+
[key: string]: unknown;
|
|
43
|
+
} | null;
|
|
44
|
+
source_run_id?: string | null;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace ExampleWithRunsCh {
|
|
47
|
+
/**
|
|
48
|
+
* Run schema for comparison view.
|
|
49
|
+
*/
|
|
50
|
+
interface Run {
|
|
51
|
+
id: string;
|
|
52
|
+
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* Enum for run types.
|
|
55
|
+
*/
|
|
56
|
+
run_type: RunsAPI_.RunTypeEnum;
|
|
57
|
+
session_id: string;
|
|
58
|
+
status: string;
|
|
59
|
+
trace_id: string;
|
|
60
|
+
app_path?: string | null;
|
|
61
|
+
completion_cost?: string | null;
|
|
62
|
+
completion_tokens?: number | null;
|
|
63
|
+
dotted_order?: string | null;
|
|
64
|
+
end_time?: string | null;
|
|
65
|
+
error?: string | null;
|
|
66
|
+
events?: Array<{
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
}> | null;
|
|
69
|
+
execution_order?: number;
|
|
70
|
+
extra?: {
|
|
71
|
+
[key: string]: unknown;
|
|
72
|
+
} | null;
|
|
73
|
+
feedback_stats?: {
|
|
74
|
+
[key: string]: {
|
|
75
|
+
[key: string]: unknown;
|
|
76
|
+
};
|
|
77
|
+
} | null;
|
|
78
|
+
first_token_time?: string | null;
|
|
79
|
+
inputs?: {
|
|
80
|
+
[key: string]: unknown;
|
|
81
|
+
} | null;
|
|
82
|
+
inputs_preview?: string | null;
|
|
83
|
+
inputs_s3_urls?: {
|
|
84
|
+
[key: string]: unknown;
|
|
85
|
+
} | null;
|
|
86
|
+
manifest_id?: string | null;
|
|
87
|
+
manifest_s3_id?: string | null;
|
|
88
|
+
outputs?: {
|
|
89
|
+
[key: string]: unknown;
|
|
90
|
+
} | null;
|
|
91
|
+
outputs_preview?: string | null;
|
|
92
|
+
outputs_s3_urls?: {
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
} | null;
|
|
95
|
+
parent_run_id?: string | null;
|
|
96
|
+
prompt_cost?: string | null;
|
|
97
|
+
prompt_tokens?: number | null;
|
|
98
|
+
reference_example_id?: string | null;
|
|
99
|
+
s3_urls?: {
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
} | null;
|
|
102
|
+
serialized?: {
|
|
103
|
+
[key: string]: unknown;
|
|
104
|
+
} | null;
|
|
105
|
+
start_time?: string;
|
|
106
|
+
tags?: Array<string> | null;
|
|
107
|
+
total_cost?: string | null;
|
|
108
|
+
total_tokens?: number | null;
|
|
109
|
+
trace_max_start_time?: string | null;
|
|
110
|
+
trace_min_start_time?: string | null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export interface QueryExampleSchemaWithRuns {
|
|
114
|
+
session_ids: Array<string>;
|
|
115
|
+
comparative_experiment_id?: string | null;
|
|
116
|
+
example_ids?: Array<string> | null;
|
|
117
|
+
filters?: {
|
|
118
|
+
[key: string]: Array<string>;
|
|
119
|
+
} | null;
|
|
120
|
+
include_annotator_detail?: boolean;
|
|
121
|
+
limit?: number;
|
|
122
|
+
offset?: number;
|
|
123
|
+
preview?: boolean;
|
|
124
|
+
sort_params?: SortParamsForRunsComparisonView | null;
|
|
125
|
+
}
|
|
126
|
+
export interface QueryFeedbackDelta {
|
|
127
|
+
baseline_session_id: string;
|
|
128
|
+
comparison_session_ids: Array<string>;
|
|
129
|
+
feedback_key: string;
|
|
130
|
+
comparative_experiment_id?: string | null;
|
|
131
|
+
filters?: {
|
|
132
|
+
[key: string]: Array<string>;
|
|
133
|
+
} | null;
|
|
134
|
+
limit?: number;
|
|
135
|
+
offset?: number;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* List of feedback keys with number of improvements and regressions for each.
|
|
139
|
+
*/
|
|
140
|
+
export interface SessionFeedbackDelta {
|
|
141
|
+
feedback_deltas: {
|
|
142
|
+
[key: string]: SessionFeedbackDelta.FeedbackDeltas;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export declare namespace SessionFeedbackDelta {
|
|
146
|
+
/**
|
|
147
|
+
* Feedback key with number of improvements and regressions.
|
|
148
|
+
*/
|
|
149
|
+
interface FeedbackDeltas {
|
|
150
|
+
improved_examples: Array<string>;
|
|
151
|
+
regressed_examples: Array<string>;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
export interface SortParamsForRunsComparisonView {
|
|
155
|
+
sort_by: string;
|
|
156
|
+
sort_order?: 'ASC' | 'DESC';
|
|
157
|
+
}
|
|
158
|
+
export type RunCreateResponse = Array<ExampleWithRunsCh>;
|
|
159
|
+
export interface RunCreateParams {
|
|
160
|
+
/**
|
|
161
|
+
* Body param
|
|
162
|
+
*/
|
|
163
|
+
session_ids: Array<string>;
|
|
164
|
+
/**
|
|
165
|
+
* Query param: Response format, e.g., 'csv'
|
|
166
|
+
*/
|
|
167
|
+
format?: 'csv' | null;
|
|
168
|
+
/**
|
|
169
|
+
* Body param
|
|
170
|
+
*/
|
|
171
|
+
comparative_experiment_id?: string | null;
|
|
172
|
+
/**
|
|
173
|
+
* Body param
|
|
174
|
+
*/
|
|
175
|
+
example_ids?: Array<string> | null;
|
|
176
|
+
/**
|
|
177
|
+
* Body param
|
|
178
|
+
*/
|
|
179
|
+
filters?: {
|
|
180
|
+
[key: string]: Array<string>;
|
|
181
|
+
} | null;
|
|
182
|
+
/**
|
|
183
|
+
* Body param
|
|
184
|
+
*/
|
|
185
|
+
include_annotator_detail?: boolean;
|
|
186
|
+
/**
|
|
187
|
+
* Body param
|
|
188
|
+
*/
|
|
189
|
+
limit?: number | null;
|
|
190
|
+
/**
|
|
191
|
+
* Body param
|
|
192
|
+
*/
|
|
193
|
+
offset?: number;
|
|
194
|
+
/**
|
|
195
|
+
* Body param
|
|
196
|
+
*/
|
|
197
|
+
preview?: boolean;
|
|
198
|
+
/**
|
|
199
|
+
* Body param
|
|
200
|
+
*/
|
|
201
|
+
sort_params?: SortParamsForRunsComparisonView | null;
|
|
202
|
+
}
|
|
203
|
+
export interface RunDeltaParams {
|
|
204
|
+
baseline_session_id: string;
|
|
205
|
+
comparison_session_ids: Array<string>;
|
|
206
|
+
feedback_key: string;
|
|
207
|
+
comparative_experiment_id?: string | null;
|
|
208
|
+
filters?: {
|
|
209
|
+
[key: string]: Array<string>;
|
|
210
|
+
} | null;
|
|
211
|
+
limit?: number;
|
|
212
|
+
offset?: number;
|
|
213
|
+
}
|
|
214
|
+
export declare namespace Runs {
|
|
215
|
+
export { type ExampleWithRunsCh as ExampleWithRunsCh, type QueryExampleSchemaWithRuns as QueryExampleSchemaWithRuns, type QueryFeedbackDelta as QueryFeedbackDelta, type SessionFeedbackDelta as SessionFeedbackDelta, type SortParamsForRunsComparisonView as SortParamsForRunsComparisonView, type RunCreateResponse as RunCreateResponse, type RunCreateParams as RunCreateParams, type RunDeltaParams as RunDeltaParams, };
|
|
216
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
/**
|
|
19
|
+
* Fetch the number of regressions/improvements for each example in a dataset,
|
|
20
|
+
* between sessions[0] and sessions[1].
|
|
21
|
+
*/
|
|
22
|
+
delta(datasetID, body, options) {
|
|
23
|
+
return this._client.post(path `/api/v1/datasets/${datasetID}/runs/delta`, { body, ...options });
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 Share extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Share a dataset.
|
|
7
|
+
*/
|
|
8
|
+
create(datasetID: string, params?: ShareCreateParams | null | undefined, options?: RequestOptions): APIPromise<DatasetShareSchema>;
|
|
9
|
+
/**
|
|
10
|
+
* Get the state of sharing a dataset
|
|
11
|
+
*/
|
|
12
|
+
retrieve(datasetID: string, options?: RequestOptions): APIPromise<DatasetShareSchema | null>;
|
|
13
|
+
/**
|
|
14
|
+
* Unshare a dataset.
|
|
15
|
+
*/
|
|
16
|
+
deleteAll(datasetID: string, options?: RequestOptions): APIPromise<unknown>;
|
|
17
|
+
}
|
|
18
|
+
export interface DatasetShareSchema {
|
|
19
|
+
dataset_id: string;
|
|
20
|
+
share_token: string;
|
|
21
|
+
}
|
|
22
|
+
export type ShareDeleteAllResponse = unknown;
|
|
23
|
+
export interface ShareCreateParams {
|
|
24
|
+
share_projects?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare namespace Share {
|
|
27
|
+
export { type DatasetShareSchema as DatasetShareSchema, type ShareDeleteAllResponse as ShareDeleteAllResponse, type ShareCreateParams as ShareCreateParams, };
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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 Share extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Share a dataset.
|
|
8
|
+
*/
|
|
9
|
+
create(datasetID, params = {}, options) {
|
|
10
|
+
const { share_projects } = params ?? {};
|
|
11
|
+
return this._client.put(path `/api/v1/datasets/${datasetID}/share`, {
|
|
12
|
+
query: { share_projects },
|
|
13
|
+
...options,
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get the state of sharing a dataset
|
|
18
|
+
*/
|
|
19
|
+
retrieve(datasetID, options) {
|
|
20
|
+
return this._client.get(path `/api/v1/datasets/${datasetID}/share`, options);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Unshare a dataset.
|
|
24
|
+
*/
|
|
25
|
+
deleteAll(datasetID, options) {
|
|
26
|
+
return this._client.delete(path `/api/v1/datasets/${datasetID}/share`, options);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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.Splits = void 0;
|
|
6
|
+
const resource_js_1 = require("../../core/resource.cjs");
|
|
7
|
+
const path_js_1 = require("../../internal/utils/path.cjs");
|
|
8
|
+
class Splits extends resource_js_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Update Dataset Splits
|
|
11
|
+
*/
|
|
12
|
+
create(datasetID, body, options) {
|
|
13
|
+
return this._client.put((0, path_js_1.path) `/api/v1/datasets/${datasetID}/splits`, { body, ...options });
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get Dataset Splits
|
|
17
|
+
*/
|
|
18
|
+
retrieve(datasetID, query = {}, options) {
|
|
19
|
+
return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/splits`, { query, ...options });
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Splits = Splits;
|
|
@@ -0,0 +1,30 @@
|
|
|
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 Splits extends APIResource {
|
|
5
|
+
/**
|
|
6
|
+
* Update Dataset Splits
|
|
7
|
+
*/
|
|
8
|
+
create(datasetID: string, body: SplitCreateParams, options?: RequestOptions): APIPromise<SplitCreateResponse>;
|
|
9
|
+
/**
|
|
10
|
+
* Get Dataset Splits
|
|
11
|
+
*/
|
|
12
|
+
retrieve(datasetID: string, query?: SplitRetrieveParams | null | undefined, options?: RequestOptions): APIPromise<SplitRetrieveResponse>;
|
|
13
|
+
}
|
|
14
|
+
export type SplitCreateResponse = Array<string>;
|
|
15
|
+
export type SplitRetrieveResponse = Array<string>;
|
|
16
|
+
export interface SplitCreateParams {
|
|
17
|
+
examples: Array<string>;
|
|
18
|
+
split_name: string;
|
|
19
|
+
remove?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface SplitRetrieveParams {
|
|
22
|
+
/**
|
|
23
|
+
* Only modifications made on or before this time are included. If None, the latest
|
|
24
|
+
* version of the dataset is used.
|
|
25
|
+
*/
|
|
26
|
+
as_of?: (string & {}) | string;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace Splits {
|
|
29
|
+
export { type SplitCreateResponse as SplitCreateResponse, type SplitRetrieveResponse as SplitRetrieveResponse, type SplitCreateParams as SplitCreateParams, type SplitRetrieveParams as SplitRetrieveParams, };
|
|
30
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
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 Splits extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Update Dataset Splits
|
|
8
|
+
*/
|
|
9
|
+
create(datasetID, body, options) {
|
|
10
|
+
return this._client.put(path `/api/v1/datasets/${datasetID}/splits`, { body, ...options });
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Get Dataset Splits
|
|
14
|
+
*/
|
|
15
|
+
retrieve(datasetID, query = {}, options) {
|
|
16
|
+
return this._client.get(path `/api/v1/datasets/${datasetID}/splits`, { query, ...options });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
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.Versions = void 0;
|
|
6
|
+
const resource_js_1 = require("../../core/resource.cjs");
|
|
7
|
+
const pagination_js_1 = require("../../core/pagination.cjs");
|
|
8
|
+
const path_js_1 = require("../../internal/utils/path.cjs");
|
|
9
|
+
class Versions extends resource_js_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Get dataset versions.
|
|
12
|
+
*/
|
|
13
|
+
list(datasetID, query = {}, options) {
|
|
14
|
+
return this._client.getAPIList((0, path_js_1.path) `/api/v1/datasets/${datasetID}/versions`, (pagination_js_1.OffsetPaginationTopLevelArray), { query, ...options });
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Get diff between two dataset versions.
|
|
18
|
+
*/
|
|
19
|
+
retrieveDiff(datasetID, query, options) {
|
|
20
|
+
return this._client.get((0, path_js_1.path) `/api/v1/datasets/${datasetID}/versions/diff`, { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.Versions = Versions;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { APIResource } from '../../core/resource.js';
|
|
2
|
+
import * as DatasetsAPI from './datasets.js';
|
|
3
|
+
import { DatasetVersionsOffsetPaginationTopLevelArray } from './datasets.js';
|
|
4
|
+
import { APIPromise } from '../../core/api-promise.js';
|
|
5
|
+
import { type OffsetPaginationTopLevelArrayParams, PagePromise } from '../../core/pagination.js';
|
|
6
|
+
import { RequestOptions } from '../../internal/request-options.js';
|
|
7
|
+
export declare class Versions extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Get dataset versions.
|
|
10
|
+
*/
|
|
11
|
+
list(datasetID: string, query?: VersionListParams | null | undefined, options?: RequestOptions): PagePromise<DatasetVersionsOffsetPaginationTopLevelArray, DatasetsAPI.DatasetVersion>;
|
|
12
|
+
/**
|
|
13
|
+
* Get diff between two dataset versions.
|
|
14
|
+
*/
|
|
15
|
+
retrieveDiff(datasetID: string, query: VersionRetrieveDiffParams, options?: RequestOptions): APIPromise<VersionRetrieveDiffResponse>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Dataset diff schema.
|
|
19
|
+
*/
|
|
20
|
+
export interface VersionRetrieveDiffResponse {
|
|
21
|
+
examples_added: Array<string>;
|
|
22
|
+
examples_modified: Array<string>;
|
|
23
|
+
examples_removed: Array<string>;
|
|
24
|
+
}
|
|
25
|
+
export interface VersionListParams extends OffsetPaginationTopLevelArrayParams {
|
|
26
|
+
example?: string | null;
|
|
27
|
+
search?: string | null;
|
|
28
|
+
}
|
|
29
|
+
export interface VersionRetrieveDiffParams {
|
|
30
|
+
from_version: (string & {}) | string;
|
|
31
|
+
to_version: (string & {}) | string;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace Versions {
|
|
34
|
+
export { type VersionRetrieveDiffResponse as VersionRetrieveDiffResponse, type VersionListParams as VersionListParams, type VersionRetrieveDiffParams as VersionRetrieveDiffParams, };
|
|
35
|
+
}
|
|
36
|
+
export { type DatasetVersionsOffsetPaginationTopLevelArray };
|