File size: 1,041 Bytes
a7d24e3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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 and settings
"""

from typing import List
from pydantic_settings import BaseSettings


class Settings(BaseSettings):
    """Application settings and configuration"""
    
    # Application Info
    app_name: str = "Sema Translation API"
    app_version: str = "2.0.0"
    description: str = "Enterprise-grade translation API supporting 200+ languages"
    environment: str = "development"
    debug: bool = True
    
    # API Configuration
    max_text_length: int = 5000
    max_requests_per_minute: int = 60
    max_requests_per_hour: int = 1000
    
    # Security
    allowed_hosts: List[str] = ["*"]
    cors_origins: List[str] = ["*"]
    
    # Models
    model_repo_id: str = "sematech/sema-utils"
    translation_model: str = "sematrans-3.3B"
    beam_size: int = 1
    device: str = "cpu"
    
    # Monitoring
    enable_metrics: bool = True
    log_level: str = "INFO"
    
    class Config:
        env_file = ".env"
        env_prefix = "SEMA_"


# Global settings instance
settings = Settings()