65 lines
2.2 KiB
Python
65 lines
2.2 KiB
Python
from config.config_loader import ConfigModel
|
|
|
|
|
|
class WebServerConfig(ConfigModel):
|
|
server_name: str = ""
|
|
port: int = 0
|
|
process_count: int = 1
|
|
is_ssl: bool = False
|
|
is_test: bool = False
|
|
|
|
|
|
class LogConfig(ConfigModel):
|
|
print_console: bool = True
|
|
log_level: str = "debug"
|
|
|
|
|
|
# DB Read/Write 분리 설정. backend 와 동일 구조 (negosium_db 공유).
|
|
class MainDBConfig(ConfigModel):
|
|
db_type: str = "postgresql"
|
|
name: str = ""
|
|
write_host: str = ""
|
|
write_port: int = 5432
|
|
write_id: str = ""
|
|
write_pw: str = ""
|
|
read_host: str = ""
|
|
read_port: int = 5432
|
|
read_id: str = ""
|
|
read_pw: str = ""
|
|
show_log: bool = False
|
|
pool_size: int = 10
|
|
max_overflow: int = 20
|
|
# SSL/TLS 모드: ""/"disable"=미사용(로컬), "require"/"verify-ca"/"verify-full"=관리형 DB(RDS/Aurora/Azure).
|
|
sslmode: str = ""
|
|
|
|
|
|
class OpenAIConfig(ConfigModel):
|
|
"""LLM(OpenAI/Azure) 접속 설정. 프로젝트 컨벤션대로 toml 로 관리.
|
|
⚠️ api_key 는 시크릿 — config.local.toml 은 외부 공개 저장소에 push 하지 말 것.
|
|
"""
|
|
|
|
provider: str = "openai" # "openai" | "azure"
|
|
api_key: str = ""
|
|
model: str = "gpt-4o-mini" # openai: 모델명 / azure: 배포(deployment) 이름
|
|
base_url: str = "" # openai 호환 게이트웨이용(옵션)
|
|
# azure 전용
|
|
azure_endpoint: str = ""
|
|
api_version: str = ""
|
|
|
|
|
|
class AgentConfig(ConfigModel):
|
|
"""협상 에이전트 전역 설정. 테넌트별 세부 설정은 tenants/<id>/tenant.yaml (TenantConfig, P1).
|
|
여기에는 서버군 공통값만 둔다.
|
|
"""
|
|
|
|
# 테넌트 정적 리소스 루트 (tenants/<id>/...)
|
|
tenants_dir: str = "tenants"
|
|
# TenantConfig TTL 캐시(초). 0 이면 매 요청 로드.
|
|
config_cache_ttl_seconds: int = 300
|
|
# default tenant 금지 (KT 사고 방지). 미들웨어가 헤더 부재 시 400.
|
|
allow_default_tenant: bool = False
|
|
# 서버 기동 시 공유 베이스(_base)가 없으면 자동 시드 (운영 자동화).
|
|
auto_seed_base: bool = True
|
|
base_action_space: int = 9 # 베이스 Q-Table action 차원 (신규 테넌트와 호환돼야 복제됨)
|
|
base_seed_episodes: int = 300 # 베이스 시드 학습 에피소드 수
|