You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please build the client before calling, the build code is as follows:
8
+
9
+
```java
10
+
OpenAiClient client = OpenAiClient.builder()
11
+
.apiHost("https://api.openai.com")
12
+
.apiKey(System.getProperty("openai.token"))
13
+
.build();
14
+
```
15
+
16
+
`System.getProperty("openai.token")` is the key to access the API authorization.
17
+
18
+
### List files
19
+
20
+
---
21
+
22
+
Returns a list of files that belong to the user's organization.
23
+
24
+
```java
25
+
client.files()
26
+
```
27
+
28
+
Returns:
29
+
30
+
```json
31
+
{
32
+
"data": [
33
+
{
34
+
"id": "file-ccdDZrC3iZVNiQVeEA6Z66wf",
35
+
"object": "file",
36
+
"bytes": 175,
37
+
"createdTime": "2022-02-02 22:22:22",
38
+
"filename": "train.jsonl",
39
+
"purpose": "search"
40
+
}
41
+
],
42
+
"object": "list"
43
+
}
44
+
```
45
+
46
+
### Upload file
47
+
48
+
---
49
+
50
+
Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact openai if you need to increase the storage limit.
* Creates a new edit for the provided input, instruction, and parameters.
129
132
* 为提供的输入、指令和参数创建新的编辑。
130
133
*/
131
134
@POST
132
135
Single<EditResponse> fetchEdits(@UrlStringurl,
133
-
@BodyEditEntityconfigure);
136
+
@BodyEditEntityconfigure);
137
+
138
+
/**
139
+
* Returns a list of files that belong to the user's organization.
140
+
* 返回属于用户组织的文件列表。
141
+
*/
142
+
@GET
143
+
Single<FileResponse> fetchFiles(@UrlStringurl);
144
+
145
+
/**
146
+
* Upload a file that contains document(s) to be used across various endpoints/features. Currently, the size of all the files uploaded by one organization can be up to 1 GB. Please contact us if you need to increase the storage limit.
0 commit comments