2023-03-17 15:55:15 +00:00
|
|
|
import os
|
|
|
|
from typing import TypedDict
|
|
|
|
|
2023-03-20 08:27:20 +00:00
|
|
|
from dotenv import load_dotenv
|
|
|
|
|
2023-03-17 15:55:15 +00:00
|
|
|
load_dotenv()
|
|
|
|
|
|
|
|
|
|
|
|
class DotEnv(TypedDict):
|
2023-03-23 07:33:45 +00:00
|
|
|
OPENAI_API_KEY: str
|
|
|
|
|
2023-04-07 02:11:24 +00:00
|
|
|
EVAL_PORT: int
|
2023-03-23 07:33:45 +00:00
|
|
|
SERVER: str
|
|
|
|
|
2023-03-30 06:37:56 +00:00
|
|
|
USE_GPU: bool # optional
|
|
|
|
PLAYGROUND_DIR: str # optional
|
2023-03-22 00:34:52 +00:00
|
|
|
LOG_LEVEL: str # optional
|
2023-03-23 07:33:45 +00:00
|
|
|
BOT_NAME: str # optional
|
|
|
|
AWS_ACCESS_KEY_ID: str # optional
|
|
|
|
AWS_SECRET_ACCESS_KEY: str # optional
|
|
|
|
AWS_REGION: str # optional
|
|
|
|
AWS_S3_BUCKET: str # optional
|
2023-03-22 00:34:52 +00:00
|
|
|
WINEDB_HOST: str # optional
|
|
|
|
WINEDB_PASSWORD: str # optional
|
|
|
|
BING_SEARCH_URL: str # optional
|
|
|
|
BING_SUBSCRIPTION_KEY: str # optional
|
|
|
|
SERPAPI_API_KEY: str # optional
|
2023-03-17 15:55:15 +00:00
|
|
|
|
|
|
|
|
2023-04-07 02:11:24 +00:00
|
|
|
EVAL_PORT = int(os.getenv("EVAL_PORT", 8000))
|
2023-03-17 15:55:15 +00:00
|
|
|
settings: DotEnv = {
|
2023-04-07 02:11:24 +00:00
|
|
|
"EVAL_PORT": EVAL_PORT,
|
|
|
|
"SERVER": os.getenv("SERVER", f"http://localhost:{EVAL_PORT}"),
|
2023-03-30 06:37:56 +00:00
|
|
|
"USE_GPU": os.getenv("USE_GPU", "False").lower() == "true",
|
|
|
|
"PLAYGROUND_DIR": os.getenv("PLAYGROUND_DIR", "playground"),
|
2023-03-23 07:33:45 +00:00
|
|
|
"OPENAI_API_KEY": os.getenv("OPENAI_API_KEY"),
|
2023-03-22 00:34:52 +00:00
|
|
|
"LOG_LEVEL": os.getenv("LOG_LEVEL", "INFO"),
|
2023-03-20 08:27:20 +00:00
|
|
|
"BOT_NAME": os.getenv("BOT_NAME", "Orca"),
|
2023-03-17 15:55:15 +00:00
|
|
|
"WINEDB_HOST": os.getenv("WINEDB_HOST"),
|
|
|
|
"WINEDB_PASSWORD": os.getenv("WINEDB_PASSWORD"),
|
2023-03-18 08:37:02 +00:00
|
|
|
"BING_SEARCH_URL": os.getenv("BING_SEARCH_URL"),
|
|
|
|
"BING_SUBSCRIPTION_KEY": os.getenv("BING_SUBSCRIPTION_KEY"),
|
|
|
|
"SERPAPI_API_KEY": os.getenv("SERPAPI_API_KEY"),
|
2023-03-17 15:55:15 +00:00
|
|
|
}
|