File size: 1,448 Bytes
5672ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fef4a8f
 
5672ed8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
45
46
47
48
49
50
51
52
53
54
import os
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

class Config:
    """Base configuration class"""
    SECRET_KEY = os.getenv('SECRET_KEY', 'research-radar-secret-key-2024')
    GEMINI_API_KEY = os.getenv('GEMINI_API_KEY')
    
    # Upload settings
    UPLOAD_FOLDER = 'uploads'
    MAX_CONTENT_LENGTH = 16 * 1024 * 1024  # 16MB
    ALLOWED_EXTENSIONS = {'txt', 'pdf', 'docx'}
    
    # ChromaDB settings
    CHROMA_PERSIST_DIRECTORY = 'chroma_db'
    
    # Model settings
    EMBEDDING_MODEL = 'all-MiniLM-L6-v2'  # Sentence transformer model name
    LOCAL_MODEL_PATH = os.getenv('LOCAL_MODEL_PATH', os.path.join(os.path.dirname(__file__), 'all-MiniLM-L6-v2'))  # Local model path
    GEMINI_MODEL = 'gemini-1.5-flash-latest'
    
    # ArXiv settings
    ARXIV_MAX_RESULTS = 10
    
    @staticmethod
    def init_app(app):
        """Initialize application with config"""
        pass

class DevelopmentConfig(Config):
    """Development configuration"""
    DEBUG = True
    FLASK_ENV = 'development'

class ProductionConfig(Config):
    """Production configuration"""
    DEBUG = False
    FLASK_ENV = 'production'

class TestingConfig(Config):
    """Testing configuration"""
    TESTING = True
    WTF_CSRF_ENABLED = False

# Configuration dictionary
config = {
    'development': DevelopmentConfig,
    'production': ProductionConfig,
    'testing': TestingConfig,
    'default': DevelopmentConfig
}