-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
78 lines (57 loc) · 1.98 KB
/
config.py
File metadata and controls
78 lines (57 loc) · 1.98 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Configuration file for Tunisia Polytechnic RAG Chatbot
import os
from dotenv import load_dotenv
# Load environment variables if .env file exists
load_dotenv()
# ========================================
# API Configuration
# ========================================
# Your OpenRouter API key
# Replace 'your_openrouter_api_key_here' with your actual API key
api = "api_key"
# Alternative: Use environment variable (recommended for security)
# Uncomment the line below if you prefer to use environment variables
# api = os.getenv('OPENROUTER_API_KEY')
# ========================================
# Model Configuration
# ========================================
# Default LLM model
DEFAULT_MODEL = "deepseek/deepseek-chat"
# Embedding model (free HuggingFace model)
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
# Model parameters
MAX_TOKENS = 800
TEMPERATURE = 0.3
TOP_P = 0.9
# ========================================
# RAG Configuration
# ========================================
# Document chunking parameters
CHUNK_SIZE = 1000
CHUNK_OVERLAP = 200
# Retrieval parameters
SIMILARITY_TOP_K = 4
# ========================================
# Directory Configuration
# ========================================
# Directories for documents and vector store
PDF_DIRECTORY = "documents"
VECTORSTORE_DIRECTORY = "vectorstore"
# ========================================
# Optional: Advanced Configuration
# ========================================
# Embeddings device (cpu or cuda)
EMBEDDINGS_DEVICE = "cpu"
# Text splitter separators
TEXT_SEPARATORS = ["\n\n", "\n", " ", ""]
# Number of sources to show in responses
MAX_SOURCES_SHOWN = 2
# Enable/disable features
ENABLE_SOURCE_CITATION = True
ENABLE_RESPONSE_TIME = True
ENABLE_STATUS_COMMAND = True
# ========================================
# Logging Configuration (optional)
# ========================================
LOG_LEVEL = "INFO"
LOG_FILE = "logs/chatbot.log"