From 64e039360eebc04c0946266cbb524a2bfb7f8a28 Mon Sep 17 00:00:00 2001 From: lazychih114 <55657767+Aaron617@users.noreply.github.com> Date: Fri, 7 Mar 2025 11:38:40 +0800 Subject: [PATCH] update readme --- README.md | 66 ++++++++++++++++- licenses/license_template.txt | 13 ++++ licenses/update_license.py | 132 ++++++++++++++++++++++++++++++++++ 3 files changed, 208 insertions(+), 3 deletions(-) create mode 100644 licenses/license_template.txt create mode 100644 licenses/update_license.py diff --git a/README.md b/README.md index ad7071f..63ecc89 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,43 @@ 🦉 OWL: Optimized Workforce Learning for General Multi-Agent Assistance in Real-World Task Automation -🦉 OWL is a cutting-edge framework for multi-agent collaboration that pushes the boundaries of task automation, built on top of the [CAMEL-AI Framework](https://github.com/camel-ai/camel). -OWL achieves 58.18 average score on GAIA benchmark and ranks #1 among open-source frameworks. -Our vision is to revolutionize how AI agents collaborate to solve real-world tasks. By leveraging dynamic agent interactions, OWL enables more natural, efficient, and robust task automation across diverse domains. +
+ +[![Documentation][docs-image]][docs-url] +[![Discord][discord-image]][discord-url] +[![X][x-image]][x-url] +[![Reddit][reddit-image]][reddit-url] +[![Wechat][wechat-image]][wechat-url] +[![Hugging Face][huggingface-image]][huggingface-url] +[![Star][star-image]][star-url] +[![Package License][package-license-image]][package-license-url] + +
+ + +
+ +
+

+ +[Community](https://github.com/camel-ai/camel#community) | +[Installation](https://github.com/camel-ai/camel#installation) | +[Examples](https://github.com/camel-ai/camel/tree/HEAD/examples) | +[Paper](https://arxiv.org/abs/2303.17760) | +[Citation](https://github.com/camel-ai/camel#citation) | +[Contributing](https://github.com/camel-ai/camel#contributing-to-camel-) | +[CAMEL-AI](https://www.camel-ai.org/) + +

+ +

🦉 OWL is a cutting-edge framework for multi-agent collaboration that pushes the boundaries of task automation, built on top of the [CAMEL-AI Framework](https://github.com/camel-ai/camel). +OWL achieves 58.18 average score on GAIA benchmark and ranks #1 among open-source frameworks. +Our vision is to revolutionize how AI agents collaborate to solve real-world tasks. By leveraging dynamic agent interactions, OWL enables more natural, efficient, and robust task automation across diverse domains.

+
+ + + @@ -80,3 +113,30 @@ python run_gaia_roleplaying.py # Cite --> + +# 📄 License + +The source code is licensed under Apache 2.0. + + +[docs-image]: https://img.shields.io/badge/Documentation-EB3ECC +[docs-url]: https://camel-ai.github.io/camel/index.html +[star-image]: https://img.shields.io/github/stars/camel-ai/owl?label=stars&logo=github&color=brightgreen +[star-url]: https://github.com/camel-ai/camel/stargazers +[package-license-image]: https://img.shields.io/badge/License-Apache_2.0-blue.svg +[package-license-url]: https://github.com/camel-ai/camel/blob/master/licenses/LICENSE + +[colab-url]: https://colab.research.google.com/drive/1AzP33O8rnMW__7ocWJhVBXjKziJXPtim?usp=sharing +[colab-image]: https://colab.research.google.com/assets/colab-badge.svg +[huggingface-url]: https://huggingface.co/camel-ai +[huggingface-image]: https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-CAMEL--AI-ffc107?color=ffc107&logoColor=white +[discord-url]: https://discord.camel-ai.org/ +[discord-image]: https://img.shields.io/discord/1082486657678311454?logo=discord&labelColor=%20%235462eb&logoColor=%20%23f5f5f5&color=%20%235462eb +[wechat-url]: https://ghli.org/camel/wechat.png +[wechat-image]: https://img.shields.io/badge/WeChat-CamelAIOrg-brightgreen?logo=wechat&logoColor=white +[x-url]: https://x.com/CamelAIOrg +[x-image]: https://img.shields.io/twitter/follow/CamelAIOrg?style=social +[twitter-image]: https://img.shields.io/twitter/follow/CamelAIOrg?style=social&color=brightgreen&logo=twitter +[reddit-url]: https://www.reddit.com/r/CamelAI/ +[reddit-image]: https://img.shields.io/reddit/subreddit-subscribers/CamelAI?style=plastic&logo=reddit&label=r%2FCAMEL&labelColor=white +[ambassador-url]: https://www.camel-ai.org/community \ No newline at end of file diff --git a/licenses/license_template.txt b/licenses/license_template.txt new file mode 100644 index 0000000..0f91e59 --- /dev/null +++ b/licenses/license_template.txt @@ -0,0 +1,13 @@ +# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= diff --git a/licenses/update_license.py b/licenses/update_license.py new file mode 100644 index 0000000..ac4beb6 --- /dev/null +++ b/licenses/update_license.py @@ -0,0 +1,132 @@ +# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. ========= +import os +import re +import sys +from pathlib import Path +from typing import List + + +# The license template file is hard-coded with specific start and end lines +def fine_license_start_line(lines: List[str], start_with: str) -> int: + for i in range(len(lines)): + if lines[i].startswith(start_with): + return i + return None + + +def find_license_end_line(lines: List[str], start_with: str) -> int: + for i in range(len(lines) - 1, -1, -1): + if lines[i].startswith(start_with): + return i + return None + + +def update_license_in_file( + file_path: str, + license_template_path: str, + start_line_start_with: str, + end_line_start_with: str, +) -> bool: + with open( + file_path, 'r', encoding='utf-8' + ) as f: # for windows compatibility + content = f.read() + + with open(license_template_path, 'r', encoding='utf-8') as f: + new_license = f.read().strip() + + maybe_existing_licenses = re.findall( + r'^#.*?(?=\n)', content, re.MULTILINE | re.DOTALL + ) + start_index = fine_license_start_line( + maybe_existing_licenses, start_line_start_with + ) + end_index = find_license_end_line( + maybe_existing_licenses, end_line_start_with + ) + if start_index is not None and end_index is not None: + maybe_existing_licenses = maybe_existing_licenses[ + start_index : end_index + 1 + ] + else: + maybe_existing_licenses = None + if maybe_existing_licenses: + maybe_old_licenses = '\n'.join(maybe_existing_licenses) + if maybe_old_licenses.strip() != new_license.strip(): + replaced_content = content.replace(maybe_old_licenses, new_license) + with open(file_path, 'w') as f: + f.write(replaced_content) + print(f'Replaced license in {file_path}') + return True + else: + return False + else: + with open(file_path, 'w') as f: + f.write(new_license + '\n' + content) + print(f'Added license to {file_path}') + return True + + +def update_license_in_directory( + directory_path: str, + license_template_path: str, + start_line_start_with: str, + end_line_start_with: str, +) -> None: + # Check if directory exists + if not os.path.isdir(directory_path): + raise NotADirectoryError(f'{directory_path} is not a directory') + # Check if license template exists + if not os.path.isfile(license_template_path): + raise FileNotFoundError(f'{license_template_path} not found') + + file_count = 0 + for py_files in Path(directory_path).rglob("*.py"): + if py_files.name.startswith('.'): + continue + if any(part.startswith('.') for part in py_files.parts): + continue + if update_license_in_file( + py_files, + license_template_path, + start_line_start_with, + end_line_start_with, + ): + file_count += 1 + + print(f'License updated in {file_count} files') + + +if __name__ == '__main__': + if len(sys.argv) < 3: + print( + "Usage from command line: " + "python update_license.py " + "No valid input arguments found, please enter manually." + ) + directory_path = input("Enter directory path: ") + license_template_path = input("Enter license template path: ") + else: + directory_path = sys.argv[1] + license_template_path = sys.argv[2] + + start_line_start_with = "# ========= Copyright" + end_line_start_with = "# ========= Copyright" + update_license_in_directory( + directory_path, + license_template_path, + start_line_start_with, + end_line_start_with, + )