diff --git a/app/agent/sandbox_agent.py b/app/agent/sandbox_agent.py index 605e99d..ba1cb33 100644 --- a/app/agent/sandbox_agent.py +++ b/app/agent/sandbox_agent.py @@ -71,6 +71,7 @@ class SandboxManus(ToolCallAgent): def initialize_sandbox_tools(self,password="123456") -> None: sandbox = create_sandbox(password=password) + print(f"VNC link: {sandbox.get_preview_link(6080)}") computer_tool = SandboxBrowserTool.create_with_sandbox(sandbox) sandbox_tools=[computer_tool] self.available_tools.add_tools(*sandbox_tools) diff --git a/sandbox_main.py b/sandbox_main.py new file mode 100644 index 0000000..4f8e0a5 --- /dev/null +++ b/sandbox_main.py @@ -0,0 +1,36 @@ +import argparse +import asyncio + +from app.agent.sandbox_agent import SandboxManus +from app.logger import logger + + +async def main(): + # Parse command line arguments + parser = argparse.ArgumentParser(description="Run Manus agent with a prompt") + parser.add_argument( + "--prompt", type=str, required=False, help="Input prompt for the agent" + ) + args = parser.parse_args() + + # Create and initialize Manus agent + agent = await SandboxManus.create() + try: + # Use command line prompt if provided, otherwise ask for input + prompt = args.prompt if args.prompt else input("Enter your prompt: ") + if not prompt.strip(): + logger.warning("Empty prompt provided.") + return + + logger.warning("Processing your request...") + await agent.run(prompt) + logger.info("Request processing completed.") + except KeyboardInterrupt: + logger.warning("Operation interrupted.") + finally: + # Ensure agent resources are cleaned up before exiting + await agent.cleanup() + + +if __name__ == "__main__": + asyncio.run(main()) diff --git a/sandox_main.py b/sandox_main.py deleted file mode 100644 index e69de29..0000000