File size: 1,616 Bytes
e182c65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
55
56
57
58
59
"""
Configuration file for RS Studies MCP Server
Customize these settings based on your local setup.
"""

import os
import torch

class Config:
    """Configuration settings for the RS Studies MCP Server"""
    
    # Server Information
    SERVER_NAME = "rs-studies-mcp"
    SERVER_DESCRIPTION = "RS Studies Knowledge Base MCP Server"
    SERVER_VERSION = "1.0.0"
        
    # Model path - adjust if your model is in a different location
    MODEL_PATH = "google/embeddinggemma-300m"
    
    # Collection name in ChromaDB
    COLLECTION_NAME = "rs_studies_embeddings"
    
    # Search Configuration
    DEFAULT_NUM_RESULTS = 5
    MAX_NUM_RESULTS = 50
    DEFAULT_CONTEXT_SIZE = 3
    MAX_CONTEXT_SIZE = 10
    
    # Valid source filters based on your data structure
    VALID_SOURCES = [
        'rs_stkege_01',        # RS trading system documentation
        'cheenai_meet_full',   # Chennai meetup transcripts
        'QnAYoutubeChannel'    # Q&A discussions
    ]
    
    # Device configuration
    @staticmethod
    def get_device():
        """Get the best available device for inference"""
        if torch.cuda.is_available():
            return "cuda"
        else:
            return "cpu"
    
    # Embedding configuration
    EMBEDDING_BATCH_SIZE = 32

# Create a default config instance
config = Config()

class ProdConfig(Config):
    """Production configuration with optimized settings"""
    MAX_NUM_RESULTS = 50
    EMBEDDING_BATCH_SIZE = 64

# Environment-based configuration selection
def get_config(env="default"):
    """Get configuration based on environment"""
    return ProdConfig()