Skip to content

Commit 227a806

Browse files
committed
Update project for alpha release
Cleanup the project before we release an alpha version.
1 parent fcd4c4c commit 227a806

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

apihandling.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
"""
2+
API Key handling
3+
"""
4+
from pathlib import Path
5+
6+
def configPath():
7+
home = Path.home()
8+
return home / 'openaiclient' / '.config'
9+
10+
def config():
11+
path = configPath()
12+
13+
if path.exists():
14+
file = open(path, 'rw')
15+
else:
16+
file = open(path, 'rx')
17+
18+
return file

app.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
# get API key from environment
1010
try:
11+
configFile = config()
12+
1113
openai.api_key = environ["OPENAI_API_KEY"]
1214
controller.start()
1315
except Exception as err:

requirements.txt

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,2 @@
1-
aiohttp==3.8.3
2-
aiosignal==1.3.1
3-
async-timeout==4.0.2
4-
attrs==22.2.0
5-
certifi==2022.12.7
6-
charset-normalizer==2.1.1
7-
colorama==0.4.6
8-
frozenlist==1.3.3
9-
idna==3.4
10-
multidict==6.0.4
11-
openai==0.26.0
12-
requests==2.28.1
13-
tqdm==4.64.1
14-
urllib3==1.26.13
15-
yarl==1.8.2
1+
increment==1.1
2+
openai==0.26.5

0 commit comments

Comments
 (0)