Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 19 additions & 36 deletions app/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,45 +1,28 @@
from pydantic_settings import BaseSettings
from functools import lru_cache
from pathlib import Path
from typing import Optional
from enum import Enum

class Settings(BaseSettings):
"""
Application Configuration.
Loads settings from environment variables with type safety.
"""
# App Info
app_name: str = "Startup Idea Validator Agent"
app_env: str = "development"
debug: bool = True
class LLMProvider(str, Enum):
AUTO = "auto"
OPENAI = "openai"
ANTHROPIC = "anthropic"

# LLM Configuration
class Settings(BaseSettings):
# App
app_name: str = "startup-idea-validator-agent"
app_version: str = "0.1.0"
debug: bool = False

# LLM
llm_provider: LLMProvider = LLMProvider.AUTO
openai_api_key: Optional[str] = None
anthropic_api_key: Optional[str] = None

# Vector DB Configuration
vector_db_path: str = "./data/chroma_db"

# Server Configuration
host: str = "127.0.0.1"
port: int = 8000

# Feature Flags
enable_web_search: bool = False
enable_competitor_analysis: bool = False


# Paths (Week 4+)
chroma_path: str = "./data/chroma"

class Config:
env_file = ".env"
env_file_encoding = "utf-8"
case_sensitive = True

@lru_cache()
def get_settings() -> Settings:
"""
Returns a cached instance of the settings.
Ensures settings are loaded only once per process.
"""
return Settings()
case_sensitive = False

# Create a global instance for easy import in main.py
settings = get_settings()
settings = Settings()