feat: improve input handling
- 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
This commit is contained in:
parent
e6ed98e53c
commit
85bd75d236
7
main.py
7
main.py
@ -8,11 +8,12 @@ async def main():
|
||||
agent = Manus()
|
||||
while True:
|
||||
try:
|
||||
prompt = input("Enter your prompt (or 'exit' to quit): ")
|
||||
if prompt.lower() == "exit":
|
||||
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 prompt.strip().isspace():
|
||||
if not prompt.strip():
|
||||
logger.warning("Skipping empty prompt.")
|
||||
continue
|
||||
logger.warning("Processing your request...")
|
||||
|
Loading…
x
Reference in New Issue
Block a user