Spaces:
Running
Running
File size: 1,977 Bytes
10b392a 213465c 10b392a 213465c 10b392a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# config/settings.py
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# --- General Settings ---
DOCS_FOLDER = os.getenv("DOCS_FOLDER", "docs/")
PERSIST_DIR = os.getenv("PERSIST_DIR", "tmp/chroma_db/") # Default to local persistence,
# but plan to use a scalable backend like ClickHouse for production
# --- Embedding Model Settings ---
OLLAMA_URL = os.getenv("OLLAMA_SERVER","https://chandimaprabath-ollama-server.hf.space")
EMBED_MODEL = os.getenv("EMBED_MODEL", "nomic-embed-text:latest")
# --- Document Processing Settings ---
CHUNK_SIZE = int(os.getenv("CHUNK_SIZE", "2000")) # Default chunk size
CHUNK_OVERLAP = int(os.getenv("CHUNK_OVERLAP", "10")) # Default chunk overlap
# --- LLM Settings (OpenAI Compatible) ---
LLM_API_KEY = os.getenv("LLM_API_KEY")
LLM_API_BASE = os.getenv("LLM_API_BASE", "https://llm.chutes.ai/v1") # Default API base
LLM_MODEL = os.getenv("LLM_MODEL", "microsoft/MAI-DS-R1-FP8") # Default LLM model
LLM_MODEL_2 = os.getenv("LLM_MODEL_2", "Qwen/Qwen3-8B")
# --- Retrieval Settings ---
TOP_K = int(os.getenv("TOP_K", "10")) # Default number of documents to retrieve
CHROMADB_COLLECTION_NAME = os.getenv("CHROMADB_COLLECTION_NAME", "my_rulings_collection") # Unique collection name
# --- Security Settings (Placeholders - Implement according to government standards) ---
# Add settings for authentication, authorization, encryption paths, etc.
# SECRET_KEY = os.getenv("SECRET_KEY") # Example for API security
# --- Logging Settings ---
LOG_LEVEL = os.getenv("LOG_LEVEL", "DEBUG") # Default log level
# --- Scalable Backend Settings (for production ChromaDB) ---
# Example settings if using ClickHouse as a backend for ChromaDB
# CLICKHOUSE_HOST = os.getenv("CLICKHOUSE_HOST")
# CLICKHOUSE_PORT = os.getenv("CLICKHOUSE_PORT")
# CLICKHOUSE_DATABASE = os.getenv("CLICKHOUSE_DATABASE")
# CLICKHOUSE_USER = os.getenv("CLICKHOUSE_USER")
# CLICKHOUSE_PASSWORD = os.getenv("CLICKHOUSE_PASSWORD") |