{ "info": { "author": "XuMing", "author_email": "xuming624@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "[**\ud83c\udde8\ud83c\uddf3\u4e2d\u6587**](https://github.com/shibing624/actionflow/blob/main/README.md) | [**\ud83c\udf10English**](https://github.com/shibing624/actionflow/blob/main/README_EN.md)\n\n
\n \n \"Logo\"\n \n
\n\n-----------------\n\n# Actionflow: Agent Workflows with Prompts and Tools\n[![PyPI version](https://badge.fury.io/py/actionflow.svg)](https://badge.fury.io/py/actionflow)\n[![Downloads](https://static.pepy.tech/badge/actionflow)](https://pepy.tech/project/actionflow)\n[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](CONTRIBUTING.md)\n[![License Apache 2.0](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)\n[![python_version](https://img.shields.io/badge/Python-3.5%2B-green.svg)](requirements.txt)\n[![GitHub issues](https://img.shields.io/github/issues/shibing624/actionflow.svg)](https://github.com/shibing624/actionflow/issues)\n[![Wechat Group](https://img.shields.io/badge/wechat-group-green.svg?logo=wechat)](#Contact)\n\n\n**actionflow**: A Human-Centric Framework for Large Language Model Agent Workflows, build your agent workflows quickly\n\n**actionflow**: \u5feb\u901f\u6784\u5efa\u4f60\u81ea\u5df1\u7684Agent\u5de5\u4f5c\u6d41\n\n## Overview\n![llm_agnet](https://github.com/shibing624/actionflow/blob/main/docs/llm_agent.png)\n\n- **\u89c4\u5212\uff08Planning\uff09**\uff1a\u4efb\u52a1\u62c6\u89e3\u3001\u751f\u6210\u8ba1\u5212\u3001\u53cd\u601d\n- **\u8bb0\u5fc6\uff08Memory\uff09**\uff1a\u77ed\u671f\u8bb0\u5fc6\uff08prompt\u5b9e\u73b0\uff09\u3001\u957f\u671f\u8bb0\u5fc6\uff08RAG\u5b9e\u73b0\uff09\n- **\u5de5\u5177\u4f7f\u7528\uff08Tool use\uff09**\uff1afunction call\u80fd\u529b\uff0c\u8c03\u7528\u5916\u90e8API\uff0c\u4ee5\u83b7\u53d6\u5916\u90e8\u4fe1\u606f\uff0c\u5305\u62ec\u5f53\u524d\u65e5\u671f\u3001\u65e5\u5386\u3001\u4ee3\u7801\u6267\u884c\u80fd\u529b\u3001\u5bf9\u4e13\u7528\u4fe1\u606f\u6e90\u7684\u8bbf\u95ee\u7b49\n\n\n![actionflow_arch](https://github.com/shibing624/actionflow/blob/main/docs/actionflow_arch.png)\n\n- **Planner**\uff1a\u8d1f\u8d23\u8ba9LLM\u751f\u6210\u4e00\u4e2a\u591a\u6b65\u8ba1\u5212\u6765\u5b8c\u6210\u590d\u6742\u4efb\u52a1\uff0c\u751f\u6210\u76f8\u4e92\u4f9d\u8d56\u7684\u201c\u94fe\u5f0f\u8ba1\u5212\u201d\uff0c\u5b9a\u4e49\u6bcf\u4e00\u6b65\u6240\u4f9d\u8d56\u7684\u4e0a\u4e00\u6b65\u7684\u8f93\u51fa\n- **Worker**\uff1a\u63a5\u53d7\u201c\u94fe\u5f0f\u8ba1\u5212\u201d\uff0c\u5faa\u73af\u904d\u5386\u8ba1\u5212\u4e2d\u7684\u6bcf\u4e2a\u5b50\u4efb\u52a1\uff0c\u5e76\u8c03\u7528\u5de5\u5177\u5b8c\u6210\u4efb\u52a1\uff0c\u53ef\u4ee5\u81ea\u52a8\u53cd\u601d\u7ea0\u9519\u4ee5\u5b8c\u6210\u4efb\u52a1\n- **Solver**\uff1a\u6c42\u89e3\u5668\u5c06\u6240\u6709\u8fd9\u4e9b\u8f93\u51fa\u6574\u5408\u4e3a\u6700\u7ec8\u7b54\u6848\n\n## Features\n`Actionflow`\u662f\u4e00\u4e2aAgent\u5de5\u4f5c\u6d41\u6784\u5efa\u5de5\u5177\uff0c\u529f\u80fd\uff1a\n\n- \u7b80\u5355\u4ee3\u7801\u5feb\u901f\u7f16\u6392\u590d\u6742\u5de5\u4f5c\u6d41\n- \u5de5\u4f5c\u6d41\u7684\u7f16\u6392\u4e0d\u4ec5\u652f\u6301prompt\u547d\u4ee4\uff0c\u8fd8\u652f\u6301\u5de5\u5177\u8c03\u7528\uff08tool_calls\uff09\n- \u652f\u6301OpenAI API\u548cMoonshot API(kimi)\u8c03\u7528\n\n## Installation\n\n```bash\npip install -U actionflow\n```\n\nor\n\n```bash\ngit clone https://github.com/shibing624/actionflow.git\ncd actionflow\npip install .\n```\n\n## Getting Started\n\n1. \u590d\u5236[example.env](https://github.com/shibing624/actionflow/blob/main/example.env)\u6587\u4ef6\u4e3a`.env`\uff0c\u5e76\u7c98\u8d34OpenAI API key\u6216\u8005Moonshoot API key\u3002\n\n2. \u8fd0\u884cAgent\u793a\u4f8b\uff0c\u81ea\u52a8\u8c03\u7528google\u641c\u7d22\u5de5\u5177\uff1a\n\n```python\nfrom actionflow import Assistant, OpenAILLM, AzureOpenAILLM\nfrom actionflow.tools.search_serper import SearchSerperTool\n\nm = Assistant(\n llm=AzureOpenAILLM(),\n description=\"You are a helpful ai assistant.\",\n show_tool_calls=True,\n # Enable the assistant to search the knowledge base\n search_knowledge=False,\n tools=[SearchSerperTool()],\n # Enable the assistant to read the chat history\n read_chat_history=True,\n debug_mode=True,\n)\nprint(\"LLM:\", m.llm)\nprint(m.run(\"\u4ecb\u7ecd\u6797\u9edb\u7389\", stream=False))\nprint(m.run(\"\u5317\u4eac\u6700\u8fd1\u7684\u65b0\u95fb\", stream=False))\nprint(m.run(\"\u6211\u524d\u9762\u95ee\u4e86\u5565\", stream=False))\n```\n\n## Examples\n\u8fd0\u884c\u5de5\u4f5c\u6d41\uff08Workflow\uff09\u793a\u4f8b\uff1a\n\n- [examples/rag_assistant_demo.py](https://github.com/shibing624/actionflow/blob/main/examples/rag_assistant_demo.py) \u5b9e\u73b0\u4e86RAG\u529f\u80fd\uff0c\u57fa\u4e8ePDF\u6587\u6863\u56de\u7b54\u95ee\u9898\n- [examples/python_assistant_demo.py](https://github.com/shibing624/actionflow/blob/main/examples/python_assistant_demo.py) \u5b9e\u73b0\u4e86Code Interpreter\u529f\u80fd\uff0c\u81ea\u52a8\u751f\u6210python\u4ee3\u7801\uff0c\u5e76\u6267\u884c\n- [examples/research_demo.py](https://github.com/shibing624/actionflow/blob/main/examples/research_demo.py) \u5b9e\u73b0\u4e86Research\u529f\u80fd\uff0c\u81ea\u52a8\u8c03\u7528\u641c\u7d22\u5de5\u5177\uff0c\u6c47\u603b\u4fe1\u606f\u540e\u64b0\u5199\u79d1\u6280\u62a5\u544a\n- [examples/run_flow_news_article_demo.py](https://github.com/shibing624/actionflow/blob/main/examples/run_flow_news_article_demo.py) \u5b9e\u73b0\u4e86\u5199\u65b0\u95fb\u7a3f\u7684\u5de5\u4f5c\u6d41\uff0cmulti-agent\u7684\u5b9e\u73b0\uff0c\u5b9a\u4e49\u4e86\u591a\u4e2aAssistant\u548cTask\uff0c\u591a\u6b21\u8c03\u7528\u641c\u7d22\u5de5\u5177\uff0c\u5e76\u751f\u6210\u9ad8\u7ea7\u6392\u7248\u7684\u65b0\u95fb\u6587\u7ae0\n- [examples/run_flow_investment_demo.py](https://github.com/shibing624/actionflow/blob/main/examples/run_flow_investment_demo.py) \u5b9e\u73b0\u4e86\u6295\u8d44\u7814\u7a76\u7684\u5de5\u4f5c\u6d41\uff0c\u4f9d\u6b21\u6267\u884c\u80a1\u7968\u4fe1\u606f\u6536\u96c6\u3001\u80a1\u7968\u5206\u6790\u3001\u64b0\u5199\u5206\u6790\u62a5\u544a\uff0c\u590d\u67e5\u62a5\u544a\u7b49\u591a\u4e2aTask\n\n## Contact\n\n- Issue(\u5efa\u8bae)\n \uff1a[![GitHub issues](https://img.shields.io/github/issues/shibing624/actionflow.svg)](https://github.com/shibing624/actionflow/issues)\n- \u90ae\u4ef6\u6211\uff1axuming: xuming624@qq.com\n- \u5fae\u4fe1\u6211\uff1a \u52a0\u6211*\u5fae\u4fe1\u53f7\uff1axuming624, \u5907\u6ce8\uff1a\u59d3\u540d-\u516c\u53f8-NLP* \u8fdbNLP\u4ea4\u6d41\u7fa4\u3002\n\n\n\n## Citation\n\n\u5982\u679c\u4f60\u5728\u7814\u7a76\u4e2d\u4f7f\u7528\u4e86`actionflow`\uff0c\u8bf7\u6309\u5982\u4e0b\u683c\u5f0f\u5f15\u7528\uff1a\n\nAPA:\n\n```\nXu, M. actionflow: A Human-Centric Framework for Large Language Model Agent Workflows (Version 0.0.2) [Computer software]. https://github.com/shibing624/actionflow\n```\n\nBibTeX:\n\n```\n@misc{Xu_actionflow,\n title={actionflow: A Human-Centric Framework for Large Language Model Agent Workflows},\n author={Xu Ming},\n year={2024},\n howpublished={\\url{https://github.com/shibing624/actionflow}},\n}\n```\n\n## License\n\n\u6388\u6743\u534f\u8bae\u4e3a [The Apache License 2.0](/LICENSE)\uff0c\u53ef\u514d\u8d39\u7528\u505a\u5546\u4e1a\u7528\u9014\u3002\u8bf7\u5728\u4ea7\u54c1\u8bf4\u660e\u4e2d\u9644\u52a0`actionflow`\u7684\u94fe\u63a5\u548c\u6388\u6743\u534f\u8bae\u3002\n## Contribute\n\n\u9879\u76ee\u4ee3\u7801\u8fd8\u5f88\u7c97\u7cd9\uff0c\u5982\u679c\u5927\u5bb6\u5bf9\u4ee3\u7801\u6709\u6240\u6539\u8fdb\uff0c\u6b22\u8fce\u63d0\u4ea4\u56de\u672c\u9879\u76ee\uff0c\u5728\u63d0\u4ea4\u4e4b\u524d\uff0c\u6ce8\u610f\u4ee5\u4e0b\u4e24\u70b9\uff1a\n\n- \u5728`tests`\u6dfb\u52a0\u76f8\u5e94\u7684\u5355\u5143\u6d4b\u8bd5\n- \u4f7f\u7528`python -m pytest`\u6765\u8fd0\u884c\u6240\u6709\u5355\u5143\u6d4b\u8bd5\uff0c\u786e\u4fdd\u6240\u6709\u5355\u6d4b\u90fd\u662f\u901a\u8fc7\u7684\n\n\u4e4b\u540e\u5373\u53ef\u63d0\u4ea4PR\u3002\n\n## Acknowledgements \n\n- [https://github.com/langchain-ai/langchain](https://github.com/langchain-ai/langchain)\n- [https://github.com/simonmesmith/agentflow](https://github.com/simonmesmith/agentflow)\n- [https://github.com/phidatahq/phidata](https://github.com/phidatahq/phidata)\n\n\nThanks for their great work!\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "dynamic": null, "home_page": "https://github.com/shibing624/actionflow", "keywords": "actionflow, Agent Tool, action, agent", "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "actionflow", "package_url": "https://pypi.org/project/actionflow/", "platform": null, "project_url": "https://pypi.org/project/actionflow/", "project_urls": { "Homepage": "https://github.com/shibing624/actionflow" }, "provides_extra": null, "release_url": "https://pypi.org/project/actionflow/0.0.5/", "requires_dist": null, "requires_python": ">=3.8.0", "summary": "LLM agent workflows", "version": "0.0.5", "yanked": false, "yanked_reason": null }, "last_serial": 23897308, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "blake2b_256": "0b46cc132799e4c894a10c3f5f46d0525954532a7fc3db4b25066eeb840bfe23", "md5": "9fbb88cec83e82902c969e1f3a7b726c", "sha256": "b41062606a13a213006ef3333f403194be601d379894834cb130706977358a99" }, "downloads": -1, "filename": "actionflow-0.0.1.tar.gz", "has_sig": false, "md5_digest": "9fbb88cec83e82902c969e1f3a7b726c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 7621, "upload_time": "2024-06-04T02:40:31", "upload_time_iso_8601": "2024-06-04T02:40:31.478086Z", "url": "https://files.pythonhosted.org/packages/0b/46/cc132799e4c894a10c3f5f46d0525954532a7fc3db4b25066eeb840bfe23/actionflow-0.0.1.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.2": [ { "comment_text": "", "digests": { "blake2b_256": "996273c52b8c0eb49c15da5e4b52aac3828f55eb6a7997c12ecce3dbde12dbb8", "md5": "2fe585c21396eed08d7c0a9b0478bb01", "sha256": "ece25ed50899a5183d23e46d92d9615186025d4c29ab06a2bfda29cc8a046051" }, "downloads": -1, "filename": "actionflow-0.0.2.tar.gz", "has_sig": false, "md5_digest": "2fe585c21396eed08d7c0a9b0478bb01", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 22540, "upload_time": "2024-06-06T14:40:32", "upload_time_iso_8601": "2024-06-06T14:40:32.804247Z", "url": "https://files.pythonhosted.org/packages/99/62/73c52b8c0eb49c15da5e4b52aac3828f55eb6a7997c12ecce3dbde12dbb8/actionflow-0.0.2.tar.gz", "yanked": false, "yanked_reason": null } ], "0.0.5": [ { "comment_text": "", "digests": { "blake2b_256": "b185d5ac7ca1a30a61a7912c06cd554ce3b03ca392347b7c3dec39a03df8fc00", "md5": "a845e9092aab9e6aa67ea39ba5143036", "sha256": "9bf42f8af7cfe6950458c306dc8754f611d3cd9f8375dcefb5fa6a7015b0ee29" }, "downloads": -1, "filename": "actionflow-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a845e9092aab9e6aa67ea39ba5143036", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.8.0", "size": 92879, "upload_time": "2024-06-28T15:24:42", "upload_time_iso_8601": "2024-06-28T15:24:42.346492Z", "url": "https://files.pythonhosted.org/packages/b1/85/d5ac7ca1a30a61a7912c06cd554ce3b03ca392347b7c3dec39a03df8fc00/actionflow-0.0.5.tar.gz", "yanked": false, "yanked_reason": null } ] }, "urls": [ { "comment_text": "", "digests": { "blake2b_256": "b185d5ac7ca1a30a61a7912c06cd554ce3b03ca392347b7c3dec39a03df8fc00", "md5": "a845e9092aab9e6aa67ea39ba5143036", "sha256": "9bf42f8af7cfe6950458c306dc8754f611d3cd9f8375dcefb5fa6a7015b0ee29" }, "downloads": -1, "filename": "actionflow-0.0.5.tar.gz", "has_sig": false, "md5_digest": "a845e9092aab9e6aa67ea39ba5143036", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.8.0", "size": 92879, "upload_time": "2024-06-28T15:24:42", "upload_time_iso_8601": "2024-06-28T15:24:42.346492Z", "url": "https://files.pythonhosted.org/packages/b1/85/d5ac7ca1a30a61a7912c06cd554ce3b03ca392347b7c3dec39a03df8fc00/actionflow-0.0.5.tar.gz", "yanked": false, "yanked_reason": null } ], "vulnerabilities": [] }