[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-melih-unsal--DemoGPT":3,"tool-melih-unsal--DemoGPT":64},[4,17,27,35,43,56],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":16},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,3,"2026-04-05T11:01:52",[13,14,15],"开发框架","图像","Agent","ready",{"id":18,"name":19,"github_repo":20,"description_zh":21,"stars":22,"difficulty_score":23,"last_commit_at":24,"category_tags":25,"status":16},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",138956,2,"2026-04-05T11:33:21",[13,15,26],"语言模型",{"id":28,"name":29,"github_repo":30,"description_zh":31,"stars":32,"difficulty_score":23,"last_commit_at":33,"category_tags":34,"status":16},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107662,"2026-04-03T11:11:01",[13,14,15],{"id":36,"name":37,"github_repo":38,"description_zh":39,"stars":40,"difficulty_score":23,"last_commit_at":41,"category_tags":42,"status":16},3704,"NextChat","ChatGPTNextWeb\u002FNextChat","NextChat 是一款轻量且极速的 AI 助手，旨在为用户提供流畅、跨平台的大模型交互体验。它完美解决了用户在多设备间切换时难以保持对话连续性，以及面对众多 AI 模型不知如何统一管理的痛点。无论是日常办公、学习辅助还是创意激发，NextChat 都能让用户随时随地通过网页、iOS、Android、Windows、MacOS 或 Linux 端无缝接入智能服务。\n\n这款工具非常适合普通用户、学生、职场人士以及需要私有化部署的企业团队使用。对于开发者而言，它也提供了便捷的自托管方案，支持一键部署到 Vercel 或 Zeabur 等平台。\n\nNextChat 的核心亮点在于其广泛的模型兼容性，原生支持 Claude、DeepSeek、GPT-4 及 Gemini Pro 等主流大模型，让用户在一个界面即可自由切换不同 AI 能力。此外，它还率先支持 MCP（Model Context Protocol）协议，增强了上下文处理能力。针对企业用户，NextChat 提供专业版解决方案，具备品牌定制、细粒度权限控制、内部知识库整合及安全审计等功能，满足公司对数据隐私和个性化管理的高标准要求。",87618,"2026-04-05T07:20:52",[13,26],{"id":44,"name":45,"github_repo":46,"description_zh":47,"stars":48,"difficulty_score":23,"last_commit_at":49,"category_tags":50,"status":16},2268,"ML-For-Beginners","microsoft\u002FML-For-Beginners","ML-For-Beginners 是由微软推出的一套系统化机器学习入门课程，旨在帮助零基础用户轻松掌握经典机器学习知识。这套课程将学习路径规划为 12 周，包含 26 节精炼课程和 52 道配套测验，内容涵盖从基础概念到实际应用的完整流程，有效解决了初学者面对庞大知识体系时无从下手、缺乏结构化指导的痛点。\n\n无论是希望转型的开发者、需要补充算法背景的研究人员，还是对人工智能充满好奇的普通爱好者，都能从中受益。课程不仅提供了清晰的理论讲解，还强调动手实践，让用户在循序渐进中建立扎实的技能基础。其独特的亮点在于强大的多语言支持，通过自动化机制提供了包括简体中文在内的 50 多种语言版本，极大地降低了全球不同背景用户的学习门槛。此外，项目采用开源协作模式，社区活跃且内容持续更新，确保学习者能获取前沿且准确的技术资讯。如果你正寻找一条清晰、友好且专业的机器学习入门之路，ML-For-Beginners 将是理想的起点。",84991,"2026-04-05T10:45:23",[14,51,52,53,15,54,26,13,55],"数据工具","视频","插件","其他","音频",{"id":57,"name":58,"github_repo":59,"description_zh":60,"stars":61,"difficulty_score":10,"last_commit_at":62,"category_tags":63,"status":16},3128,"ragflow","infiniflow\u002Fragflow","RAGFlow 是一款领先的开源检索增强生成（RAG）引擎，旨在为大语言模型构建更精准、可靠的上下文层。它巧妙地将前沿的 RAG 技术与智能体（Agent）能力相结合，不仅支持从各类文档中高效提取知识，还能让模型基于这些知识进行逻辑推理和任务执行。\n\n在大模型应用中，幻觉问题和知识滞后是常见痛点。RAGFlow 通过深度解析复杂文档结构（如表格、图表及混合排版），显著提升了信息检索的准确度，从而有效减少模型“胡编乱造”的现象，确保回答既有据可依又具备时效性。其内置的智能体机制更进一步，使系统不仅能回答问题，还能自主规划步骤解决复杂问题。\n\n这款工具特别适合开发者、企业技术团队以及 AI 研究人员使用。无论是希望快速搭建私有知识库问答系统，还是致力于探索大模型在垂直领域落地的创新者，都能从中受益。RAGFlow 提供了可视化的工作流编排界面和灵活的 API 接口，既降低了非算法背景用户的上手门槛，也满足了专业开发者对系统深度定制的需求。作为基于 Apache 2.0 协议开源的项目，它正成为连接通用大模型与行业专有知识之间的重要桥梁。",77062,"2026-04-04T04:44:48",[15,14,13,26,54],{"id":65,"github_repo":66,"name":67,"description_en":68,"description_zh":69,"ai_summary_zh":69,"readme_en":70,"readme_zh":71,"quickstart_zh":72,"use_case_zh":73,"hero_image_url":74,"owner_login":75,"owner_name":76,"owner_avatar_url":77,"owner_bio":78,"owner_company":79,"owner_location":79,"owner_email":79,"owner_twitter":80,"owner_website":81,"owner_url":82,"languages":83,"stars":92,"forks":93,"last_commit_at":94,"license":95,"difficulty_score":23,"env_os":96,"env_gpu":97,"env_ram":97,"env_deps":98,"category_tags":111,"github_topics":112,"view_count":23,"oss_zip_url":79,"oss_zip_packed_at":79,"status":16,"created_at":130,"updated_at":131,"faqs":132,"releases":163},2008,"melih-unsal\u002FDemoGPT","DemoGPT","🤖 Everything you need to create an LLM Agent—tools, prompts, frameworks, and models—all in one place.","DemoGPT 是一个一站式平台，帮助用户快速构建基于大语言模型（LLM）的智能代理（Agent）。它整合了工具、提示模板、开发框架和主流模型资源，让开发者无需从零搭建，就能轻松组合 RAG、知识图谱和向量数据库等能力，实现高效智能体开发。过去，构建一个功能完整的 LLM Agent 需要整合多个开源库、调试复杂流程，而 DemoGPT 将这些碎片化组件统一管理，大幅降低入门门槛和开发成本。它特别适合 AI 开发者、研究人员和希望快速原型验证的工程师使用，也适合对智能体技术感兴趣的进阶用户。其独特亮点在于内置 AgentHub，提供可复用的工具库和多种预置代理类型（如问答、数据分析、自动化任务等），支持通过 Python 接口或 Web 界面直接调用，还能一键部署到 Streamlit 或 Hugging Face Spaces。无论是想实验新想法，还是构建生产级应用，DemoGPT 都能提供清晰、模块化的开发路径。","# 🤖 Create Agents in a Second - with the Best Tools, RAG, Knowledge Graph and Vector Databases\n\n\u003Cp align=\"center\">\n\u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_001f3dcd5d4b.png\" alt=\"DemoGPT logo: Generate automatic LangChain pipelines\" width=\"450px\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cb>⚡ Everything you need to create an LLM Agent is here. Access a comprehensive suite of tools, prompts, frameworks, and a knowledge hub of LLM models—all in one place to streamline your agent development.\u003C\u002Fb>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdemogpt\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_66a006428217.png\" alt=\"Downloads\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Freleases\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fmelih-unsal\u002FDemoGPT\" alt=\"Releases\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdemogpt.io\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FOfficial%20Website-demogpt.io-blue?style=flat&logo=world&logoColor=white\" alt=\"Official Website\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdocs.demogpt.io\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FDocumentation-📘-blueviolet\" alt=\"DemoGPT Documentation\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"docs\u002FREADME_CN.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F文档-中文版-blue.svg\" alt=\"CN doc\">\u003C\u002Fa>\n\u003Ca href=\"README.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocument-English-blue.svg\" alt=\"EN doc\">\u003C\u002Fa>\n\u003Ca href=\"docs\u002FROADMAP_CN.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FROADMAP-路线图-blue\" alt=\"roadmap\">\u003C\u002Fa>\n\u003Ca href=\"docs\u002FROADMAP.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FROADMAP-english-red\" alt=\"roadmap\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg\" alt=\"License: MIT\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues?q=is%3Aopen+is%3Aissue\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fmelih-unsal\u002FDemoGPT.svg?maxAge=2592000000000000\" alt=\"Open an issue\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues?q=is%3Aissue+is%3Aclosed\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues-closed-raw\u002Fmelih-unsal\u002FDemoGPT.svg?maxAge=25920000000000000000\" alt=\"Closed issues\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#melih-unsal\u002FDemoGPT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fmelih-unsal\u002FDemoGPT?style=social\" alt=\"DemoGPT  Stars\">\u003C\u002Fa>\n\u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fmelih-unsal\u002FDemoGPT\" \u002F> \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fdemo_gpt\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fdemo_gpt?style=social\" alt=\"Twitter Follow\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdemogpt.medium.com\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?style=for-the-badge&message=Medium&color=000000&logo=Medium&logoColor=FFFFFF&label=\" alt=\"DemoGPT Medium\" height=\"20\"\u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.producthunt.com\u002Fposts\u002Fdemogpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-demogpt\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fapi.producthunt.com\u002Fwidgets\u002Fembed-image\u002Fv1\u002Ffeatured.svg?post_id=406106&theme=light\" alt=\"DemoGPT - Auto&#0032;generative&#0032;AI&#0032;app&#0032;generator&#0032;with&#0032;the&#0032;power&#0032;of&#0032;Llama&#0032;2 | Product Hunt\" height=\"20\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fdemogpt.streamlit.app\">\u003Cimg src=\"https:\u002F\u002Fstatic.streamlit.io\u002Fbadges\u002Fstreamlit_badge_black_white.svg\" alt=\"Streamlit application\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fmelihunsal\u002Fdemogpt\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97-Spaces-yellow\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n## 📑 Table of Contents\n\n- [Introduction](#-introduction)\n- [Architecture](#️-architecture)\n- [Installation](#-installation)\n- [Usage](#-usage)\n  - [Package Version](#-for-the-package-version)\n  - [Python Interface](#-for-the-python-interface)\n  - [Source Code Version](#-for-the-source-code-version)\n- [DemoGPT AgentHub](#-demogpt-agenthub)\n  - [Installation](#-installation-1)\n  - [Creating Tools](#-creating-tools)\n  - [Available Tools](#-available-tools)\n  - [Creating an Agent](#-creating-an-agent)\n  - [Using an Agent](#-using-an-agent)\n  - [Available Agent Types](#-available-agent-types)\n  - [Using ReactAgent](#-using-reactagent)\n  - [Using RAG](#-using-rag)\n  - [Combining RAG with Agents](#-combining-rag-with-agents)\n- [To-Do](#to-do-)\n- [Contribute](#-contribute)\n- [Citations](#-citations)\n- [License](#-license)\n\n## 🤖 DemoGPT AgentHub\n\nDemoGPT AgentHub is a powerful library that allows you to create, customize, and use AI agents with various tools.\n\n### 🛠 Installation\n\nTo use DemoGPT AgentHub, simply install the main package:\n\n```bash \npip install demogpt\n```\n\n### 🔧 Creating Tools\n\nCreating custom tools is easy:\n\n```python\nfrom demogpt_agenthub.tools import BaseTool\nclass MyCustomTool(BaseTool):\n    def __init__(self):\n        self.name = \"MyCustomTool\"\n        self.description = \"This tool does something amazing!\"\n        super().__init__()\n    def run(self, query):\n        # Implement your tool's functionality here\n        return f\"Result for: {query}\"\n```\n\n**Example Usage:**\n```python\nmy_tool = MyCustomTool()\nagent = ToolCallingAgent(tools=[my_tool], llm=llm, verbose=True)\nagent.run(\"Can you use my custom tool?\")\n```\n\n**Example Output:**\n```\nReasoning:\nThe user is asking to use the custom tool called MyCustomTool. This tool is described as doing \"something amazing\", so I will use it to process the query.\nTool call:\nMyCustomTool\nTool result:\nResult for: Can you use my custom tool?\nAnswer:\nYes, I successfully used your custom tool! The tool processed your query and returned the following result: \"Result for: Can you use my custom tool?\"\n```\n\n### 🧰 Available Tools\n\nDemoGPT AgentHub comes with several built-in tools:\n\n- 🔍 TavilySearchTool\n- 🌦 WeatherTool\n- 📚 WikipediaTool\n- 🐚 BashTool\n- 🐍 PythonTool\n- 📄 ArxivTool\n- 🎥 YouTubeSearchTool\n- 💻 StackOverFlowTool\n- 🌐 RequestUrlTool\n- 🗃 WikiDataTool\n- 🏥 PubmedTool\n\n### 🤖 Creating an Agent\n\nTo create an agent:\n\n```python\nfrom demogpt_agenthub.agents import ToolCallingAgent\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.tools import TavilySearchTool, WeatherTool\n\nsearch_tool = TavilySearchTool()\nweather_tool = WeatherTool()\nllm = OpenAIChatModel(model_name=\"gpt-4o-mini\")\nagent = ToolCallingAgent(tools=[search_tool, weather_tool], llm=llm, verbose=True)\n```\n\n### 🎮 Using an Agent\n\nOnce you've created an agent, use it to ask questions or perform tasks:\n\n```python\nquery = \"What's the weather like in New York today?\"\nresponse = agent.run(query)\nprint(response)\n```\n\n**Example Output:**\n\n```\nRemoving existing vectorstore at rag_chroma\nDecision:\nFalse\nReasoning:\nTo find the weather in New York today, I first need to retrieve the current weather information. After obtaining the weather information, I can provide you with the current weather conditions. The RAG tool will help me find out the current weather in New York.\nTool call:\nRAG\nTool args:\n{'query': 'weather in New York today'}\nTool result:\nIn New York, the current weather is as follows:\nDetailed status: clear sky\nWind speed: 2.57 m\u002Fs, direction: 240°\nHumidity: 56%\nTemperature: \n  - Current: 24.36°C\n  - High: 25.74°C\n  - Low: 22.05°C\n  - Feels like: 24.46°C\nRain: {}\nHeat index: None\nCloud cover: 0%\nAnswer:\nThe current weather in New York is clear sky with a temperature of 24.36°C (feels like 24.46°C). The humidity is at 56% with a wind speed of 2.57 m\u002Fs from the direction of 240°. There is 0% cloud cover.\n```\n\nThis example demonstrates how an agent can:\n1. Access document information through RAG\n2. Use Python for calculations\n3. Combine multiple tools to answer complex questions\n\nThe agent will:\n1. Use RAG to find information about the current weather in New York\n2. Use the Python tool to calculate the current weather conditions\n3. Provide a comprehensive answer using both pieces of information\n\n### 🧰 Example: Creating a Simple Math Tool\n\nHere's an example of creating a custom power calculation tool:\n\n```python\nfrom demogpt_agenthub.tools import BaseTool\nclass MyPowerTool(BaseTool):\n    def __init__(self):\n        self.name = \"MyPowerTool\"\n        self.description = \"This tool is used to calculate the power of a number\"\n        super().__init__()\n    def run(self, a: int, b: int):\n        # Implement your tool's functionality here\n        return a**b\n\npower_tool = MyPowerTool()\nagent = ToolCallingAgent(tools=[search_tool, weather_tool, power_tool], llm=llm, verbose=True)\nagent.run(\"What is the 34 to the power of 26?\")\n```\n\n**Example Output:**\n```\nReasoning:\nThe task is to calculate a number raised to the power of another. The most appropriate tool for this calculation is MyPowerTool, which is specifically designed for power calculations.\nTool call:\nMyPowerTool\nTool result:\n6583424253569334549714045134721532297216\nAnswer:\n34 to the power of 26 is 6583424253569334549714045134721532297216.\n```\n\n### 🧠 Using ReactAgent\n\nThe ReactAgent provides a detailed reasoning process:\n\n#### Example 1: Weather and Math Calculations\n\n```python\nfrom demogpt_agenthub.tools import TavilySearchTool, WeatherTool, PythonTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\n\nsearch_tool = TavilySearchTool()\nweather_tool = WeatherTool()\npython_tool = PythonTool()\n\nagent = ReactAgent(\n    tools=[search_tool, weather_tool, python_tool],\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"),\n    verbose=True\n)\n\nquery = \"What is the weather's temperature's square root in the country where Cristiano Ronaldo is currently playing?\"\nprint(agent.run(query))\n```\n\n**Example Output:**\n```\nDecision:\nFalse\nReasoning:\nFirst, I need to determine the current location where Christiano Ronaldo is playing in order to fetch the current temperature. Then I will use the OpenWeatherMap tool to get the temperature information. Finally, I will calculate the square root of the temperature using the Python Interpreter tool for precise computation.\nTool call:\nduckduckgo_search\nTool args:\n{'inp': 'Where is Christiano Ronaldo currently playing?'}\nTool result:\nRonaldo started Al Nassr's home match against Saudi Pro League leaders Al Ittihad on May 7. Stefano Pioli's men went into a 2-0 first-half lead but were beaten 3-2 when Houssem Aouar stuck in ... Cristiano Ronaldo and his Al Nassr team endured disappointment in 2023\u002F24 as they failed to win the Saudi Pro League or the AFC Champions League. After Sadio Mane, Seko Fofana, Marcelo Brozovic ... Yes, Cristiano Ronaldo will be in the lineup to play tonight. Now that they once again failed to win the AFC Champions League Elite, Ronaldo will still have some optimism that they can win the league despite being eight points behind Al Ittihad. Despite the club's poor season, Ronaldo has maintained his goalscoring form, netting 23 goals in ... Cristiano Ronaldo currently plays for Al Nassr in the Saudi Pro League. The Portugal international transferred from Manchester United in December 2022 and inked a two-and-a-half-year contract with ... Is Cristiano Ronaldo playing Today? Cristiano Ronaldo is expected to start in today's crucial match. The Portuguese star remains Al Nassr's top scorer in the AFC Champions League, with six goals to his name. His outstanding form has played a pivotal role in the team's journey to the semifinals—now just one win away from reaching a continental final for the first time since 1995, when ...\nDecision:\nFalse\nReasoning:\nI need to fetch the current temperature in Saudi Arabia where Cristiano Ronaldo is playing, using the OpenWeatherMap tool. After obtaining the temperature, I will compute its square root using the Python Interpreter tool.\nTool call:\nopen_weather_map\nTool args:\n{'city': 'Riyadh,SA'}\nTool result:\nIn Riyadh,SA, the current weather is as follows:\nDetailed status: clear sky\nWind speed: 5.44 m\u002Fs, direction: 150°\nHumidity: 7%\nTemperature:\nCurrent: 39.16°C\nHigh: 39.16°C\nLow: 39.16°C\nFeels like: 35.82°C\nRain: {}\nHeat index: None\nCloud cover: 0%\nDecision:\nFalse\nReasoning:\nI need to calculate the square root of the current temperature in Saudi Arabia, which is 39.16°C. I will use the Python Interpreter tool for precise calculation.\nTool call:\nPython Interpreter\nTool args:\n{'code': 'import math\\nresult = math.sqrt(39.16)\\nprint(result)'}\nTool result:\n6.257795138864806\n\nDecision:\nTrue\nAnswer:\nThe square root of the current temperature in Saudi Arabia, where Cristiano Ronaldo is playing, is approximately 6.26.\n```\n\n#### Example 2: Object Detection in Images\n\n```python\nfrom demogpt_agenthub.tools import YoloTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\n\nyolo_tool = YoloTool()\n\nagent = ReactAgent(tools=[yolo_tool], llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), verbose=True)\nquery = \"Give me the objects in the image https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg\"\nprint(agent.run(query))\n```\n\n**Example Output:**\n```\nDecision:\nFalse\nReasoning:\nThe task is to identify and list the objects present in a given image. The available tool, 'YOLO Object Detection', is specifically designed for this purpose and can analyze the image to output detailed descriptions of detected objects.\nTool call:\nYOLO Object Detection\nTool args:\n{'path': 'https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg'}\n\nFound https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg locally at bus.jpg\nimage 1\u002F1 \u002Fhome\u002Fmelih\u002FDesktop\u002Fprojects\u002FDemoGPT\u002Fbus.jpg: 640x480 4 persons, 1 bus, 59.1ms\nSpeed: 2.0ms preprocess, 59.1ms inference, 38.9ms postprocess per image at shape (1, 3, 640, 480)\nTool result:\nin the image.\nThere are 1 bus, 4 person in the image.\nThe bus[1] is from (3, 229) to (796, 728).\nThe person[1] is from (671, 394) to (809, 878).\nThe person[2] is from (47, 399) to (239, 904).\nThe person[3] is from (223, 408) to (344, 860).\nThe person[4] is from (0, 556) to (68, 872).\n\nDecision:\nTrue\nAnswer:\nIn the image you provided, there are the following objects detected:\n\n- 1 bus\n- 4 persons\n\nThe bus is located at coordinates from (3, 229) to (796, 728). The persons are located at the following coordinates:\n\n- Person 1: (671, 394) to (809, 878)\n- Person 2: (47, 399) to (239, 904)\n- Person 3: (223, 408) to (344, 860)\n- Person 4: (0, 556) to (68, 872)\n```\n\nThese examples demonstrate how ReactAgent can:\n1. Process complex multi-step queries using multiple tools\n2. Perform computer vision tasks with YOLO object detection\n3. Show detailed reasoning and decision-making process\n4. Provide structured and informative responses\n\n### 🧮 Using RAG\n\nBaseRAG provides an easy way to implement Retrieval Augmented Generation with various vector stores:\n\n```python\nfrom demogpt_agenthub.rag import BaseRAG\nfrom demogpt_agenthub.llms import OpenAIChatModel\n\n# Initialize RAG system\nrag = BaseRAG(\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    vectorstore=\"chroma\",  # Supports \"chroma\", \"pinecone\", \"faiss\"\n    persistent_path=\"rag_chroma\",  # Where to store the vector database\n    index_name=\"rag_index\",\n    reset_vectorstore=True,  # Whether to reset existing vectorstore\n    embedding_model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\",  # Or use OpenAI models\n    filter={\"search_kwargs\": {\"score_threshold\": 0.5}}\n)\n\n# Add documents\nrag.add_files([\"~\u002FDownloads\u002FResume.pdf\"])  # Supports PDF, TXT, CSV, JSON\n\n# Query the RAG system\nresponse = rag.run(\"What is the GitHub repo of the person?\")\nprint(response)\n```\n\n**Example Output:**\n```\nRemoving existing vectorstore at rag_chroma\nThe GitHub repository of the person is called DemoGPT, and it can be found at https:\u002F\u002Fgithub.com\u002Fmelih-unsal.\n```\n\n**Another Query Example:**\n```python\nrag.run(\"How many stars does the GitHub repo have?\")\n```\n\n**Output:**\n```\nThe GitHub repo has 1.8K stars.\n```\n\nThese examples provide users with a clear understanding of:\n1. What to expect when running these code blocks\n2. The format of the output\n3. How different agents and tools behave\n4. How the reasoning process works in the ReactAgent\n5. How RAG responds to questions\n\n### 🔄 Combining RAG with Agents\n\nYou can also use RAG within agents to enable document-based reasoning. Here's an example:\n\n```python\nfrom demogpt_agenthub.tools import PythonTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\nfrom demogpt_agenthub.rag import BaseRAG\n\n# Initialize RAG system\nrag = BaseRAG(\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    vectorstore=\"chroma\", \n    persistent_path=\"rag_chroma\", \n    index_name=\"rag_index\",\n    reset_vectorstore=True,\n    embedding_model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\",\n    filter={\"search_kwargs\": {\"score_threshold\": 0.5}}\n)\n\n# Add your documents\nrag.add_files([\"~\u002FDownloads\u002FMelih_ÜNSAL_Resume.pdf\"])\n\n# Create an agent with RAG and other tools\npython_tool = PythonTool()\nagent = ReactAgent(\n    tools=[python_tool, rag], \n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    verbose=True\n)\n\n# Use the agent with both RAG and other tools\nquery = \"What is the square root of the number of stars of the github repo of Melih?\"\nprint(agent.run(query))\n```\n\n**Example Output:**\n```\nRemoving existing vectorstore at rag_chroma\nDecision:\nFalse\nReasoning:\nTo find the square root of the number of stars in Melih's GitHub repo, I first need to retrieve the current number of stars for that repository. After obtaining that number, I can compute its square root. The RAG tool will help me find out the number of stars, and then I'll use the Python Interpreter to calculate the square root.\nTool call:\nRAG\nTool args:\n{'query': 'number of stars in the GitHub repository of Melih'}\nTool result:\nThe GitHub repository of Melih ÜNSAL has 1.8K stars.\nDecision:\nFalse\nReasoning:\nI need to calculate the square root of 1.8K stars, which is equivalent to 1800 stars. To perform this calculation, I will use the Python Interpreter tool to compute the square root.\nTool call:\nPython Interpreter\nTool args:\n{'code': 'import math\\nresult = math.sqrt(1800)\\nprint(result)'}\nTool result:\n42.42640687119285\n\nDecision:\nTrue\nAnswer:\nThe square root of the number of stars in Melih's GitHub repository, which is 1.8K (or 1800 stars), is approximately 42.43.\n```\n\nThis example demonstrates how an agent can:\n1. Access document information through RAG\n2. Use Python for calculations\n3. Combine multiple tools to answer complex questions\n\nThe agent will:\n1. Use RAG to find information about the GitHub repository stars\n2. Use the Python tool to calculate the square root\n3. Provide a comprehensive answer using both pieces of information\n\n## 🔥 Demo\n\n\n![Tweet Generator](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_70391129c6ea.gif)\n\n## 📚 Documentation\n\nSee our documentation site [here](https:\u002F\u002Fdocs.demogpt.io\u002F) for full how-to docs and guidelines\n\n⚡ With DemoGPT v1.3, API usage will be possible with the power of **Gorilla** within 2 weeks.\nAfter this release, you will be able use external APIs autonomously. ⚡\n\n## 📦 Using DemoGPT Package\n\nThe DemoGPT package is now available and can be installed using pip. Run the following command to install the package:\n\n```sh\npip install demogpt\n```\n\nTo use the DemoGPT application, simply type \"demogpt\" into your terminal:\n\n```sh\ndemogpt\n```\n\n\n## 📌 Introduction\n\nWelcome to DemoGPT, a revolutionary open-source initiative that is reshaping the landscape of Large Language Model (LLM) based application development.\n\nAt the heart of DemoGPT, the capabilities of GPT-3.5-turbo come to life, driving the automatic generation of LangChain code. This process is enriched with a sophisticated architecture that translates user instructions into interactive Streamlit applications.\n\n### How DemoGPT Works\n\n1. **Planning:** DemoGPT starts by generating a plan from the user's instruction.\n2. **Task Creation:** It then creates specific tasks from the plan and instruction.\n3. **Code Snippet Generation:** These tasks are transferred into code snippets.\n4. **Final Code Assembly:** The code snippets are combined into a final code, resulting in an interactive Streamlit app.\n\nThe LangChain code, once generated, is not a mere endpoint but a transformative stage. It evolves into a user-friendly Streamlit application, adding an interactive dimension to the logic crafted. This metamorphosis embodies DemoGPT's commitment to user engagement and experience.\n\n### Future Enhancements\n\nWe are planning to add a publicly available database that will accelerate the generation process by retrieving similar examples during the refining process. This innovation will further streamline the development workflow, making it more efficient and responsive.\n\n### Model Flexibility\n\nDemoGPT is designed to be adaptable, capable of using any LLM model that meets specific performance criteria in terms of code generation. This flexibility ensures that DemoGPT remains at the forefront of technology, embracing new advancements in LLM.\n\nDemoGPT's iterative development process remains a cornerstone of its innovation. Each code segment undergoes individual testing, and the self-refining strategy ensures an efficient and error-minimized workflow. This fusion of meticulous testing and refinement is a testament to DemoGPT's pursuit of excellence.\n\nBy transcending traditional coding paradigms, DemoGPT is pioneering a new era in LLM-based applications. It's not just about code generation; it's about crafting intelligent, interactive, and inclusive solutions.\n\nIn summary, DemoGPT is more than a project; it's a visionary approach, pushing the boundaries of what's possible in LLM-based application development.\n\nIn the next release, we are gonna integrate **Gorilla** to DemoGPT to enable DemoGPT to use external APIs autonomously. The future is bright, and the journey has just begun. Join us in this exciting adventure!\n\n\n## ⚙️ Architecture\n### DemoGPT Architecture\n![DemoGPT Architecture](assets\u002Fplan_based_pipeline.png?raw=true \"DemoGPT Architecture\")\n\n## 🔧 Installation\n\n### For the Package Version\n\nYou can install the DemoGPT package by running the following command:\n\n```sh\npip install demogpt\n```\n\n### For the Source Code Version\n\n\n1. Clone the repository:\n    ```sh\n    git clone https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT.git\n    ```\n2. Navigate into the project directory:\n    ```sh\n    cd DemoGPT\n    ```\n3. Install DemoGPT: \n    ```sh\n    pip install .\n    ```\n\n## 🎮 Usage\n\n### 📦 For the Package Version\n\nOnce the DemoGPT package is installed, you can use it by running the following command in your terminal:\n\n```sh\ndemogpt\n```\n\n### 🐍 For the Python Interface\n\nYou can now use DemoGPT as a library in your Python applications:\n\n```python\nfrom demogpt import DemoGPT\nagent = DemoGPT(model_name=\"gpt-3.5-turbo\") # if OPENAI_API_KEY is not set in env variables, put it with openai_api_key argument\ninstruction = \"Your instruction here\"\ntitle = \"Your title here\"\ncode = \"\"\nfor phase in agent(instruction=instruction, title=title):\n    print(phase) # this will display the resulting json for each generation stage\n    if phase[\"done\"]:\n        code = phase[\"code\"] # final code\nprint(code)\n```\n\nExample Output (truncated):\n\n```bash\n# phases\n{'stage': 'draft', 'completed': False, 'percentage': 60, ...}\n{'stage': 'draft', 'completed': False, 'percentage': 64, 'code': '#Get the source language ...'}\n...\n{'stage': 'final', 'completed': True, 'percentage': 100, ... , 'code': 'import streamlit as st\\n...'}\n```\n\n```python\n# Code\nimport streamlit as st\nfrom langchain.chains import LLMChain\nfrom langchain_community.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (ChatPromptTemplate,\n                                    HumanMessagePromptTemplate,\n                                    SystemMessagePromptTemplate)\n...\n```\n\n### 🌐 For the Source Code Version\n\nIf you have cloned the repository and wish to run the source code version, you can use DemoGPT by running the following command:\n\n```sh\nstreamlit run demogpt\u002Fapp.py\n```\n\n## To-Do 📝\n- [x] Implement new DemoGPT pipeline including plan generation, task creation, code snippet generation, and final code assembly.\n- [x] Add feature to allow users to select models.\n- [x] Define useful LangChain tasks\n- [x] Publish release with the new pipeline without refinement\n- [ ] Implement remaining LangChain tasks\n- [ ] Implement self-refining strategy for model response refinement.\n- [ ] Integrate 🦍 Gorilla model for API calls.\n- [ ] Add Rapid API for expanding available API calls. \n- [ ] Add 🦙 Llama2 integration\n- [ ] Implement publicly available database to accelerate the generation process by retrieving similar examples during the refining process.\n- [ ] Add all successfully generated steps to a DB to eliminate redundant refinement.\n\n## 🤝 Contribute\n\nContributions to the DemoGPT project are welcomed! Whether you're fixing bugs, improving the documentation, or proposing new features, your efforts are highly appreciated. Please check the open issues before starting any work.\n\n> Please read [`CONTRIBUTING`](CONTRIBUTING.md) for details on our [`CODE OF CONDUCT`](CODE_OF_CONDUCT.md), and the process for submitting pull requests to us.\n\n## 📄 Citations\n\nDemoGPT has been referenced in various research papers for its innovative approach to app creation using autonomous AI agents. Below is a list of papers that have cited DemoGPT:\n\n- Lei Wang, Chen Ma , Xueyang Feng , Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, Wayne Xin , Zhao, Zhewei Wei, Ji-Rong Wen, \"A Survey on Large Language Model based Autonomous Agents\", 2023. [Link to paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2308.11432.pdf)\n- Yuan Li, Yixuan Zhang, Lichao Sun, \"METAAGENTS: SIMULATING INTERACTIONS OF HUMAN BEHAVIORS FOR LLM-BASED TASK-ORIENTED COORDINATION VIA COLLABORATIVE GENERATIVE AGENTS\" Journal\u002FConference, 2023. [Link to paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2310.06500.pdf)\n- Yuheng Cheng, Ceyao Zhang, Zhengwen Zhang, Xiangrui Meng, Sirui Hong, Wenhao Li, Zihao Wang, Zekai Wang, Feng Yin, Junhua Zhao, Xiuqiang He, \"EXPLORING LARGE LANGUAGE MODEL BASED INTELLIGENT AGENTS: DEFINITIONS, METHODS, AND PROSPECTS\", 2024. [Link to paper](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2401.03428.pdf)\n- Mikhail, Poludin. Optimalizace LLM agentů pro analýzu tabulkových dat: Integrace LoRA pro zvýšení kvality. MS thesis. České vysoké učení technické v Praze. Vypočetní a informační centrum., 2024. [Link to paper](https:\u002F\u002Fdspace.cvut.cz\u002Fbitstream\u002Fhandle\u002F10467\u002F115388\u002FF3-DP-2024-Poludin-Mikhail-Optimizing_LLM-Powered_Agents_for_Tabular_Data_Analytics_Integrating_LoRA_for_Enhanced_Quality.pdf?sequence=-1)\n\nThis acknowledgment from the academic community highlights the potential and utility of DemoGPT in advancing the field of AI-driven development tools.\n\n\n## 📜 License\n\nDemoGPT is an open-source project licensed under [MIT License](LICENSE).\n\n---\n\nFor any issues, questions, or comments, please feel free to contact us or open an issue. We appreciate your feedback to make DemoGPT better.\n","# 🤖 秒速创建智能体——配备顶级工具、RAG、知识图谱与向量数据库\n\n\u003Cp align=\"center\">\n\u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_001f3dcd5d4b.png\" alt=\"DemoGPT logo: 生成自动LangChain流水线\" width=\"450px\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Cb>⚡ 您所需的一切，尽在这里。一站式获取全面的工具集、提示词、框架以及大语言模型知识库，助您轻松实现智能体开发。\u003C\u002Fb>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fpepy.tech\u002Fproject\u002Fdemogpt\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_66a006428217.png\" alt=\"下载量\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Freleases\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Frelease\u002Fmelih-unsal\u002FDemoGPT\" alt=\"发布版本\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdemogpt.io\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F官方网站-demogpt.io-blue?style=flat&logo=world&logoColor=white\" alt=\"官方网站\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdocs.demogpt.io\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F文档-📘-blueviolet\" alt=\"DemoGPT 文档\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"docs\u002FREADME_CN.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F文档-中文版-blue.svg\" alt=\"CN doc\">\u003C\u002Fa>\n\u003Ca href=\"README.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fdocument-English-blue.svg\" alt=\"EN doc\">\u003C\u002Fa>\n\u003Ca href=\"docs\u002FROADMAP_CN.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FROADMAP-路线图-blue\" alt=\"roadmap\">\u003C\u002Fa>\n\u003Ca href=\"docs\u002FROADMAP.md\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FROADMAP-english-red\" alt=\"roadmap\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicenses\u002FMIT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg\" alt=\"License: MIT\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues?q=is%3Aopen+is%3Aissue\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues\u002Fmelih-unsal\u002FDemoGPT.svg?maxAge=2592000000000000\" alt=\"打开问题\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues?q=is%3Aissue+is%3Aclosed\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues-closed-raw\u002Fmelih-unsal\u002FDemoGPT.svg?maxAge=25920000000000000000\" alt=\"已关闭的问题\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#melih-unsal\u002FDemoGPT\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002Fmelih-unsal\u002FDemoGPT?style=social\" alt=\"DemoGPT 星标\">\u003C\u002Fa>\n\u003Ca href=\"\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fforks\u002Fmelih-unsal\u002FDemoGPT\" \u002F> \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Ftwitter.com\u002Fdemo_gpt\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Ftwitter\u002Ffollow\u002Fdemo_gpt?style=social\" alt=\"Twitter 关注\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fdemogpt.medium.com\u002F\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fstatic\u002Fv1?style=for-the-badge&message=Medium&color=000000&logo=Medium&logoColor=FFFFFF&label=\" alt=\"DemoGPT Medium\" height=\"20\"\u002F>\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fwww.producthunt.com\u002Fposts\u002Fdemogpt?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-demogpt\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Fapi.producthunt.com\u002Fwidgets\u002Fembed-image\u002Fv1\u002Ffeatured.svg?post_id=406106&theme=light\" alt=\"DemoGPT - 自动生成式AI应用生成器，基于Llama 2的强大功能 | Product Hunt\" height=\"20\" \u002F>\u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Cp align=\"center\">\n\u003Ca href=\"https:\u002F\u002Fdemogpt.streamlit.app\">\u003Cimg src=\"https:\u002F\u002Fstatic.streamlit.io\u002Fbadges\u002Fstreamlit_badge_black_white.svg\" alt=\"Streamlit 应用程序\">\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fhuggingface.co\u002Fspaces\u002Fmelihunsal\u002Fdemogpt\">\u003Cimg src=\"https:\u002F\u002Fimg.shields.io\u002Fbadge\u002F%F0%9F%A4%97-Spaces-yellow\">\u003C\u002Fa>\n\u003C\u002Fp>\n\n## 📑 目录\n\n- [简介](#-introduction)\n- [架构](#️-architecture)\n- [安装](#-installation)\n- [使用](#-usage)\n  - [软件包版本](#-for-the-package-version)\n  - [Python 接口](#-for-the-python-interface)\n  - [源码版本](#-for-the-source-code-version)\n- [DemoGPT AgentHub](#-demogpt-agenthub)\n  - [安装](#-installation-1)\n  - [创建工具](#-creating-tools)\n  - [可用工具](#-available-tools)\n  - [创建智能体](#-creating-an-agent)\n  - [使用智能体](#-using-an-agent)\n  - [可用智能体类型](#-available-agent-types)\n  - [使用 ReactAgent](#-using-reactagent)\n  - [使用 RAG](#-using-rag)\n  - [将 RAG 与智能体结合](#-combining-rag-with-agents)\n- [待办事项](#to-do-)\n- [贡献](#-contribute)\n- [引用](#-citations)\n- [许可](#-license)\n\n## 🤖 DemoGPT AgentHub\n\nDemoGPT AgentHub 是一个强大的库，可让您使用各种工具创建、定制和使用 AI 智能体。\n\n### 🛠 安装\n\n要使用 DemoGPT AgentHub，只需安装主软件包：\n\n```bash \npip install demogpt\n```\n\n### 🔧 创建工具\n\n创建自定义工具非常简单：\n\n```python\nfrom demogpt_agenthub.tools import BaseTool\nclass MyCustomTool(BaseTool):\n    def __init__(self):\n        self.name = \"MyCustomTool\"\n        self.description = \"这个工具能做些了不起的事！\"\n        super().__init__()\n    def run(self, query):\n        # 在这里实现您的工具功能\n        return f\"结果为：{query}\"\n```\n\n**示例使用：**\n```python\nmy_tool = MyCustomTool()\nagent = ToolCallingAgent(tools=[my_tool], llm=llm, verbose=True)\nagent.run(\"你能用我的自定义工具吗？\")\n```\n\n**示例输出：**\n```\n推理：\n用户要求使用名为 MyCustomTool 的自定义工具。该工具被描述为能“做些了不起的事”，因此我将使用它来处理查询。\n工具调用：\nMyCustomTool\n工具结果：\n结果为：你能用我的自定义工具吗？\n答案：\n是的，我成功地使用了你的自定义工具！该工具处理了你的查询，并返回了以下结果：“结果为：你能用我的自定义工具吗？”\n```\n\n### 🧰 可用工具\n\nDemoGPT AgentHub 提供了多个内置工具：\n\n- 🔍 TavilySearchTool\n- 🌦 WeatherTool\n- 📚 WikipediaTool\n- 🐚 BashTool\n- 🐍 PythonTool\n- 📄 ArxivTool\n- 🎥 YouTubeSearchTool\n- 💻 StackOverFlowTool\n- 🌐 RequestUrlTool\n- 🗃 WikiDataTool\n- 🏥 PubmedTool\n\n### 🤖 创建智能体\n\n要创建智能体：\n\n```python\nfrom demogpt_agenthub.agents import ToolCallingAgent\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.tools import TavilySearchTool, WeatherTool\n\nsearch_tool = TavilySearchTool()\nweather_tool = WeatherTool()\nllm = OpenAIChatModel(model_name=\"gpt-4o-mini\")\nagent = ToolCallingAgent(tools=[search_tool, weather_tool], llm=llm, verbose=True)\n```\n\n### 🎮 使用智能体\n\n创建智能体后，您可以使用它来提问或执行任务：\n\n```python\nquery = \"今天纽约的天气如何？\"\nresponse = agent.run(query)\nprint(response)\n```\n\n**示例输出：**\n\n```\n正在移除现有的向量存储 at rag_chroma\n决策：\nFalse\n推理：\n为了查询今天纽约的天气，我首先需要获取当前的天气信息。获取天气信息后，我可以为您提供当前的天气状况。RAG工具将帮助我找到纽约今天的天气。\n工具调用：\nRAG\n工具参数：\n{'query': '今天纽约的天气'}\n工具结果：\n在纽约，当前天气如下：\n详细状态：晴朗\n风速：2.57 米\u002F秒，风向：240°\n湿度：56%\n温度：\n  - 当前：24.36°C\n  - 最高：25.74°C\n  - 最低：22.05°C\n  - 体感温度：24.46°C\n降雨：{}\n热指数：无\n云量：0%\n答案：\n纽约当前天气为晴朗，气温为24.36°C（体感温度为24.46°C）。湿度为56%，风速为2.57米\u002F秒，风向为240°。云量为0%。\n```\n\n此示例展示了智能体如何：\n1. 通过RAG访问文档信息\n2. 使用Python进行计算\n3. 组合多个工具以回答复杂问题\n\n智能体会：\n1. 使用RAG查找纽约当前天气信息\n2. 使用Python工具计算当前天气状况\n3. 综合以上两部分信息给出完整答案\n\n### 🧰 示例：创建一个简单的数学工具\n\n以下是创建自定义幂运算工具的示例：\n\n```python\nfrom demogpt_agenthub.tools import BaseTool\nclass MyPowerTool(BaseTool):\n    def __init__(self):\n        self.name = \"MyPowerTool\"\n        self.description = \"此工具用于计算一个数的幂\"\n        super().__init__()\n    def run(self, a: int, b: int):\n        # 在这里实现您的工具功能\n        return a**b\n\npower_tool = MyPowerTool()\nagent = ToolCallingAgent(tools=[search_tool, weather_tool, power_tool], llm=llm, verbose=True)\nagent.run(\"34的26次方是多少？\")\n```\n\n**示例输出：**\n```\n推理：\n任务是计算一个数的幂。最适合完成此计算的工具是MyPowerTool，它专门用于幂运算。\n工具调用：\nMyPowerTool\n工具结果：\n6583424253569334549714045134721532297216\n答案：\n34的26次方是6583424253569334549714045134721532297216。\n```\n\n### 🧠 使用 ReactAgent\n\nReactAgent 提供了详细的推理过程：\n\n#### 示例 1：天气与数学计算\n\n```python\nfrom demogpt_agenthub.tools import TavilySearchTool, WeatherTool, PythonTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\n\nsearch_tool = TavilySearchTool()\nweather_tool = WeatherTool()\npython_tool = PythonTool()\n\nagent = ReactAgent(\n    tools=[search_tool, weather_tool, python_tool],\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"),\n    verbose=True\n)\n\nquery = \"克里斯蒂亚诺·罗纳尔多目前效力的国家，那里的天气温度的平方根是多少？\"\nprint(agent.run(query))\n```\n\n**示例输出：**\n```\n决策：\nFalse\n推理：\n首先，我需要确定克里斯蒂亚诺·罗纳尔多目前效力的地点，以便获取当前温度。然后，我将使用 OpenWeatherMap 工具获取温度信息。最后，我将利用 Python Interpreter 工具对温度进行精确计算，求出其平方根。\n工具调用：\nduckduckgo_search\n工具参数：\n{'inp': '克里斯蒂亚诺·罗纳尔多目前效力的地点是哪里？'}\n工具结果：\n罗纳尔多于5月7日首发代表利雅得新月队主场迎战沙特职业联赛领头羊伊蒂哈德队。斯蒂法诺·皮奥利率领的球队上半场以2比0领先，但最终以2比3落败，胡塞姆·阿瓦尔打入制胜球……克里斯蒂亚诺·罗纳尔多和他的利雅得新月队在2023\u002F24赛季遭遇挫折，未能赢得沙特职业联赛或亚足联冠军联赛冠军。继萨迪奥·马内、塞科·福法纳、马塞洛·布罗佐维奇之后……是的，克里斯蒂亚诺·罗纳尔多今晚将首发出场。尽管他们再次无缘亚足联冠军联赛精英赛，但罗纳尔多依然保持乐观，认为他们仍有机会夺冠，尽管落后伊蒂哈德8分。尽管俱乐部本赛季表现不佳，罗纳尔多依旧保持着出色的进球状态，在……克里斯蒂亚诺·罗纳尔多目前效力于沙特职业联赛的利雅得新月队。这位葡萄牙国脚于2022年12月从曼联转会而来，并签下了一份为期两年半的合同……克里斯蒂亚诺·罗纳尔多今天出场吗？克里斯蒂亚诺·罗纳尔多预计将在今天的关键比赛中首发。这位葡萄牙球星依然是利雅得新月队在亚足联冠军联赛中的头号射手，已攻入6球。他出色的状态为球队闯入半决赛发挥了关键作用——如今距离首次自1995年以来进入洲际决赛仅一步之遥，当时……\n决策：\nFalse\n推理：\n我需要使用 OpenWeatherMap 工具获取克里斯蒂亚诺·罗纳尔多所在沙特阿拉伯的当前温度。获取温度后，我将利用 Python Interpreter 工具计算其平方根。\n工具调用：\nopen_weather_map\n工具参数：\n{'city': '利雅得,SA'}\n工具结果：\n在利雅得,SA，当前天气状况如下：\n详细状态：晴朗\n风速：5.44米\u002F秒，风向：150°\n湿度：7%\n温度：\n当前：39.16°C\n最高：39.16°C\n最低：39.16°C\n体感温度：35.82°C\n降雨：{}\n热指数：无\n云量：0%\n决策：\nFalse\n推理：\n我需要计算沙特阿拉伯当前温度的平方根，即39.16°C。我将使用 Python Interpreter 工具进行精确计算。\n工具调用：\nPython Interpreter\n工具参数：\n{'code': 'import math\\nresult = math.sqrt(39.16)\\nprint(result)'}\n工具结果：\n6.257795138864806\n\n决策：\nTrue\n答案：\n克里斯蒂亚诺·罗纳尔多所在沙特阿拉伯的当前温度的平方根约为6.26。\n```\n\n#### 示例 2：图像中的目标检测\n\n```python\nfrom demogpt_agenthub.tools import YoloTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\n\nyolo_tool = YoloTool()\n\nagent = ReactAgent(tools=[yolo_tool], llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), verbose=True)\nquery = \"请给我图片https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg中的物体\"\nprint(agent.run(query))\n```\n\n**示例输出：**\n```\n决策：\nFalse\n推理：\n任务是识别并列出给定图像中的物体。可用的工具“YOLO目标检测”专门为此目的设计，能够分析图像并输出检测到的物体的详细描述。\n工具调用：\nYOLO目标检测\n工具参数：\n{'path': 'https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg'}\n\n已本地找到https:\u002F\u002Fultralytics.com\u002Fimages\u002Fbus.jpg，文件名为bus.jpg\n图像1\u002F1 \u002Fhome\u002Fmelih\u002FDesktop\u002Fprojects\u002FDemoGPT\u002Fbus.jpg: 640x480 4人，1辆巴士，59.1毫秒\n速度：预处理2.0毫秒，推理59.1毫秒，后处理38.9毫秒每张图像，形状为(1, 3, 640, 480)\n工具结果：\n在图像中。\n图像中有1辆巴士，4个人。\n巴士[1]的坐标范围为(3, 229)至(796, 728)。\n第1个人的坐标范围为(671, 394)至(809, 878)。\n第2个人的坐标范围为(47, 399)至(239, 904)。\n第3个人的坐标范围为(223, 408)至(344, 860)。\n第4个人的坐标范围为(0, 556)至(68, 872)。\n\n决策：\nTrue\n答案：\n您提供的图像中检测到了以下物体：\n\n- 1辆巴士\n- 4个人\n\n巴士位于坐标范围(3, 229)至(796, 728)。人物的坐标分别为：\n\n- 第1人：(671, 394)至(809, 878)\n- 第2人：(47, 399)至(239, 904)\n- 第3人：(223, 408)至(344, 860)\n- 第4人：(0, 556)至(68, 872)\n```\n\n这些示例展示了 ReactAgent 如何：\n\n1. 使用多个工具处理复杂的多步骤查询\n2. 利用 YOLO 目标检测执行计算机视觉任务\n3. 展示详细的推理和决策过程\n4. 提供结构化且信息丰富的回答\n\n### 🧮 使用 RAG\n\nBaseRAG 提供了一种简便的方法来实现检索增强生成，支持多种向量存储：\n\n```python\nfrom demogpt_agenthub.rag import BaseRAG\nfrom demogpt_agenthub.llms import OpenAIChatModel\n\n# 初始化RAG系统\nrag = BaseRAG(\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    vectorstore=\"chroma\",  # 支持\"chroma\"、\"pinecone\"、\"faiss\"\n    persistent_path=\"rag_chroma\",  # 向量数据库的存储位置\n    index_name=\"rag_index\",\n    reset_vectorstore=True,  # 是否重置现有向量存储\n    embedding_model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\",  # 或使用OpenAI模型\n    filter={\"search_kwargs\": {\"score_threshold\": 0.5}}\n)\n\n# 添加文档\nrag.add_files([\"~\u002FDownloads\u002FResume.pdf\"])  # 支持PDF、TXT、CSV、JSON\n\n# 查询RAG系统\nresponse = rag.run(\"这个人 GitHub 仓库是什么？\")\nprint(response)\n```\n\n**示例输出：**\n```\n正在移除现有向量存储 at rag_chroma\n此人的 GitHub 仓库名为 DemoGPT，可在 https:\u002F\u002Fgithub.com\u002Fmelih-unsal 查看。\n```\n\n**另一个查询示例：**\n```python\nrag.run(\"GitHub 仓库有多少颗星？\")\n```\n\n**输出：**\n```\nGitHub 仓库有 1.8K 颗星。\n```\n\n这些示例让用户清晰了解：\n1. 运行这些代码块时的预期结果\n2. 输出的格式\n3. 不同智能体和工具的行为方式\n4. ReactAgent 中推理过程的工作原理\n5. RAG 对问题的响应方式\n\n### 🔄 将RAG与智能体结合使用\n\n您还可以在智能体中使用RAG，以实现基于文档的推理。以下是一个示例：\n\n```python\nfrom demogpt_agenthub.tools import PythonTool\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.agents import ReactAgent\nfrom demogpt_agenthub.rag import BaseRAG\n\n# 初始化RAG系统\nrag = BaseRAG(\n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    vectorstore=\"chroma\", \n    persistent_path=\"rag_chroma\", \n    index_name=\"rag_index\",\n    reset_vectorstore=True,\n    embedding_model_name=\"sentence-transformers\u002Fall-mpnet-base-v2\",\n    filter={\"search_kwargs\": {\"score_threshold\": 0.5}}\n)\n\n# 添加您的文档\nrag.add_files([\"~\u002FDownloads\u002FMelih_ÜNSAL_Resume.pdf\"])\n\n# 创建一个带有RAG和其他工具的智能体\npython_tool = PythonTool()\nagent = ReactAgent(\n    tools=[python_tool, rag], \n    llm=OpenAIChatModel(model_name=\"gpt-4o-mini\"), \n    verbose=True\n)\n\n# 使用同时包含RAG和其他工具的智能体\nquery = \"Melih 的 GitHub 仓库的星星数量的平方根是多少？\"\nprint(agent.run(query))\n```\n\n**示例输出：**\n```\n正在移除现有向量存储 at rag_chroma\n决策：\nFalse\n推理：\n要计算 Melih 的 GitHub 仓库星星数量的平方根，我首先需要获取该仓库当前的星星数量。获取到这个数字后，我就可以计算它的平方根了。RAG 工具会帮我找到星星数量，然后我会用 Python 解释器来计算平方根。\n工具调用：\nRAG\n工具参数：\n{'query': 'Melih 的 GitHub 仓库的星星数量'}\n工具结果：\nMelih ÜNSAL 的 GitHub 仓库有 1.8K 颗星。\n决策：\nFalse\n推理：\n我需要计算 1.8K 颗星的平方根，也就是 1800 颗星。为了完成这个计算，我会使用 Python 解释器工具来计算平方根。\n工具调用：\nPython 解释器\n工具参数：\n{'code': 'import math\\nresult = math.sqrt(1800)\\nprint(result)'}\n工具结果：\n42.42640687119285\n\n决策：\nTrue\n答案：\nMelih 的 GitHub 仓库的星星数量（1.8K 或 1800 颗星）的平方根约为 42.43。\n```\n\n这个示例展示了智能体如何：\n1. 通过RAG访问文档信息\n2. 使用Python进行计算\n3. 结合多个工具回答复杂问题\n\n智能体会：\n1. 使用RAG查找关于 GitHub 仓库星星数量的信息\n2. 使用Python工具计算平方根\n3. 综合两部分信息给出完整答案\n\n## 🔥 演示\n\n\n![推文生成器](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_readme_70391129c6ea.gif)\n\n## 📚 文档\n\n请访问我们的文档网站 [这里](https:\u002F\u002Fdocs.demogpt.io\u002F) 获取完整的使用指南和规范说明\n\n⚡ 在 DemoGPT v1.3 版本中，您将在两周内能够借助 **Gorilla** 的强大功能使用 API。\n发布之后，您将可以自主使用外部 API。⚡\n\n## 📦 使用 DemoGPT 包\n\nDemoGPT 包现已上线，可通过 pip 安装。运行以下命令安装包：\n\n```sh\npip install demogpt\n```\n\n要使用 DemoGPT 应用程序，只需在终端输入“demogpt”：\n\n```sh\ndemogpt\n```\n\n\n## 📌 简介\n\n欢迎来到 DemoGPT，这是一项革命性的开源计划，正在重塑基于大型语言模型（LLM）的应用开发格局。\n\nDemoGPT 的核心是 GPT-3.5-turbo 的能力，它驱动 LangChain 代码的自动生成。这一过程由一个复杂的架构所丰富，可将用户指令转化为交互式的 Streamlit 应用程序。\n\n### DemoGPT 的工作原理\n\n1. **规划：** DemoGPT 从用户的指令开始生成一个计划。\n2. **任务创建：** 然后根据计划和指令创建具体任务。\n3. **代码片段生成：** 这些任务被转化为代码片段。\n4. **最终代码组装：** 代码片段组合成最终代码，生成一个交互式 Streamlit 应用程序。\n\n生成的 LangChain 代码不仅仅是一个端点，更是一个变革阶段。它演变成一个用户友好的 Streamlit 应用程序，为所构建的逻辑增添了互动维度。这种蜕变体现了 DemoGPT 对用户参与和体验的承诺。\n\n### 未来增强\n\n我们计划增加一个公开可用的数据库，以便在优化过程中检索相似示例，从而加速生成过程。这项创新将进一步简化开发流程，使其更加高效和灵敏。\n\n### 模型灵活性\n\nDemoGPT 设计灵活，能够使用任何符合特定性能标准的 LLM 模型进行代码生成。这种灵活性确保 DemoGPT 始终处于技术前沿，拥抱 LLM 的新进展。\n\nDemoGPT 的迭代开发过程始终是其创新的核心。每个代码段都经过单独测试，自我优化策略保证了高效且错误最少的工作流程。这种细致测试与优化的融合，正是 DemoGPT 追求卓越的体现。\n\n通过超越传统编码范式，DemoGPT 正在开创基于 LLM 应用的新时代。这不仅仅是代码生成，更是打造智能、互动和包容的解决方案。\n\n总之，DemoGPT 不仅仅是一个项目；它是一种远见卓识的方法，推动着基于 LLM 应用开发的无限可能。\n\n在下个版本中，我们将把 **Gorilla** 集成到 DemoGPT 中，使 DemoGPT 能够自主使用外部 API。未来充满希望，旅程才刚刚开始。加入我们，一起踏上这段激动人心的冒险吧！\n\n\n## ⚙️ 架构\n### DemoGPT 架构\n![DemoGPT 架构](assets\u002Fplan_based_pipeline.png?raw=true \"DemoGPT 架构\")\n\n## 🔧 安装\n\n### 对于包版本\n\n您可以运行以下命令安装 DemoGPT 包：\n\n```sh\npip install demogpt\n```\n\n### 对于源码版本\n\n\n1. 克隆仓库：\n    ```sh\n    git clone https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT.git\n    ```\n2. 进入项目目录：\n    ```sh\n    cd DemoGPT\n    ```\n3. 安装 DemoGPT：\n    ```sh\n    pip install .\n    ```\n\n## 🎮 使用\n\n### 📦 对于软件包版本\n\n安装DemoGPT软件包后，您可以在终端中运行以下命令来使用它：\n\n```sh\ndemogpt\n```\n\n### 🐍 对于Python接口\n\n现在，您可以在Python应用程序中将DemoGPT用作一个库：\n\n```python\nfrom demogpt import DemoGPT\nagent = DemoGPT(model_name=\"gpt-3.5-turbo\")  # 如果环境变量中未设置OPENAI_API_KEY，请通过openai_api_key参数传入\ninstruction = \"您的指令在这里\"\ntitle = \"您的标题在这里\"\ncode = \"\"\nfor phase in agent(instruction=instruction, title=title):\n    print(phase)  # 这将显示每个生成阶段的JSON结果\n    if phase[\"done\"]:\n        code = phase[\"code\"]  # 最终代码\nprint(code)\n```\n\n示例输出（已截断）：\n\n```bash\n# 阶段\n{'stage': 'draft', 'completed': False, 'percentage': 60, ...}\n{'stage': 'draft', 'completed': False, 'percentage': 64, 'code': '#获取源语言 ...'}\n...\n{'stage': 'final', 'completed': True, 'percentage': 100, ... , 'code': 'import streamlit as st\\n...'}\n```\n\n```python\n# 代码\nimport streamlit as st\nfrom langchain.chains import LLMChain\nfrom langchain_community.chat_models import ChatOpenAI\nfrom langchain.prompts.chat import (ChatPromptTemplate,\n                                    HumanMessagePromptTemplate,\n                                    SystemMessagePromptTemplate)\n...\n```\n\n### 🌐 对于源代码版本\n\n如果您已克隆仓库并希望运行源代码版本，可以通过以下命令使用DemoGPT：\n\n```sh\nstreamlit run demogpt\u002Fapp.py\n```\n\n## 待办事项 📝\n- [x] 实现新的DemoGPT流程，包括计划生成、任务创建、代码片段生成和最终代码组装。\n- [x] 添加功能，允许用户选择模型。\n- [x] 定义有用的LangChain任务\n- [x] 发布包含新流程的正式版本，暂不进行优化\n- [ ] 实现剩余的LangChain任务\n- [ ] 实现自优化策略，以优化模型响应。\n- [ ] 集成🦍 Gorilla模型用于API调用。\n- [ ] 添加Rapid API，以扩展可用的API调用。\n- [ ] 添加🦙 Llama2集成\n- [ ] 实现公开可用的数据库，以便在优化过程中检索相似示例，从而加速生成过程。\n- [ ] 将所有成功生成的步骤添加到数据库中，以消除重复优化。\n\n## 🤝 欢迎贡献\n\n我们非常欢迎对DemoGPT项目的贡献！无论是修复Bug、改进文档，还是提出新功能，您的努力都将受到高度赞赏。请在开始任何工作之前查看开放的问题。\n\n> 请阅读[`CONTRIBUTING`](CONTRIBUTING.md)，了解我们的[`行为准则`](CODE_OF_CONDUCT.md），以及向我们提交Pull Request的流程。\n\n## 📄 引用\n\nDemoGPT因其利用自主AI代理进行应用创建的创新方法，已被多篇研究论文引用。以下是引用DemoGPT的论文列表：\n\n- Lei Wang, Chen Ma, Xueyang Feng, Zeyu Zhang, Hao Yang, Jingsen Zhang, Zhiyuan Chen, Jiakai Tang, Xu Chen, Yankai Lin, Wayne Xin, Zhao, Zhewei Wei, Ji-Rong Wen, “基于大型语言模型的自主代理综述”, 2023年。[论文链接](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2308.11432.pdf)\n- Yuan Li, Yixuan Zhang, Lichao Sun, “METAAGENTS：通过协作生成代理模拟人类行为互动，实现基于LLM的任务导向协调”，期刊\u002F会议，2023年。[论文链接](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2310.06500.pdf)\n- Yuheng Cheng, Ceyao Zhang, Zhengwen Zhang, Xiangrui Meng, Sirui Hong, Wenhao Li, Zihao Wang, Zekai Wang, Feng Yin, Junhua Zhao, Xiuqiang He, “探索基于大型语言模型的智能代理：定义、方法与展望”，2024年。[论文链接](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2401.03428.pdf)\n- Mikhail, Poludin. 用于表格数据分析的LLM代理优化：集成LoRA以提升质量。硕士论文。捷克理工大学。计算与信息中心，2024年。[论文链接](https:\u002F\u002Fdspace.cvut.cz\u002Fbitstream\u002Fhandle\u002F10467\u002F115388\u002FF3-DP-2024-Poludin-Mikhail-Optimizing_LLM-Powered_Agents_for_Tabular_Data_Analytics_Integrating_LoRA_for_Enhanced_Quality.pdf?sequence=-1)\n\n学术界的这一认可凸显了DemoGPT在推动AI驱动开发工具领域发展的潜力与实用性。\n\n\n## 📜 许可协议\n\nDemoGPT是一个开源项目，采用[MIT许可证](LICENSE)授权。\n\n---\n\n如有任何问题、疑问或意见，请随时联系我们或打开一个问题。我们非常感谢您的反馈，以使DemoGPT变得更好。","# DemoGPT 快速上手指南\n\n## 环境准备\n\n- **系统要求**：Python 3.8+\n- **前置依赖**：无强制依赖，推荐使用 `pip` 管理包\n- **国内加速建议**：使用清华源加速安装  \n  ```bash\n  pip install demogpt -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n  ```\n\n## 安装步骤\n\n安装主包：\n\n```bash\npip install demogpt\n```\n\n如需使用 AgentHub 功能，无需额外安装，已包含在主包中。\n\n## 基本使用\n\n### 最简示例：创建一个带搜索工具的智能代理\n\n```python\nfrom demogpt_agenthub.agents import ToolCallingAgent\nfrom demogpt_agenthub.llms import OpenAIChatModel\nfrom demogpt_agenthub.tools import TavilySearchTool\n\n# 初始化工具和模型\nsearch_tool = TavilySearchTool()\nllm = OpenAIChatModel(model_name=\"gpt-4o-mini\")\n\n# 创建代理\nagent = ToolCallingAgent(tools=[search_tool], llm=llm, verbose=True)\n\n# 执行查询\nresponse = agent.run(\"今天北京的天气如何？\")\nprint(response)\n```\n\n**输出示例**：  \n代理将自动调用 Tavily 搜索工具，获取并返回北京当前天气信息。\n\n> ✅ 支持自定义工具、RAG、多工具协同，扩展性强，开箱即用。","某中型电商公司的AI工程师团队正在为客服系统开发一个智能问答代理，需整合商品数据库、订单系统和用户历史记录，以自动回答“我的订单为什么延迟？”“如何退换货？”等高频问题。\n\n### 没有 DemoGPT 时\n- 需要手动拼接 LangChain、LlamaIndex、FAISS 和向量数据库，配置复杂，耗时超过两周。\n- 每次调整提示词（prompt）都要重新部署代码，无法快速迭代测试不同话术效果。\n- 缺乏标准化工具库，团队成员各自开发独立工具，导致接口不统一，维护成本高。\n- 知识图谱构建需从零开始设计实体关系，缺乏现成模板，数据清洗耗时占总工作量60%。\n- 没有可视化调试界面，调试代理响应逻辑只能靠日志猜问题，效率极低。\n\n### 使用 DemoGPT 后\n- 一键生成包含 RAG、知识图谱和向量检索的完整代理管道，3天内完成原本两周的任务。\n- 内置提示词模板库支持实时拖拽修改与A\u002FB测试，客服话术优化周期从天级缩短到小时级。\n- 提供预置的订单查询、库存检查、物流追踪等工具模块，直接复用，无需重复造轮子。\n- 内置知识图谱构建向导，自动从商品目录和FAQ中抽取实体与关系，数据准备时间减少70%。\n- 提供交互式Web界面，可实时输入问题查看代理思考路径与数据来源，调试效率提升5倍。\n\nDemoGPT 让非大模型专家的团队也能快速构建生产级AI客服代理，真正实现“从想法到上线，只需几小时”。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002Fmelih-unsal_DemoGPT_70391129.gif","melih-unsal","Melih Ünsal","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002Fmelih-unsal_dc78475c.jpg","Highly skilled and accomplished Deep Learning expert especially in LLMs with 7+ years of experience and 3+ years of technical management experience.",null,"demo_gpt","https:\u002F\u002Fwww.demogpt.io\u002F","https:\u002F\u002Fgithub.com\u002Fmelih-unsal",[84,88],{"name":85,"color":86,"percentage":87},"Python","#3572A5",68.5,{"name":89,"color":90,"percentage":91},"Jupyter Notebook","#DA5B0B",31.5,1888,225,"2026-04-01T17:16:34","MIT","Linux, macOS, Windows","未说明",{"notes":99,"python":97,"dependencies":100},"建议使用 pip 安装 demogpt 包，首次运行可能自动下载大型模型或向量数据库文件，建议确保网络畅通；支持通过 Streamlit 或 Hugging Face Spaces 在线体验，本地部署需自行配置 LLM（如 GPT-4o-mini）API 密钥",[101,102,103,104,105,106,107,108,109,110],"demogpt","langchain","openai","tavily-python","wikipedia","pydantic","streamlit","huggingface-hub","chromadb","sentence-transformers",[53,14,13,26,15],[113,114,102,115,107,116,117,118,119,120,121,103,122,123,124,125,126,127,128,129],"chatgpt","demo","llms","streamlit-application","chatgpt-api","langchain-python","langchain-app","agent","autogpt","ai","python","artificial-intelligence","autonomous-agents","gpt-4","agents","deepseek","o1","2026-03-27T02:49:30.150509","2026-04-06T07:14:11.666189",[133,138,143,148,153,158],{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},9076,"在 Windows 上运行 DemoGPT 时出现 UnicodeEncodeError，如何解决？","在写入临时文件前，显式设置编码为 UTF-8，并在代码开头插入 sys.stdout.reconfigure(encoding='utf-8')。具体修改如下：\n```python\nif \"import sys\" not in code:\n    code = \"import sys\\nsys.stdout.reconfigure(encoding='utf-8')\\n\" + code\n\ntmp = tempfile.NamedTemporaryFile(\"w\", suffix=\".py\", delete=False, encoding=\"utf-8\")\n```","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F20",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},9077,"运行 DemoGPT 时出现 'which python' 返回非零退出状态 1 的错误，如何修复？","该错误是由于 Windows 系统不支持 'which' 命令。项目已更新以兼容 Windows，确保更新到最新代码版本即可自动修复。无需手动修改，直接拉取最新提交即可。","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F4",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},9078,"运行 DemoGPT 时出现 ModuleNotFoundError: No module named 'altair.vegalite.v4'，如何解决？","升级 altair 包至 4.0 或更高版本。执行命令：pip install --upgrade altair>=4.0。该问题由 Streamlit 版本更新导致，升级依赖即可解决。","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F26",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},9079,"如何在项目中统一代码格式以提升可维护性？","项目已集成 black、isort 和 ruff 等代码格式化工具。建议在提交前运行：pip install black isort ruff，然后执行 black .、isort . 和 ruff check --fix 来格式化代码，确保风格一致。","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F10",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},9080,"项目中包含微信二维码，是否为误植？如何处理？","该二维码为误引入，已从仓库中删除。项目代码完全原创，未复制 MetaGPT。如发现类似文件，请删除并提交 PR。维护者已移除 docs\u002Fresources\u002F 中的微信二维码文件。","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F38",{"id":159,"question_zh":160,"answer_zh":161,"source_url":162},9081,"在 Windows 上首次运行 DemoGPT 时提示缺少 dotenv 或 termcolor 模块，如何解决？","请确保已安装 requirements.txt 中的所有依赖。执行命令：pip install -r requirements.txt。若仍缺失模块，手动安装：pip install python-dotenv termcolor。建议在虚拟环境中运行以避免冲突。","https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fissues\u002F3",[164,169,174,179,184,188,193,198,203],{"id":165,"version":166,"summary_zh":167,"released_at":168},106522,"v1.2.6","DemoGPT v1.2.6 🚀 Release Notes\r\n---\r\n\r\n### Overview\r\nWe're back with DemoGPT version 1.2.6, further enhancing our module capabilities and providing significant bug fixes. This release brings a Python module to spawn more generic app ideas, addresses issues in the Document loader and Finalizer modules, and paves the way for Azure-based URLs with OpenAI. Plus, there's an exciting addition for chat model feedback!\r\n\r\n### Python Module for Generic Apps\r\nExpanding our suite of tools, the new Python module allows developers to lean towards more generic app concepts, providing the flexibility to curate and customize as per unique requirements.\r\n\r\n### Document Loader Bug Fixes\r\nHear ye, hear ye! We've squashed some pesky bugs in the Document loader, ensuring a seamless experience when working with your docs.\r\n\r\n### OpenAI Base URL Customization\r\nAzure users, rejoice! You can now input your custom OpenAI base URL. With this feature, Azure-based URLs are seamlessly integrated.\r\n\r\n### Finalizer Module Bug Fixes\r\nWe believe in perfection. And in our stride towards it, the bugs encountered in the Finalizer module have been addressed and fixed.\r\n\r\n### Chat Model Feedback Mechanism\r\nWith the new chat model feedback mechanism, DemoGPT fixes its own bugs during the generation of chat-based applications.\r\n\r\n### Getting Started\r\n- Fetch the latest version of DemoGPT (v1.2.6) from the releases page.\r\n- Dive into our updated documentation for a clearer understanding of all the new goodies.\r\n\r\n### Feedback\r\nYour input shapes our output. Encounter a hiccup or have an enhancement in mind? Open an issue on our GitHub repository. We're all ears and eager to refine further!\r\n","2023-09-28T11:42:05",{"id":170,"version":171,"summary_zh":172,"released_at":173},106523,"v1.2.5","## DemoGPT v1.2.5 🚀 Release Notes\r\n\r\n### Overview\r\n\r\nExciting times ahead! We're delighted to roll out DemoGPT version 1.2.5. This release introduces the ability to generate chat-based applications, streamlines OpenAI API Key integration, and includes several document-related bug fixes.\r\n\r\n### Generate Chat-Based Applications\r\n\r\nWith DemoGPT v1.2.5, you can now generate chat-based applications right from your prompts! Your generated chat applications will include a rich set of features that allow for dynamic, real-time conversations.\r\n\r\n### OpenAI API Key Integration\r\n\r\nThe generated applications will now include a sidebar to input your OpenAI API Key. If you have the key as an environmental variable, you don't need to rewrite it. Otherwise, the generated application expects the key in the sidebar for.\r\n\r\n### Document-Related Bug Fixes\r\n\r\nWe're constantly working to improve our document generation capabilities. This update addresses several document-related bugs to provide a smoother, more accurate documentation experience.\r\n\r\n### Bug Fixes & Improvements\r\n- General performance enhancements and under-the-hood tweaks for a better overall experience.\r\n\r\n### Getting Started\r\n1. Update to the latest version of DemoGPT (v1.2.5) from the releases page.\r\n2. Explore our revised documentation to get an in-depth understanding of these new features.\r\n\r\n### Feedback\r\n\r\nAs always, your feedback is crucial to us. Should you encounter any issues or have any suggestions, don't hesitate to open an issue on our GitHub repository. We're committed to providing you with the best experience possible.\r\n\r\n---\r\n\r\n**Thank you for being an invaluable member of our community. Happy coding! 🌟**\r\n","2023-09-21T06:30:40",{"id":175,"version":176,"summary_zh":177,"released_at":178},106524,"v1.2.4","## DemoGPT v1.2.4 🚨 Release Notes\r\n\r\n### Overview\r\n\r\nWe're thrilled to announce the release of DemoGPT v1.2.4! This new version brings a customization property. \r\n\r\n### Editing The Generated Code\r\n\r\nNow, after you generate the code from your prompt, there is an **Edit** button under the code. Once you press it, you will be able to change the code and play however you like. Once you are done, press **Save & Rerun** button, it will rerender the code and open up the new app.\r\n \r\n### Bug Fixes & Improvements\r\n- As always, we've squashed a few bugs and made some under-the-hood improvements to ensure a smoother experience.\r\n\r\n### Getting Started\r\n1. Update to the latest version of DemoGPT from the releases page.\r\n2. Check out our updated documentation for detailed information on the new features.\r\n\r\n### Feedback\r\nYour feedback is invaluable to us. If you encounter any issues or have suggestions, please open an issue on our GitHub repo. We're always looking to improve and provide you with the best experience.\r\n\r\n---\r\n\r\n**Thanks for being a part of our community! Happy coding! 🚀**\r\n","2023-08-17T13:29:24",{"id":180,"version":181,"summary_zh":182,"released_at":183},106525,"v1.2.3","## DemoGPT v1.2.3 🚨 Release Notes\r\n\r\n### Overview\r\n\r\nWe're thrilled to announce the release of DemoGPT v1.2.3! This new version brings a plethora of enhancements, integrations, and features that will elevate your experience. From quick file translations to a smarter interface, we've got you covered. \r\n\r\n### 🦜 Integrated with LangSmith\r\n- Seamlessly integrate with LangSmith for even better language processing and understanding.\r\n  \r\n### 📚 QA over Docs\r\n- Have a burning question? DemoGPT now supports QA over documents. Just point it to a document, and ask away!\r\n\r\n### 🗂 Quick File Translations \r\n- **Supported Formats**: pptx, csv, pdf, and more.\r\n- Instantly translate documents across multiple languages with high accuracy.\r\n\r\n### 🤖 Speedy Summaries\r\n- Get concise and precise summaries for lengthy documents or texts in seconds.\r\n\r\n### 🐍 Python Interface\r\n- For those who love scripting, we've introduced a Python interface. Connect and interact with DemoGPT directly from your Python scripts.\r\n```python\r\nfrom demogpt import DemoGPT\r\nagent = DemoGPT(model_name=\"gpt-3.5-turbo\") # if OPENAI_API_KEY is not set in env variables, put it with openai_api_key argument\r\ninstruction = \"Your instruction here\"\r\ntitle = \"Your title here\"\r\ncode = \"\"\r\nfor phase in agent(instruction=instruction, title=title):\r\n    print(phase) # this will display the resulting json for each generation stage\r\n    if \"code\" in phase:\r\n        code = phase[\"code\"] # final code\r\nprint(code)\r\n```\r\nExample Output (truncated):\r\n\r\n```bash\r\n# phases\r\n{'stage': 'draft', 'completed': False, 'percentage': 60, ...}\r\n{'stage': 'draft', 'completed': False, 'percentage': 64, 'code': '#Get the source language ...'}\r\n...\r\n{'stage': 'final', 'completed': True, 'percentage': 100, ... , 'code': 'import streamlit as st\\n...'}\r\n```\r\n\r\n```python\r\n# Code\r\nimport streamlit as st\r\nfrom langchain import LLMChain\r\nfrom langchain.chat_models import ChatOpenAI\r\nfrom langchain.prompts.chat import (ChatPromptTemplate,\r\n                                    HumanMessagePromptTemplate,\r\n                                    SystemMessagePromptTemplate)\r\n...\r\n```\r\n\r\n### 🎭 Role Play\r\n- Enhance your chat experiences! DemoGPT can now adapt to different roles, making conversations more engaging and scenario-driven.\r\n\r\n### Bug Fixes & Improvements\r\n- As always, we've squashed a few bugs and made some under-the-hood improvements to ensure a smoother experience.\r\n\r\n### Getting Started\r\n1. Update to the latest version of DemoGPT from the releases page.\r\n2. Check out our updated documentation for detailed information on the new features.\r\n3. \r\n### Feedback\r\nYour feedback is invaluable to us. If you encounter any issues or have suggestions, please open an issue on our GitHub repo. We're always looking to improve and provide you with the best experience.\r\n\r\n---\r\n\r\n**Thanks for being a part of our community! Happy coding! 🚀**\r\n","2023-08-13T19:16:46",{"id":185,"version":186,"summary_zh":79,"released_at":187},106526,"v1.2.1","2023-08-13T19:13:30",{"id":189,"version":190,"summary_zh":191,"released_at":192},106527,"v1.2.0","# What's Changed\r\n\r\n\r\n![plan_based_pipeline](https:\u002F\u002Fgithub.com\u002Fmelih-unsal\u002FDemoGPT\u002Fassets\u002F34304254\u002Fad7e25e8-258f-4d89-9b1e-3d392c224cf1)\r\n\r\n## New DemoGPT Pipeline\r\nThe architecture has been updated to include the following steps:\r\n- **Generates plan from the instruction:** The new pipeline starts by generating a plan based on the given instruction.\r\n- **Generates tasks from the plan and instruction:** Tasks are then generated from the plan and instruction, providing a clear roadmap for the code.\r\n- **Transfers tasks into code snippets:** The tasks are converted into code snippets, making the development process more modular.\r\n- **Combines code snippets into a final code:** Finally, the code snippets are combined to create the final code, streamlining the entire process.\r\n\r\n## Additional Changes\r\n- **Model Selection:** Users can now select models, providing more flexibility and customization.\r\n- **Bug Fixes:** Several bugs have been resolved on Windows OS, enhancing the stability and performance on this platform.\r\n\r\n## Future Release Preview\r\nIn the future release, all the steps will be under control with a self-refining strategy where the model refines its own response for each step. Additionally, all the successfully generated steps will be put into a database. This means that next time, similar ones will be selected, eliminating the need to refine redundantly. This will lead to more efficient code generation and a more streamlined process.\r\n\r\n## Installation and Usage\r\n\r\nFor the current version, the installation remains the same. You can install DemoGPT using the following command:\r\n```bash\r\npip install demogpt\r\n```\r\n### Running the Current Version\r\nTo run the current version, simply use the **demogpt** command:\r\n```bash\r\ndemogpt\r\n```\r\n### Running the Previous Version\r\nIf you want to run the previous version, you can do so by using the **--basic** flag:\r\n```bash\r\ndemogpt --basic\r\n```\r\n","2023-08-05T10:54:28",{"id":194,"version":195,"summary_zh":196,"released_at":197},106528,"v1.1.1","### What's Changed\r\n- Windows-related bugs have been resolved\r\n- Generated code is displayed in the UI.\r\n- Prompt examples have been improved.\r\n- Better version which will generate most of the chains is on the way.","2023-07-18T19:34:37",{"id":199,"version":200,"summary_zh":201,"released_at":202},106529,"v1.1.0","### What's Changed\r\n\r\n- Creates faster application\r\n- Creates more robust application\r\n- Side bar has been added to the app","2023-07-01T08:39:15",{"id":204,"version":205,"summary_zh":206,"released_at":207},106530,"v1.0.0","DemoGPT can process prompt based application ideas by refining its own code.\r\nAt the end, it generates Streamlit application and runs it on the browser.","2023-06-27T09:12:16"]