-
Notifications
You must be signed in to change notification settings - Fork 6
/
start_chatgpt.js
59 lines (59 loc) · 1.17 KB
/
start_chatgpt.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
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
module.exports = {
daemon: true,
run:[
{
method: "input",
params: {
title: "Set OpenAI API Key",
description: "Set the API key to start. You can get the API key at https://platform.openai.com/login?launch",
form: [{
key: "key",
placeholder: "Set the API Key",
default: "{{args.key ? args.key : ''}}"
}]
}
},
{
method: "local.set",
params: {
key: "{{input.key}}"
}
},
{
method: "fs.write",
params: {
path: "key.txt",
text: "{{local.key}}"
}
},
{
id: "start",
method: "shell.run",
params: {
venv: "env",
env: { "OPENAI_API_KEY": "{{args.key ? args.key : local.key}}" },
path: "app/backend",
message: [
"python -m openui"
],
on: [{
"event": "/http:\/\/\\S+/",
"done": true
}]
}
},
{
method: "local.set",
params: {
url: "{{input.event[0]}}"
}
},
{
method: "proxy.start",
params: {
uri: "{{local.url}}",
name: "Local Sharing"
}
}
]
}