Skip to content

Commit c6c2b93

Browse files
authored
Merge pull request ricklamers#57 from nemilya/main
Fix: if env variables not set - read from config.json
2 parents 8c93c23 + 70b2c0d commit c6c2b93

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/backend.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
class Backend_Api:
1515
def __init__(self, app, config: dict) -> None:
1616
self.app = app
17-
self.openai_key = os.environ["OPENAI_API_KEY"] or config['openai_key']
18-
self.openai_api_base = os.environ["OPENAI_API_BASE"] or config['openai_api_base']
17+
self.openai_key = os.getenv("OPENAI_API_KEY") or config['openai_key']
18+
self.openai_api_base = os.getenv("OPENAI_API_BASE") or config['openai_api_base']
1919
self.routes = {
2020
'/backend-api/v2/conversation': {
2121
'function': self._conversation,

0 commit comments

Comments
 (0)