|
from pathlib import Path |
|
from typing import Optional |
|
import os |
|
|
|
from pydantic_settings import BaseSettings |
|
current_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
|
|
|
|
|
class Settings(BaseSettings): |
|
LLM_NAME: str = "docsgpt" |
|
EMBEDDINGS_NAME: str = "huggingface_sentence-transformers/all-mpnet-base-v2" |
|
CELERY_BROKER_URL: str = "redis://localhost:6379/0" |
|
CELERY_RESULT_BACKEND: str = "redis://localhost:6379/1" |
|
MONGO_URI: str = "mongodb://localhost:27017/docsgpt" |
|
MODEL_PATH: str = os.path.join(current_dir, "models/docsgpt-7b-f16.gguf") |
|
TOKENS_MAX_HISTORY: int = 150 |
|
UPLOAD_FOLDER: str = "inputs" |
|
VECTOR_STORE: str = "faiss" |
|
|
|
API_URL: str = "http://localhost:7091" |
|
|
|
API_KEY: Optional[str] = None |
|
EMBEDDINGS_KEY: Optional[str] = None |
|
OPENAI_API_BASE: Optional[str] = None |
|
OPENAI_API_VERSION: Optional[str] = None |
|
AZURE_DEPLOYMENT_NAME: Optional[str] = None |
|
AZURE_EMBEDDINGS_DEPLOYMENT_NAME: Optional[str] = None |
|
|
|
|
|
ELASTIC_CLOUD_ID: Optional[str] = None |
|
ELASTIC_USERNAME: Optional[str] = None |
|
ELASTIC_PASSWORD: Optional[str] = None |
|
ELASTIC_URL: Optional[str] = None |
|
ELASTIC_INDEX: Optional[str] = "docsgpt" |
|
|
|
|
|
SAGEMAKER_ENDPOINT: Optional[str] = None |
|
SAGEMAKER_REGION: Optional[str] = None |
|
SAGEMAKER_ACCESS_KEY: Optional[str] = None |
|
SAGEMAKER_SECRET_KEY: Optional[str] = None |
|
|
|
|
|
path = Path(__file__).parent.parent.absolute() |
|
settings = Settings(_env_file=path.joinpath(".env"), _env_file_encoding="utf-8") |
|
|