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()
|
agent = Manus()
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
prompt = input("Enter your prompt (or 'exit' to quit): ")
|
prompt = input("Enter your prompt (or 'exit'/'quit' to quit): ")
|
||||||
if prompt.lower() == "exit":
|
prompt_lower = prompt.lower()
|
||||||
|
if prompt_lower in ["exit", "quit"]:
|
||||||
logger.info("Goodbye!")
|
logger.info("Goodbye!")
|
||||||
break
|
break
|
||||||
if prompt.strip().isspace():
|
if not prompt.strip():
|
||||||
logger.warning("Skipping empty prompt.")
|
logger.warning("Skipping empty prompt.")
|
||||||
continue
|
continue
|
||||||
logger.warning("Processing your request...")
|
logger.warning("Processing your request...")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user