-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathevaluation-datasets.ts
More file actions
147 lines (131 loc) · 3.95 KB
/
evaluation-datasets.ts
File metadata and controls
147 lines (131 loc) · 3.95 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import * as DataSourcesAPI from '../knowledge-bases/data-sources';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
export class EvaluationDatasets extends APIResource {
/**
* To create an evaluation dataset, send a POST request to
* `/v2/gen-ai/evaluation_datasets`.
*
* @example
* ```ts
* const evaluationDataset =
* await client.agents.evaluationDatasets.create();
* ```
*/
create(
body: EvaluationDatasetCreateParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<EvaluationDatasetCreateResponse> {
return this._client.post('/v2/gen-ai/evaluation_datasets', {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
/**
* To create presigned URLs for evaluation dataset file upload, send a POST request
* to `/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls`.
*
* @example
* ```ts
* const response =
* await client.agents.evaluationDatasets.createFileUploadPresignedURLs();
* ```
*/
createFileUploadPresignedURLs(
body: EvaluationDatasetCreateFileUploadPresignedURLsParams | null | undefined = {},
options?: RequestOptions,
): APIPromise<EvaluationDatasetCreateFileUploadPresignedURLsResponse> {
return this._client.post('/v2/gen-ai/evaluation_datasets/file_upload_presigned_urls', {
body,
defaultBaseURL: 'https://api.digitalocean.com',
...options,
});
}
}
/**
* Output for creating an agent evaluation dataset
*/
export interface EvaluationDatasetCreateResponse {
/**
* Evaluation dataset uuid.
*/
evaluation_dataset_uuid?: string;
}
/**
* Response with pre-signed urls to upload files.
*/
export interface EvaluationDatasetCreateFileUploadPresignedURLsResponse {
/**
* The ID generated for the request for Presigned URLs.
*/
request_id?: string;
/**
* A list of generated presigned URLs and object keys, one per file.
*/
uploads?: Array<EvaluationDatasetCreateFileUploadPresignedURLsResponse.Upload>;
}
export namespace EvaluationDatasetCreateFileUploadPresignedURLsResponse {
/**
* Detailed info about each presigned URL returned to the client.
*/
export interface Upload {
/**
* The time the url expires at.
*/
expires_at?: string;
/**
* The unique object key to store the file as.
*/
object_key?: string;
/**
* The original file name.
*/
original_file_name?: string;
/**
* The actual presigned URL the client can use to upload the file directly.
*/
presigned_url?: string;
}
}
export interface EvaluationDatasetCreateParams {
/**
* File to upload as data source for knowledge base.
*/
file_upload_dataset?: DataSourcesAPI.APIFileUploadDataSource;
/**
* The name of the agent evaluation dataset.
*/
name?: string;
}
export interface EvaluationDatasetCreateFileUploadPresignedURLsParams {
/**
* A list of files to generate presigned URLs for.
*/
files?: Array<EvaluationDatasetCreateFileUploadPresignedURLsParams.File>;
}
export namespace EvaluationDatasetCreateFileUploadPresignedURLsParams {
/**
* A single file’s metadata in the request.
*/
export interface File {
/**
* Local filename
*/
file_name?: string;
/**
* The size of the file in bytes.
*/
file_size?: string;
}
}
export declare namespace EvaluationDatasets {
export {
type EvaluationDatasetCreateResponse as EvaluationDatasetCreateResponse,
type EvaluationDatasetCreateFileUploadPresignedURLsResponse as EvaluationDatasetCreateFileUploadPresignedURLsResponse,
type EvaluationDatasetCreateParams as EvaluationDatasetCreateParams,
type EvaluationDatasetCreateFileUploadPresignedURLsParams as EvaluationDatasetCreateFileUploadPresignedURLsParams,
};
}