forked from FoundationAgents/OpenManus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (23 loc) · 849 Bytes
/
main.py
File metadata and controls
32 lines (23 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import asyncio
from app.agent.manus import Manus
from app.logger import logger
import argparse
async def main():
# 创建参数解析器
parser = argparse.ArgumentParser(description='Process a single prompt')
parser.add_argument('--prompt', type=str, required=True, help='The prompt to process')
# 解析命令行参数
args = parser.parse_args()
agent = Manus()
try:
prompt = args.prompt
if not prompt.strip():
logger.warning("Empty prompt provided.")
return
logger.warning("Processing your request...")
await agent.run(prompt)
except Exception as e:
logger.error(f"Error processing prompt: {e}")
# 如果需要运行这个异步函数,可以这样调用:
if __name__ == "__main__":
asyncio.run(main())