-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
32 lines (25 loc) · 890 Bytes
/
config.py
File metadata and controls
32 lines (25 loc) · 890 Bytes
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
# config.py
import os
from dotenv import load_dotenv
load_dotenv()
class Config:
# API Keys
OPENAI_API_KEY = os.getenv('OPENAI_API_KEY')
GOOGLE_API_KEY = os.getenv('GOOGLE_API_KEY')
# Flask Config
SECRET_KEY = os.getenv('SECRET_KEY', 'dev-secret-key-change-in-production')
DEBUG = os.getenv('FLASK_DEBUG', 'True') == 'True'
PORT = int(os.getenv('PORT', 5000))
# --- FIX: Change the model name ---
MODEL_NAME ="models/gemini-pro-latest" # Use this reliable model instead of 1.5-flash
# Chatbot Config
MAX_TOKENS = 500
TEMPERATURE = 0.7
# Database
DATABASE_URL = os.getenv('DATABASE_URL', 'sqlite:///agriculture.db')
@staticmethod
def validate():
"""Validate required configuration"""
if not Config.GOOGLE_API_KEY:
raise ValueError("GOOGLE_API_KEY is not set in .env file")
return True