-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.py
More file actions
45 lines (32 loc) · 947 Bytes
/
config.py
File metadata and controls
45 lines (32 loc) · 947 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
41
42
43
44
45
"""
Application configuration.
"""
from functools import lru_cache
from pydantic import ConfigDict
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
"""Application settings loaded from environment."""
model_config = ConfigDict(
env_file=".env",
env_file_encoding="utf-8",
extra="ignore", # Ignore extra env vars
)
# API Keys
openai_api_key: str
tavily_api_key: str
# OpenAI Configuration
openai_model: str = "gpt-5-mini"
openai_temperature: float = 0.0
openai_max_tokens: int = 2000
# Tavily Configuration
tavily_max_results: int = 10
tavily_search_depth: str = "advanced"
# Application Settings
log_level: str = "INFO"
gradio_server_port: int = 7860
gradio_server_name: str = "0.0.0.0"
@lru_cache
def get_settings() -> Settings:
"""Get cached settings instance."""
return Settings()
settings = get_settings()