File size: 696 Bytes
7245599
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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())