这个msg是在循环外面的msg None while True: msg await agent(msg) msg await user(msg) if msg.get_text_content() exit: breakagentscope-ai/agentscope: AgentScope: Agent-Oriented Programming for Building LLM Applicationsinput版本from agentscope.agent import ReActAgent from agentscope.model import DashScopeChatModel from agentscope.formatter import DashScopeChatFormatter from agentscope.memory import InMemoryMemory from agentscope.tool import Toolkit, execute_python_code, execute_shell_command import os, asyncio async def main(): toolkit Toolkit() toolkit.register_tool_function(execute_python_code) toolkit.register_tool_function(execute_shell_command) agent ReActAgent( nameFriday, sys_promptYoure a helpful assistant named Friday., modelDashScopeChatModel( model_nameqwen-max, api_keyos.environ[DASHSCOPE_API_KEY], streamTrue, ), memoryInMemoryMemory(), formatterDashScopeChatFormatter(), toolkittoolkit, ) msg None while True: msg await agent(msg) print(fFriday: {msg.get_text_content()}) user_input input(You: ) if user_input.lower() exit: break from agentscope.message import Msg msg Msg(nameuser, contentuser_input, roleuser) asyncio.run(main())