-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathconfig.py
More file actions
40 lines (30 loc) · 1014 Bytes
/
Copy pathconfig.py
File metadata and controls
40 lines (30 loc) · 1014 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
33
34
35
36
37
38
39
40
"""Configuration settings for the React Agent."""
import os
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
class Config:
"""Configuration class for the React Agent."""
# API Keys
GOOGLE_API_KEY = os.getenv("GOOGLE_API_KEY","")
SERPER_API_KEY = os.getenv("SERPER_API_KEY", "")
OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")
# Model Configuration
GEMINI_MODEL = "gemini-2.0-flash-lite"
TEMPERATURE = 0.1
MAX_TOKENS = 1000
# Agent Configuration
MAX_ITERATIONS = 10
VERBOSE = True
# Cache Configuration
CACHE_TTL = 3600 # 1 hour in seconds
MAX_CACHE_SIZE = 1000
# Validate required keys
@classmethod
def validate(cls):
"""Validate that required configuration is present."""
if not cls.GOOGLE_API_KEY:
raise ValueError("GOOGLE_API_KEY is required. Please set it in your .env file.")
return True
# Validate configuration on import
Config.validate()