Files
youlbot/services/events/handlers.py
T
shinalok cd41e9e33e - **Bootstrap IoC-based architecture with modular services.**
- **Implement `MlxModelService` for local LLM backend.**
- **Introduce `DatabaseService` for MySQL integration.**
- **Add `HistoryService` to manage conversation context.**
- **Set up CLI interface via `CliUiService`.**
- **Establish EventBus for token streaming.**
- **Include conversation repository for data persistence.**
- **Add environment-based configuration management.**
- **Draft IoC architectural plan.**
2026-04-25 01:14:37 +09:00

16 lines
343 B
Python

import sys
class StreamTokenHandler:
"""스트림 토큰을 stdout에 실시간 출력하는 핸들러."""
def __call__(self, token: str) -> None:
print(token, end="", flush=True)
class StreamEndHandler:
"""스트림 종료 시 개행을 출력하는 핸들러."""
def __call__(self) -> None:
print("\n")