Skip to content

Commit

Permalink
Merge pull request xtekky#57 from nemilya/main
Browse files Browse the repository at this point in the history
Fix: if env variables not set - read from config.json
  • Loading branch information
xtekky committed Apr 29, 2023
2 parents 8c93c23 + 70b2c0d commit c6c2b93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
class Backend_Api:
def __init__(self, app, config: dict) -> None:
self.app = app
self.openai_key = os.environ["OPENAI_API_KEY"] or config['openai_key']
self.openai_api_base = os.environ["OPENAI_API_BASE"] or config['openai_api_base']
self.openai_key = os.getenv("OPENAI_API_KEY") or config['openai_key']
self.openai_api_base = os.getenv("OPENAI_API_BASE") or config['openai_api_base']
self.routes = {
'/backend-api/v2/conversation': {
'function': self._conversation,
Expand Down

0 comments on commit c6c2b93

Please sign in to comment.