update README and format code

This commit is contained in:
liangxinbing 2025-03-12 00:17:58 +08:00
parent 487b44fda8
commit 13f98a0fde
3 changed files with 6 additions and 8 deletions

View File

@ -143,8 +143,7 @@ Join our networking group on Feishu and share your experience with other develop
Thanks to [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) 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! and [browser-use](https://github.com/browser-use/browser-use) for providing basic support for this project!
Additionally, we are grateful to [AAAJ](https://github.com/metauto-ai/agent-as-a-judge) Additionally, we are grateful to [AAAJ](https://github.com/metauto-ai/agent-as-a-judge), [MetaGPT](https://github.com/geekan/MetaGPT) and [OpenHands](https://github.com/All-Hands-AI/OpenHands).
and [MetaGPT](https://github.com/mannaandpoem/MetaGPT).
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!

View File

@ -145,7 +145,6 @@ python run_flow.py
特别感谢 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo) 特别感谢 [anthropic-computer-use](https://github.com/anthropics/anthropic-quickstarts/tree/main/computer-use-demo)
和 [browser-use](https://github.com/browser-use/browser-use) 为本项目提供的基础支持! 和 [browser-use](https://github.com/browser-use/browser-use) 为本项目提供的基础支持!
此外,我们感谢 [AAAJ](https://github.com/metauto-ai/agent-as-a-judge) 此外,我们感谢 [AAAJ](https://github.com/metauto-ai/agent-as-a-judge)[MetaGPT](https://github.com/geekan/MetaGPT) 和 [OpenHands](https://github.com/All-Hands-AI/OpenHands).
和 [MetaGPT](https://github.com/mannaandpoem/MetaGPT).
OpenManus 由 MetaGPT 社区的贡献者共同构建,感谢这个充满活力的智能体开发者社区! OpenManus 由 MetaGPT 社区的贡献者共同构建,感谢这个充满活力的智能体开发者社区!

View File

@ -38,7 +38,7 @@ class LLM:
self, config_name: str = "default", llm_config: Optional[LLMSettings] = None self, config_name: str = "default", llm_config: Optional[LLMSettings] = None
): ):
if not hasattr( if not hasattr(
self, "initialized" self, "initialized"
): # Only initialize if not already initialized ): # Only initialize if not already initialized
llm_config = llm_config or config.llm llm_config = llm_config or config.llm
llm_config = llm_config.get(config_name, llm_config["default"]) llm_config = llm_config.get(config_name, llm_config["default"])
@ -214,7 +214,7 @@ class LLM:
for substring in ["localhost", "127.0.0.1", "0.0.0.0"] for substring in ["localhost", "127.0.0.1", "0.0.0.0"]
) )
if self.model and ( if self.model and (
self.model.startswith("ollama") or "local" in self.model.lower() self.model.startswith("ollama") or "local" in self.model.lower()
): ):
return True return True
return False return False
@ -248,7 +248,7 @@ class LLM:
return base64.b64encode(image_file.read()).decode("utf-8") return base64.b64encode(image_file.read()).decode("utf-8")
def prepare_messages( def prepare_messages(
self, text: str, image_path: Optional[str] = None self, text: str, image_path: Optional[str] = None
) -> List[dict]: ) -> List[dict]:
""" """
Prepare messages for completion, including multimodal content if needed. Prepare messages for completion, including multimodal content if needed.
@ -273,7 +273,7 @@ class LLM:
return messages return messages
def do_multimodal_completion( def do_multimodal_completion(
self, text: str, image_path: str self, text: str, image_path: str
) -> Tuple[Any, float, float]: ) -> Tuple[Any, float, float]:
""" """
Perform a multimodal completion with text and image. Perform a multimodal completion with text and image.