2023-04-29 14:40:55 +00:00
|
|
|
from pathlib import Path
|
|
|
|
|
2023-05-13 08:36:17 +00:00
|
|
|
from pydantic import BaseSettings
|
|
|
|
|
2023-04-29 14:40:55 +00:00
|
|
|
|
|
|
|
class Settings(BaseSettings):
|
2023-04-29 14:44:47 +00:00
|
|
|
LLM_NAME: str = "openai_chat"
|
2023-04-29 14:46:09 +00:00
|
|
|
EMBEDDINGS_NAME: str = "openai_text-embedding-ada-002"
|
2023-04-30 10:03:09 +00:00
|
|
|
CELERY_BROKER_URL: str = "redis://localhost:6379/0"
|
|
|
|
CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1"
|
|
|
|
MONGO_URI: str = "mongodb://localhost:27017/docsgpt"
|
2023-05-25 18:33:37 +00:00
|
|
|
MODEL_PATH: str = "./models/gpt4all-model.bin"
|
2023-05-31 22:47:16 +00:00
|
|
|
TOKENS_MAX_HISTORY: int = 150
|
2023-04-29 14:50:02 +00:00
|
|
|
|
2023-06-23 11:56:14 +00:00
|
|
|
API_URL: str = "http://localhost:7091" # backend url for celery worker
|
2023-04-29 14:56:32 +00:00
|
|
|
|
2023-04-30 09:46:52 +00:00
|
|
|
API_KEY: str = None # LLM api key
|
|
|
|
EMBEDDINGS_KEY: str = None # api key for embeddings (if using openai, just copy API_KEY
|
2023-08-05 12:08:51 +00:00
|
|
|
OPENAI_API_BASE: str = None # azure openai api base url
|
|
|
|
OPENAI_API_VERSION: str = None # azure openai api version
|
2023-06-17 11:20:29 +00:00
|
|
|
AZURE_DEPLOYMENT_NAME: str = None # azure deployment name for answering
|
|
|
|
AZURE_EMBEDDINGS_DEPLOYMENT_NAME: str = None # azure deployment name for embeddings
|
2023-04-29 14:40:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
path = Path(__file__).parent.parent.absolute()
|
|
|
|
settings = Settings(_env_file=path.joinpath(".env"), _env_file_encoding="utf-8")
|