File tree Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Expand file tree Collapse file tree 3 files changed +22
-15
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 88
99# get API key from environment
1010try :
11+ configFile = config ()
12+
1113 openai .api_key = environ ["OPENAI_API_KEY" ]
1214 controller .start ()
1315except Exception as err :
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments