Spaces:
Sleeping
Sleeping
| from __future__ import annotations | |
| import asyncio | |
| from .chat import chat_once | |
| from .chat import create_chat_services | |
| async def run_cli() -> None: | |
| services = create_chat_services() | |
| session_id = None | |
| print("Megumin agent is ready. Type 'exit' to stop.") | |
| while True: | |
| user_input = input("You> ").strip() | |
| if not user_input: | |
| continue | |
| if user_input.lower() in {"exit", "quit"}: | |
| break | |
| reply, session_id = await chat_once( | |
| user_message=user_input, | |
| services=services, | |
| session_id=session_id, | |
| ) | |
| print(f"Megumin> {reply}") | |
| if __name__ == "__main__": | |
| asyncio.run(run_cli()) | |