- Add support for 'quit' command alongside 'exit' - Update input prompt to show both exit options - Enhance empty input handling to catch both empty strings and whitespace - Replace isspace() check with more robust empty string validation - Optimize command checking by storing lowercase result - Improve code readability and user experience
28 lines
733 B
Python
28 lines
733 B
Python
import asyncio
|
|
|
|
from app.agent.manus import Manus
|
|
from app.logger import logger
|
|
|
|
|
|
async def main():
|
|
agent = Manus()
|
|
while True:
|
|
try:
|
|
prompt = input("Enter your prompt (or 'exit'/'quit' to quit): ")
|
|
prompt_lower = prompt.lower()
|
|
if prompt_lower in ["exit", "quit"]:
|
|
logger.info("Goodbye!")
|
|
break
|
|
if not prompt.strip():
|
|
logger.warning("Skipping empty prompt.")
|
|
continue
|
|
logger.warning("Processing your request...")
|
|
await agent.run(prompt)
|
|
except KeyboardInterrupt:
|
|
logger.warning("Goodbye!")
|
|
break
|
|
|
|
|
|
if __name__ == "__main__":
|
|
asyncio.run(main())
|