@@ -4,7 +4,6 @@ import { APIResource } from '../core/resource';
44import { APIPromise } from '../core/api-promise' ;
55import { type Uploadable } from '../core/uploads' ;
66import { RequestOptions } from '../internal/request-options' ;
7- import { multipartFormRequestOptions } from '../internal/uploads' ;
87import { path } from '../internal/utils/path' ;
98
109export class Datasets extends APIResource {
@@ -13,11 +12,6 @@ export class Datasets extends APIResource {
1312 *
1413 * Creates a new dataset with the specified name and optional description. The
1514 * dataset will be associated with the current user's tenant.
16- *
17- * Args: name: The name of the dataset description: Optional description of the
18- * dataset
19- *
20- * Returns: Dataset: The created dataset object with generated ID and metadata
2115 */
2216 create ( body : DatasetCreateParams , options ?: RequestOptions ) : APIPromise < Dataset > {
2317 return this . _client . post ( '/datasets' , { body, ...options } ) ;
@@ -28,10 +22,6 @@ export class Datasets extends APIResource {
2822 *
2923 * Retrieves a specific dataset by its ID. The dataset must belong to the current
3024 * user's tenant.
31- *
32- * Args: dataset_id: The unique identifier of the dataset
33- *
34- * Returns: Dataset: The dataset object with all its metadata
3525 */
3626 retrieve ( datasetID : string , options ?: RequestOptions ) : APIPromise < Dataset > {
3727 return this . _client . get ( path `/datasets/${ datasetID } ` , options ) ;
@@ -42,8 +32,6 @@ export class Datasets extends APIResource {
4232 *
4333 * Retrieves all datasets that belong to the current user's tenant. This includes
4434 * datasets created by any user within the same tenant.
45- *
46- * Returns: list[Dataset]: A list of all accessible datasets
4735 */
4836 list ( options ?: RequestOptions ) : APIPromise < DatasetListResponse > {
4937 return this . _client . get ( '/datasets' , options ) ;
@@ -54,10 +42,6 @@ export class Datasets extends APIResource {
5442 *
5543 * Permanently deletes a dataset and all its associated data. This action cannot be
5644 * undone. The dataset must belong to the current user's tenant.
57- *
58- * Args: dataset_id: The unique identifier of the dataset to delete
59- *
60- * Returns: bool: True if the dataset was successfully deleted
6145 */
6246 delete ( datasetID : string , options ?: RequestOptions ) : APIPromise < DatasetDeleteResponse > {
6347 return this . _client . delete ( path `/datasets/${ datasetID } ` , options ) ;
@@ -69,13 +53,6 @@ export class Datasets extends APIResource {
6953 * Initiates the generation of a dataset based on the provided schema and
7054 * validators. The generation process runs asynchronously and will create the
7155 * specified number of entries.
72- *
73- * Args: dataset_id: The ID of the dataset to generate data for schema: The JSON
74- * schema defining the data structure validators: Optional CEL validators for data
75- * validation entries_required: Number of data entries to generate
76- * data_description: Optional description of the data to generate
77- *
78- * Returns: bool: True if the generation process was successfully initiated
7956 */
8057 generateDataset (
8158 body : DatasetGenerateDatasetParams ,
@@ -84,43 +61,19 @@ export class Datasets extends APIResource {
8461 return this . _client . post ( '/datasets/generate-dataset' , { body, ...options } ) ;
8562 }
8663
87- /**
88- * Generate a download URL for a dataset.
89- *
90- * Creates a secure, time-limited download URL that allows downloading the dataset
91- * data. The URL can be used to access the dataset file without requiring
92- * authentication.
93- *
94- * Args: dataset_id: The unique identifier of the dataset
95- *
96- * Returns: str: A secure download URL for the dataset
97- */
98- generateDownloadURL ( datasetID : string , options ?: RequestOptions ) : APIPromise < string > {
99- return this . _client . get ( path `/datasets/${ datasetID } /generate-download-url` , options ) ;
100- }
101-
10264 /**
10365 * Generate a JSON schema from seed data.
10466 *
10567 * Uses AI to analyze provided seed data (either a PDF file or description) and
10668 * generate a JSON schema that can be used for dataset generation. The schema
107- * represents the structure of a single record in the dataset.
108- *
109- * Args: seed_file: Optional PDF file containing example data seed_description:
110- * Optional text description of the data structure
111- *
112- * Returns: SchemaGenerationResponse: Contains the generated JSON schema
113- *
114- * Note: Either seed_file or seed_description must be provided.
69+ * represents the structure of a single record in the dataset. Either seed_file or
70+ * seed_description must be provided.
11571 */
11672 generateSchema (
117- body : DatasetGenerateSchemaParams | null | undefined = { } ,
73+ body : DatasetGenerateSchemaParams ,
11874 options ?: RequestOptions ,
11975 ) : APIPromise < DatasetGenerateSchemaResponse > {
120- return this . _client . post (
121- '/datasets/generate-schema' ,
122- multipartFormRequestOptions ( { body, ...options } , this . _client ) ,
123- ) ;
76+ return this . _client . post ( '/datasets/generate-schema' , { body, ...options } ) ;
12477 }
12578
12679 /**
@@ -129,11 +82,6 @@ export class Datasets extends APIResource {
12982 * Uses AI to analyze a JSON schema and generate Common Expression Language (CEL)
13083 * validation rules that ensure data integrity and business logic constraints for
13184 * the dataset.
132- *
133- * Args: schema: The JSON schema to generate validators for seed_description:
134- * Optional context about the data domain
135- *
136- * Returns: ValidatorsGenerationResponse: Contains the generated CEL validators
13785 */
13886 generateValidators (
13987 body : DatasetGenerateValidatorsParams ,
@@ -182,8 +130,6 @@ export type DatasetDeleteResponse = boolean;
182130
183131export type DatasetGenerateDatasetResponse = boolean ;
184132
185- export type DatasetGenerateDownloadURLResponse = string ;
186-
187133/**
188134 * Response model for schema generation.
189135 */
@@ -199,32 +145,65 @@ export interface DatasetGenerateValidatorsResponse {
199145}
200146
201147export interface DatasetCreateParams {
148+ /**
149+ * The name of the dataset
150+ */
202151 name : string ;
203152
153+ /**
154+ * Optional description of the dataset
155+ */
204156 description ?: string | null ;
205157}
206158
207159export interface DatasetGenerateDatasetParams {
160+ /**
161+ * The ID of the dataset to generate data for
162+ */
208163 dataset_id : string ;
209164
165+ /**
166+ * Number of data entries to generate
167+ */
210168 entries_required : number ;
211169
170+ /**
171+ * The JSON schema defining the data structure
172+ */
212173 schema : { [ key : string ] : unknown } ;
213174
175+ /**
176+ * Optional description of the data to generate
177+ */
214178 data_description ?: string | null ;
215179
180+ /**
181+ * Optional CEL validators for data validation
182+ */
216183 validators ?: string | null ;
217184}
218185
219186export interface DatasetGenerateSchemaParams {
187+ /**
188+ * The seed description to generate a schema from
189+ */
220190 seed_description ?: string | null ;
221191
192+ /**
193+ * The seed file to generate a schema from
194+ */
222195 seed_file ?: Uploadable | null ;
223196}
224197
225198export interface DatasetGenerateValidatorsParams {
199+ /**
200+ * The JSON schema to generate validators for
201+ */
226202 schema : string ;
227203
204+ /**
205+ * Optional context about the data domain
206+ */
228207 seed_description ?: string | null ;
229208}
230209
@@ -234,7 +213,6 @@ export declare namespace Datasets {
234213 type DatasetListResponse as DatasetListResponse ,
235214 type DatasetDeleteResponse as DatasetDeleteResponse ,
236215 type DatasetGenerateDatasetResponse as DatasetGenerateDatasetResponse ,
237- type DatasetGenerateDownloadURLResponse as DatasetGenerateDownloadURLResponse ,
238216 type DatasetGenerateSchemaResponse as DatasetGenerateSchemaResponse ,
239217 type DatasetGenerateValidatorsResponse as DatasetGenerateValidatorsResponse ,
240218 type DatasetCreateParams as DatasetCreateParams ,
0 commit comments