-
Notifications
You must be signed in to change notification settings - Fork 87
/
config.js
34 lines (33 loc) · 818 Bytes
/
config.js
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
const DEFAULT_ENGINE = 'davinci';
const ORIGIN = 'https://api.openai.com';
const API_VERSION = 'v1';
const OPEN_AI_URL = `${ORIGIN}/${API_VERSION}`;
module.exports = {
completionURL(engine) {
return `${OPEN_AI_URL}/engines/${engine}/completions`;
},
searchURL(engine) {
return `${OPEN_AI_URL}/engines/${engine}/search`;
},
enginesUrl() {
return `${OPEN_AI_URL}/engines`;
},
engineUrl(engine) {
return `${OPEN_AI_URL}/engines/${engine}`;
},
classificationsUrl() {
return `${OPEN_AI_URL}/classifications`;
},
filesUrl() {
return `${OPEN_AI_URL}/files`;
},
answersUrl() {
return `${OPEN_AI_URL}/answers`;
},
embeddingsUrl(engine) {
return `${OPEN_AI_URL}/engines/${engine}/embeddings`;
},
chatURL() {
return `${OPEN_AI_URL}/chat/completions`;
}
};