{"id":13455968,"url":"https://github.com/OpenRL-Lab/ChatAgent","last_synced_at":"2025-03-24T09:31:08.969Z","repository":{"id":220284603,"uuid":"750727617","full_name":"OpenRL-Lab/ChatAgent","owner":"OpenRL-Lab","description":"A Python-based agent framework for large language models.","archived":false,"fork":false,"pushed_at":"2024-03-20T02:00:21.000Z","size":64,"stargazers_count":11,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T06:05:06.375Z","etag":null,"topics":["agent","agent-based-modeling","agents","large-language-models","llm","multi-agent","openai","openai-api","rag"],"latest_commit_sha":null,"homepage":"https://chatagent.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenRL-Lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T07:42:39.000Z","updated_at":"2025-01-23T17:25:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"3ee49a03-4b4f-4c03-8ba4-4c905bd54d97","html_url":"https://github.com/OpenRL-Lab/ChatAgent","commit_stats":null,"previous_names":["openrl-lab/chatagent"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRL-Lab%2FChatAgent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRL-Lab%2FChatAgent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRL-Lab%2FChatAgent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenRL-Lab%2FChatAgent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenRL-Lab","download_url":"https://codeload.github.com/OpenRL-Lab/ChatAgent/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245243218,"owners_count":20583584,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["agent","agent-based-modeling","agents","large-language-models","llm","multi-agent","openai","openai-api","rag"],"created_at":"2024-07-31T08:01:14.183Z","updated_at":"2025-03-24T09:31:08.523Z","avatar_url":"https://github.com/OpenRL-Lab.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# ChatAgent\n\n[![PyPI](https://img.shields.io/pypi/v/ChatAgent-py)](https://pypi.org/project/ChatAgent-py/)\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/ChatAgent-py)\n[![Hits-of-Code](https://hitsofcode.com/github/OpenRL-Lab/ChatAgent?branch=main)](https://hitsofcode.com/github/OpenRL-Lab/ChatAgent/view?branch=main)\n\n[![Documentation Status](https://readthedocs.org/projects/chatagent/badge/?version=latest)](https://chatagent.readthedocs.io/en/latest/?badge=latest)\n\n[中文说明](./README_CN.md)\n\nA Python-based agent framework for large language models. \nThe online agents deployed through ChatAgent have provided over a million stable API calls for the internal OpenRL team.\n\n## Features\n\n- [x] Supports multimodal large language models\n- [x] Supports OpenAI API\n- [x] Supports API calls to Qwen on Alibaba Cloud, Zhipu AI's GLM, Microsoft Azure, etc.\n- [x] Supports parallel and sequential calls of different agents\n- [x] Supports adding an api key for access control\n- [x] Supports setting a maximum number of concurrent requests, i.e., the maximum number of requests a model can handle at the same time\n- [x] Supports customizing complex agent interaction strategies\n\n## Installation\n\n```bash\npip install ChatAgent-py\n```\n\n## Usage\n\nWe provide some examples in the `examples` directory, which you can run them directly to explore ChatAgent's abilities.\n\n### 1. Example for Qwen/ZhiPu API to OpenAI API\n\nWith just over a dozen lines of code, you can convert the Qwen/ZhiPu API to the OpenAI API. \nFor specific code and test cases, please refer to [examples/qwen2openai](./examples/qwen2openai) and [examples/glm2openai](./examples/glm2openai).\n```python\nimport os\nfrom ChatAgent import serve\nfrom ChatAgent.chat_models.base_chat_model import BaseChatModel\nfrom ChatAgent.agents.dashscope_chat_agent import DashScopeChatAgent\nfrom ChatAgent.protocol.openai_api_protocol import MultimodalityChatCompletionRequest\nclass QwenMax(BaseChatModel):\n    def init_agent(self):\n        self.agent = DashScopeChatAgent(model_name='qwen-max',api_key=os.getenv(\"QWEN_API_KEY\"))\n    def create_chat_completion(self, request):\n        return self.agent.act(request)\n@serve.create_chat_completion()\nasync def implement_completions(request: MultimodalityChatCompletionRequest):\n    return QwenMax().create_chat_completion(request)\nserve.run(host=\"0.0.0.0\", port=6367)\n```\n\n### 2. Ensemble with Multiple Agents\n\nWe provide an example in [examples/multiagent_ensemble](./examples/multiagent_ensemble) where multiple agents perform ensemble to answer user questions.\n\n### 3. Agent Q\u0026A Based on RAG Query Results\n\nWe provide an example in [examples/rag](./examples/rag) of agent Q\u0026A based on RAG query results.\n\n## Projects Using ChatAgent\n\nWe have listed research projects that use ChatAgent in the [ChatAgent Project](./Project.md).\nIf you are using ChatAgent in your research project, you are also welcome to join this list.\n\n## Citation\n\nIf you use ChatAgent, please cite us:\n```bibtex\n@misc{ChatAgent2024,\n    title={ChatAgent},\n    author={Shiyu Huang},\n    publisher = {GitHub},\n    howpublished = {\\url{https://github.com/OpenRL-Lab/ChatAgent}},\n    year={2024},\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenRL-Lab%2FChatAgent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenRL-Lab%2FChatAgent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenRL-Lab%2FChatAgent/lists"}