from .chain import create_chat_agent from .config import load_config def run_chat() -> None: config = load_config() agent = create_chat_agent(config) while True: question = input("请输入: ").strip() if not question: continue if question.lower() in ["exit", "quit", "q"]: break result = agent.invoke( {"messages": [{"role": "user", "content": question}]} ) answer = result["messages"][-1].content print(f"AI: {answer}")