11 lines
365 B
Python
11 lines
365 B
Python
"""공용 유틸리티 (MCP 서버)"""
|
|
import json
|
|
from config import settings
|
|
|
|
|
|
def _dumps(obj) -> str:
|
|
"""토큰 절약 모드에 따라 compact/pretty JSON 직렬화"""
|
|
if settings.JSON_COMPACT or settings.TOKEN_SAVE_MODE:
|
|
return json.dumps(obj, ensure_ascii=False, separators=(',', ':'))
|
|
return json.dumps(obj, ensure_ascii=False, indent=2)
|