Merge remote-tracking branch 'origin/main'

This commit is contained in:
xiangjinyu 2025-03-07 03:17:52 +08:00
commit d31dd40163

View File

@ -1,21 +1,33 @@
import asyncio import asyncio
from app.agent import ToolCallAgent from app.agent.manus import Manus
from app.flow.base import FlowType from app.flow.base import FlowType
from app.flow.flow_factory import FlowFactory from app.flow.flow_factory import FlowFactory
async def run_flow(): async def run_flow():
agent = ToolCallAgent() agent = Manus()
while True:
try:
prompt = input("Enter your prompt (or 'exit' to quit): ")
if prompt.lower() == "exit":
print("Goodbye!")
break
flow = FlowFactory.create_flow( flow = FlowFactory.create_flow(
flow_type=FlowType.PLANNING, flow_type=FlowType.PLANNING,
agents=agent, agents=agent,
) )
result = await flow.execute("Create a web app that shows Japan travel destinations") print("Processing your request...")
result = await flow.execute(prompt)
print(result) print(result)
except KeyboardInterrupt:
print("Goodbye!")
break
if __name__ == "__main__": if __name__ == "__main__":
asyncio.run(run_flow()) asyncio.run(run_flow())