forked from njerschow/openai-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
28 lines (27 loc) · 660 Bytes
/
config.js
File metadata and controls
28 lines (27 loc) · 660 Bytes
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
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`
}
};