-
Notifications
You must be signed in to change notification settings - Fork 3
/
files.ts
113 lines (81 loc) · 2.22 KB
/
files.ts
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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import { type Response } from '../_shims/index';
export class Files extends APIResource {
/**
* List the metadata for a single uploaded data file.
*/
retrieve(id: string, options?: Core.RequestOptions): Core.APIPromise<FileRetrieveResponse> {
return this._client.get(`/files/${id}`, options);
}
/**
* List the metadata for all uploaded data files.
*/
list(options?: Core.RequestOptions): Core.APIPromise<FileListResponse> {
return this._client.get('/files', options);
}
/**
* Delete a previously uploaded data file.
*/
delete(id: string, options?: Core.RequestOptions): Core.APIPromise<FileDeleteResponse> {
return this._client.delete(`/files/${id}`, options);
}
/**
* Get the contents of a single uploaded data file.
*/
content(id: string, options?: Core.RequestOptions): Core.APIPromise<Response> {
return this._client.get(`/files/${id}/content`, { ...options, __binaryResponse: true });
}
/**
* Upload a file.
*/
upload(_: string): Promise<void> {
throw 'please use together-ai/lib/upload';
}
}
export interface FileObject {
id?: string;
filename?: string;
object?: string;
size?: number;
}
export interface FileRetrieveResponse {
id: string;
bytes: number;
created_at: number;
filename: string;
FileType: 'jsonl' | 'parquet';
LineCount: number;
object: string;
Processed: boolean;
purpose: 'fine-tune';
}
export interface FileListResponse {
data: Array<FileListResponse.Data>;
}
export namespace FileListResponse {
export interface Data {
id: string;
bytes: number;
created_at: number;
filename: string;
FileType: 'jsonl' | 'parquet';
LineCount: number;
object: string;
Processed: boolean;
purpose: 'fine-tune';
}
}
export interface FileDeleteResponse {
id?: string;
deleted?: boolean;
}
export declare namespace Files {
export {
type FileObject as FileObject,
type FileRetrieveResponse as FileRetrieveResponse,
type FileListResponse as FileListResponse,
type FileDeleteResponse as FileDeleteResponse,
};
}