Spaces:
Running
Running
| import json | |
| def json_response(payload: dict) -> str: | |
| return json.dumps(payload, ensure_ascii=False, indent=2) | |
| def tail_text(text: str, limit: int = 4000) -> str: | |
| if not text: | |
| return "" | |
| return text[-limit:] | |