fix typo in README;
log full arguments on parse json err; remove empty prompt for main.py and run_flow.py;
This commit is contained in:
parent
41063bcd2b
commit
56d138220a
@ -112,6 +112,7 @@ Join our networking group on Feishu and share your experience with other develop
|
|||||||
|
|
||||||
## Acknowledgement
|
## Acknowledgement
|
||||||
|
|
||||||
Thanks to [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) and [broswer-use](https://github.com/browser-use/browser-use) for providing basic support for this project!
|
Thanks to [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo)
|
||||||
|
and [browser-use](https://github.com/browser-use/browser-use) for providing basic support for this project!
|
||||||
|
|
||||||
OpenManus is built by contributors from MetaGPT. Huge thanks to this agent community!
|
OpenManus is built by contributors from MetaGPT. Huge thanks to this agent community!
|
||||||
|
@ -112,6 +112,7 @@ python run_flow.py
|
|||||||
|
|
||||||
## 致謝
|
## 致謝
|
||||||
|
|
||||||
感謝 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) 和 [broswer-use](https://github.com/browser-use/browser-use) 為本項目提供基本支持!
|
感謝 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo)
|
||||||
|
和 [browser-use](https://github.com/browser-use/browser-use) 為本項目提供基本支持!
|
||||||
|
|
||||||
OpenManus 由 MetaGPT 的貢獻者構建。非常感謝這個代理社區!
|
OpenManus 由 MetaGPT 的貢獻者構建。非常感謝這個代理社區!
|
||||||
|
@ -112,6 +112,7 @@ python run_flow.py
|
|||||||
|
|
||||||
## 致谢
|
## 致谢
|
||||||
|
|
||||||
特别感谢 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) 和 [broswer-use](https://github.com/browser-use/browser-use) 为本项目提供的基础支持!
|
特别感谢 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo)
|
||||||
|
和 [browser-use](https://github.com/browser-use/browser-use) 为本项目提供的基础支持!
|
||||||
|
|
||||||
OpenManus 由 MetaGPT 社区的贡献者共同构建,感谢这个充满活力的智能体开发者社区!
|
OpenManus 由 MetaGPT 社区的贡献者共同构建,感谢这个充满活力的智能体开发者社区!
|
||||||
|
@ -154,7 +154,7 @@ class ToolCallAgent(ReActAgent):
|
|||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
error_msg = f"Error parsing arguments for {name}: Invalid JSON format"
|
error_msg = f"Error parsing arguments for {name}: Invalid JSON format"
|
||||||
logger.error(
|
logger.error(
|
||||||
f"📝 Oops! The arguments for '{name}' don't make sense - invalid JSON"
|
f"📝 Oops! The arguments for '{name}' don't make sense - invalid JSON, arguments:{command.function.arguments}"
|
||||||
)
|
)
|
||||||
return f"Error: {error_msg}"
|
return f"Error: {error_msg}"
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
3
main.py
3
main.py
@ -12,6 +12,9 @@ async def main():
|
|||||||
if prompt.lower() == "exit":
|
if prompt.lower() == "exit":
|
||||||
logger.info("Goodbye!")
|
logger.info("Goodbye!")
|
||||||
break
|
break
|
||||||
|
if prompt.strip().isspace():
|
||||||
|
logger.warning("Skipping empty prompt.")
|
||||||
|
continue
|
||||||
logger.warning("Processing your request...")
|
logger.warning("Processing your request...")
|
||||||
await agent.run(prompt)
|
await agent.run(prompt)
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
|
19
run_flow.py
19
run_flow.py
@ -3,29 +3,34 @@ import asyncio
|
|||||||
from app.agent.manus import Manus
|
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
|
||||||
|
from app.logger import logger
|
||||||
|
|
||||||
|
|
||||||
async def run_flow():
|
async def run_flow():
|
||||||
agent = Manus()
|
agents = {
|
||||||
|
"manus": Manus(),
|
||||||
|
}
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
prompt = input("Enter your prompt (or 'exit' to quit): ")
|
prompt = input("Enter your prompt (or 'exit' to quit): ")
|
||||||
if prompt.lower() == "exit":
|
if prompt.lower() == "exit":
|
||||||
print("Goodbye!")
|
logger.info("Goodbye!")
|
||||||
break
|
break
|
||||||
|
|
||||||
flow = FlowFactory.create_flow(
|
flow = FlowFactory.create_flow(
|
||||||
flow_type=FlowType.PLANNING,
|
flow_type=FlowType.PLANNING,
|
||||||
agents=agent,
|
agents=agents,
|
||||||
)
|
)
|
||||||
|
if prompt.strip().isspace():
|
||||||
print("Processing your request...")
|
logger.warning("Skipping empty prompt.")
|
||||||
|
continue
|
||||||
|
logger.warning("Processing your request...")
|
||||||
result = await flow.execute(prompt)
|
result = await flow.execute(prompt)
|
||||||
print(result)
|
logger.info(result)
|
||||||
|
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("Goodbye!")
|
logger.warning("Goodbye!")
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user