-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path.env.example
More file actions
81 lines (67 loc) · 2.41 KB
/
.env.example
File metadata and controls
81 lines (67 loc) · 2.41 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
79
80
81
# ===== Environment Configuration =====
# Môi trường: development | staging | production
APP_ENV=development
DEBUG=False
# ===== Server Configuration =====
HOST=0.0.0.0
PORT=8000
WORKERS=4
# ===== Base Path Configuration =====
# Để trống ("") nếu deploy tại root: https://domain.com/
# Hoặc điền sub-path nếu deploy tại sub-path: https://domain.com/chatbot
# Ví dụ: BASE_PATH=/chatbot
# Lưu ý: Phải đồng bộ với frontend/config.js BASE_PATH
BASE_PATH=/chatbot
# ===== CORS Configuration =====
# Cho phép nhiều origins, cách nhau bởi dấu phẩy
# Production: ALLOWED_ORIGINS=https://yourdomain.gov.vn,https://api.yourdomain.gov.vn
ALLOWED_ORIGINS=http://localhost:3000,http://localhost:5500,https://chatbot-dichvucong.vercel.app
# ===== API Keys =====
# GROQ API Key - BẮT BUỘC
# Lấy tại: https://console.groq.com/keys
GROQ_API_KEY=your_groq_api_key_here
# ===== LLM Configuration =====
# Model: openai/gpt-oss-120b (Groq-hosted GPT model)
# Các model khác: meta-llama/llama-4-scout-17b-16e-instruct, mixtral-8x7b-32768
LLM_MODEL=openai/gpt-oss-120b
LLM_TEMPERATURE=1
LLM_MAX_TOKENS=8192
LLM_TIMEOUT=60
# Reasoning effort: low | medium | high
LLM_REASONING_EFFORT=medium
# Bật streaming để nhận response theo chunks
LLM_STREAM=True
# ===== Embedding Configuration =====
EMBEDDING_MODEL=sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2
EMBEDDING_BATCH_SIZE=32
# auto | cuda | cpu
EMBEDDING_DEVICE=auto
# ===== RAG Configuration =====
# Đường dẫn tới file index và metadata (có thể dùng relative hoặc absolute path)
# Relative paths sẽ được tự động chuyển thành absolute dựa trên thư mục gốc của project
INDEX_PATH=embeddings/faiss_index.bin
METADATA_PATH=embeddings/metadata.pkl
# Ngưỡng similarity (L2 distance với normalized vectors)
SIMILARITY_THRESHOLD=1.2
# Số context mặc định
TOP_K_DEFAULT=10
TOP_K_FALLBACK=3
MAX_CONTEXTS_RESPONSE=5
# ===== Cache Configuration =====
ENABLE_CACHE=True
CACHE_MAX_SIZE=1000
CACHE_TTL=3600
# ===== Logging Configuration =====
# DEBUG | INFO | WARNING | ERROR | CRITICAL
LOG_LEVEL=INFO
ENABLE_JSON_LOGGING=False
# ===== Rate Limiting =====
ENABLE_RATE_LIMIT=False
RATE_LIMIT_PER_MINUTE=60
# ===== Chat Configuration =====
MAX_CHAT_HISTORY=10
CONTEXT_WINDOW_MESSAGES=5
# ===== Security =====
# Có hiển thị API docs không (nên tắt trong production)
EXPOSE_DOCS=True
MAX_QUERY_LENGTH=1000