File size: 759 Bytes
2d2c6e4
 
 
 
 
 
 
 
 
 
 
 
 
 
6139c83
 
2d2c6e4
 
 
 
 
 
 
 
 
 
 
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
from pydantic import BaseModel


class PaginationConfig(BaseModel):
    MIN_PAGE: int = 1
    MAX_PAGE_SIZE: int = 100
    DEFAULT_PAGE_SIZE: int = 10
    ERROR_INVALID_PAGE: str = "Page number must be >= {min_page}"
    ERROR_INVALID_SIZE: str = "Page size must be between 1 and {max_size}"
    ERROR_NOT_A_LIST: str = "Items must be a list"
    ERROR_NOT_NUMERIC: str = "Page and PageSize must be numeric"


class RewardConfig(BaseModel):
    MIN_REWARD: float = 0.05
    MAX_REWARD: float = 0.95
    DECIMAL_PRECISION: int = 4
    BONUS_COEFFICIENT: float = 0.75


class SafetyConfig(BaseModel):
    pagination: PaginationConfig = PaginationConfig()
    reward: RewardConfig = RewardConfig()


# Centralized configuration singleton
CONFIG = SafetyConfig()