File size: 1,304 Bytes
7ffe51d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
676582c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7ffe51d
 
 
 
 
 
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
from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    """Application settings."""

    # Database
    DATABASE_URL: str

    # Application
    APP_NAME: str = "Task CRUD API"
    DEBUG: bool = True

    # CORS
    CORS_ORIGINS: str = "http://localhost:3000"

    # Authentication
    BETTER_AUTH_SECRET: str  # Required - must be set in .env
    JWT_ALGORITHM: str = "HS256"
    JWT_EXPIRATION_DAYS: int = 7

    # LLM Provider Configuration
    LLM_PROVIDER: str = "gemini"  # Primary provider: gemini, openrouter, cohere
    FALLBACK_PROVIDER: str | None = None  # Optional fallback provider
    GEMINI_API_KEY: str | None = None  # Required if using Gemini
    OPENROUTER_API_KEY: str | None = None  # Required if using OpenRouter
    COHERE_API_KEY: str | None = None  # Required if using Cohere

    # Agent Configuration
    AGENT_TEMPERATURE: float = 0.7  # Sampling temperature (0.0 to 1.0)
    AGENT_MAX_TOKENS: int = 8192  # Maximum tokens in response

    # Conversation Settings (for free-tier constraints)
    CONVERSATION_MAX_MESSAGES: int = 20  # Maximum messages to keep in history
    CONVERSATION_MAX_TOKENS: int = 8000  # Maximum tokens in conversation history

    class Config:
        env_file = ".env"
        case_sensitive = True


settings = Settings()