[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-SylphAI-Inc--AdalFlow":3,"tool-SylphAI-Inc--AdalFlow":62},[4,18,26,36,46,54],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},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,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},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 真正成长为懂上",160784,2,"2026-04-19T11:32:54",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":42,"last_commit_at":43,"category_tags":44,"status":17},8272,"opencode","anomalyco\u002Fopencode","OpenCode 是一款开源的 AI 编程助手（Coding Agent），旨在像一位智能搭档一样融入您的开发流程。它不仅仅是一个代码补全插件，而是一个能够理解项目上下文、自主规划任务并执行复杂编码操作的智能体。无论是生成全新功能、重构现有代码，还是排查难以定位的 Bug，OpenCode 都能通过自然语言交互高效完成，显著减少开发者在重复性劳动和上下文切换上的时间消耗。\n\n这款工具专为软件开发者、工程师及技术研究人员设计，特别适合希望利用大模型能力来提升编码效率、加速原型开发或处理遗留代码维护的专业人群。其核心亮点在于完全开源的架构，这意味着用户可以审查代码逻辑、自定义行为策略，甚至私有化部署以保障数据安全，彻底打破了传统闭源 AI 助手的“黑盒”限制。\n\n在技术体验上，OpenCode 提供了灵活的终端界面（Terminal UI）和正在测试中的桌面应用程序，支持 macOS、Windows 及 Linux 全平台。它兼容多种包管理工具，安装便捷，并能无缝集成到现有的开发环境中。无论您是追求极致控制权的资深极客，还是渴望提升产出的独立开发者，OpenCode 都提供了一个透明、可信",144296,1,"2026-04-16T14:50:03",[13,45],"插件",{"id":47,"name":48,"github_repo":49,"description_zh":50,"stars":51,"difficulty_score":32,"last_commit_at":52,"category_tags":53,"status":17},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 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",109154,"2026-04-18T11:18:24",[14,15,13],{"id":55,"name":56,"github_repo":57,"description_zh":58,"stars":59,"difficulty_score":32,"last_commit_at":60,"category_tags":61,"status":17},6121,"gemini-cli","google-gemini\u002Fgemini-cli","gemini-cli 是一款由谷歌推出的开源 AI 命令行工具，它将强大的 Gemini 大模型能力直接集成到用户的终端环境中。对于习惯在命令行工作的开发者而言，它提供了一条从输入提示词到获取模型响应的最短路径，无需切换窗口即可享受智能辅助。\n\n这款工具主要解决了开发过程中频繁上下文切换的痛点，让用户能在熟悉的终端界面内直接完成代码理解、生成、调试以及自动化运维任务。无论是查询大型代码库、根据草图生成应用，还是执行复杂的 Git 操作，gemini-cli 都能通过自然语言指令高效处理。\n\n它特别适合广大软件工程师、DevOps 人员及技术研究人员使用。其核心亮点包括支持高达 100 万 token 的超长上下文窗口，具备出色的逻辑推理能力；内置 Google 搜索、文件操作及 Shell 命令执行等实用工具；更独特的是，它支持 MCP（模型上下文协议），允许用户灵活扩展自定义集成，连接如图像生成等外部能力。此外，个人谷歌账号即可享受免费的额度支持，且项目基于 Apache 2.0 协议完全开源，是提升终端工作效率的理想助手。",100752,"2026-04-10T01:20:03",[45,13,15,14],{"id":63,"github_repo":64,"name":65,"description_en":66,"description_zh":67,"ai_summary_zh":68,"readme_en":69,"readme_zh":70,"quickstart_zh":71,"use_case_zh":72,"hero_image_url":73,"owner_login":74,"owner_name":75,"owner_avatar_url":76,"owner_bio":77,"owner_company":78,"owner_location":78,"owner_email":78,"owner_twitter":78,"owner_website":79,"owner_url":80,"languages":81,"stars":93,"forks":94,"last_commit_at":95,"license":96,"difficulty_score":32,"env_os":97,"env_gpu":97,"env_ram":97,"env_deps":98,"category_tags":102,"github_topics":104,"view_count":32,"oss_zip_url":78,"oss_zip_packed_at":78,"status":17,"created_at":125,"updated_at":126,"faqs":127,"releases":158},9849,"SylphAI-Inc\u002FAdalFlow","AdalFlow","AdalFlow: The library to build & auto-optimize LLM applications.","AdalFlow 是一款专为构建和优化大语言模型（LLM）应用而设计的开源库。它的核心理念是像 PyTorch 构建深度学习模型一样，让开发者能够以模块化、可组合的方式轻松搭建从聊天机器人、检索增强生成（RAG）到智能代理等各类 LM 工作流。\n\n传统开发中，调整提示词（Prompt）往往依赖人工反复试错，效率低下且难以保证最优效果。AdalFlow 通过引入统一的自动微分框架，彻底改变了这一现状。它支持零样本和少样本提示的自动优化，凭借独有的\"LLM-AutoDiff\"和“学会推理”技术，能在无需人工干预的情况下自动寻找最佳提示策略，显著提升应用准确率。此外，它还内置了轻量级的人类反馈回路和追踪功能，无需额外配置即可实现复杂交互。\n\n借助其模型无关的架构，用户仅需修改配置文件，就能将应用无缝切换至不同的后端大模型，极大地提升了开发的灵活性与可维护性。\n\nAdalFlow 非常适合 AI 研究人员、软件工程师以及希望深入掌握大模型应用开发的产品团队使用。无论是想要快速验证想法的研究者，还是致力于构建生产级智能应用的开发者，都能通过 AdalFlow 获得高效、透明且强大的开发体验，真正","AdalFlow 是一款专为构建和优化大语言模型（LLM）应用而设计的开源库。它的核心理念是像 PyTorch 构建深度学习模型一样，让开发者能够以模块化、可组合的方式轻松搭建从聊天机器人、检索增强生成（RAG）到智能代理等各类 LM 工作流。\n\n传统开发中，调整提示词（Prompt）往往依赖人工反复试错，效率低下且难以保证最优效果。AdalFlow 通过引入统一的自动微分框架，彻底改变了这一现状。它支持零样本和少样本提示的自动优化，凭借独有的\"LLM-AutoDiff\"和“学会推理”技术，能在无需人工干预的情况下自动寻找最佳提示策略，显著提升应用准确率。此外，它还内置了轻量级的人类反馈回路和追踪功能，无需额外配置即可实现复杂交互。\n\n借助其模型无关的架构，用户仅需修改配置文件，就能将应用无缝切换至不同的后端大模型，极大地提升了开发的灵活性与可维护性。\n\nAdalFlow 非常适合 AI 研究人员、软件工程师以及希望深入掌握大模型应用开发的产品团队使用。无论是想要快速验证想法的研究者，还是致力于构建生产级智能应用的开发者，都能通过 AdalFlow 获得高效、透明且强大的开发体验，真正以\"AI 的方式”来学习和构建 AI 系统。","\n\u003C!-- \u003Ch4 align=\"center\">\n    \u003Cimg alt=\"AdalFlow logo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_470b2f0f49b9.png\" style=\"width: 100%;\">\n\u003C\u002Fh4> -->\n\n\n\n\n\n\u003Ch2>\n    \u003Cp align=\"center\">\n     ⚡ AdalFlow is a PyTorch-like library to build and auto-optimize any LM workflows, from Chatbots, RAG,  to Agents. ⚡\n    \u003C\u002Fp>\n\u003C\u002Fh2>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fsylph.ai\">\u003Cimg src=\"docs\u002Fsource\u002F_static\u002Fimages\u002Fadal-face-logo.svg\" alt=\"AdaL\" height=\"100\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fsylph.ai\">\u003Cimg src=\"docs\u002Fsource\u002F_static\u002Fimages\u002Fadal-text-logo.svg\" alt=\"AdaL CLI\" height=\"100\">\u003C\u002Fa>\n    \u003Cbr>\u003Cbr>\n    \u003Cstrong>AdalFlow proudly powers \u003Ca href=\"https:\u002F\u002Fsylph.ai\">AdaL CLI\u003C\u002Fa>\u003C\u002Fstrong> — The AI coding agent\n\u003C\u002Fp>\n\n\n\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1_YnD4HshzPRARvishoU4IA-qQuX9jHrT?usp=sharing\">\n        \u003Cimg alt=\"Try Quickstart in Colab\" src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Ch4 align=\"center\">\n    \u003Cp>\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002F\">View Documentation\u003C\u002Fa>\n        \u003C!-- \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html\">Models\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.retriever.html\">Retrievers\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.agent.html\">Agents\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fevaluation.html\"> LLM evaluation\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fuse_cases\u002Fquestion_answering.html\">Trainer & Optimizers\u003C\u002Fa> -->\n    \u003Cp>\n\u003C\u002Fh4>\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI Version\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fadalflow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI Downloads\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_4e1e644c0621.png\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI Downloads\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_4e1e644c0621.png\u002Fmonth\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#SylphAI-Inc\u002FAdalFlow\">\n        \u003Cimg alt=\"GitHub stars\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FSylphAI-Inc\u002FAdalFlow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\">\n        \u003Cimg alt=\"Open Issues\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues-raw\u002FSylphAI-Inc\u002FAdalFlow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicense\u002FMIT\">\n        \u003Cimg alt=\"License\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FSylphAI-Inc\u002FAdalFlow\">\n    \u003C\u002Fa>\n      \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FezzszrRZvT\">\n        \u003Cimg alt=\"discord-invite\" src=\"https:\u002F\u002Fdcbadge.limes.pink\u002Fapi\u002Fserver\u002FezzszrRZvT?style=flat\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C!-- \u003Ch4>\n\u003Cp align=\"center\">\nFor AI researchers, product teams, and software engineers who want to learn the AI way.\n\u003C\u002Fp>\n\u003C\u002Fh4> -->\n\n\u003C!-- \u003Ch4>\n\u003Cp align=\"center\">\nAdalFlow is a PyTorch-like library to build and auto-optimize any LM workflows, from Chatbots, RAG,  to Agents.\n\u003C\u002Fp>\n\u003C\u002Fh4> -->\n\n\n\n\n\u003C!-- \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1PPxYEBa6eu__LquGoFFJZkhYgWVYE6kh?usp=sharing\">\n        \u003Cimg alt=\"Try Quickstart in Colab\" src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\">\n    \u003C\u002Fa> -->\n\n\u003C!-- \u003Ca href=\"https:\u002F\u002Fpypistats.org\u002Fpackages\u002Flightrag\">\n\u003Cimg alt=\"PyPI Downloads\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002FlightRAG?style=flat-square\">\n\u003C\u002Fa> -->\n\n# Why AdalFlow\n\n1. **100% Open-source Agents SDK**: Lightweight and requires no additional API to setup ``Human-in-the-Loop`` and ``Tracing`` Functionalities.\n2. **Say goodbye to manual prompting**: AdalFlow provides a unified auto-differentiative framework for both zero-shot optimization and few-shot prompt optimization. Our research, ``LLM-AutoDiff`` and ``Learn-to-Reason Few-shot In Context Learning``, achieve the highest accuracy among all auto-prompt optimization libraries.\n3. **Switch your LLM app to any model via a config**:  AdalFlow provides `Model-agnostic` building blocks for LLM task pipelines, ranging from RAG, Agents to classical NLP tasks.\n\n\u003C!-- \u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b4d99c517ec5.png\" style=\"width: 80%;\" alt=\"AdalFlow Auto-optimization\">\n\u003C\u002Fp> -->\n\n\u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b616b49fe3cc.png\" alt=\"AdalFlow Optimized Prompt\" style=\"width: 80%;\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_2c2673cf0732.png\" alt=\"AdalFlow MLflow Integration\" style=\"width: 80%;\">\n\u003C\u002Fp>\n\n\u003C!-- Among all libraries, AdalFlow achieved the highest accuracy with manual prompting (starting at 82%) and the highest accuracy after optimization. -->\n\u003C!-- \u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b616b49fe3cc.png\" alt=\"AdalFlow Optimized Prompt\" style=\"width: 80%;\">\n\u003C\u002Fp> -->\n\nView [Documentation](https:\u002F\u002Fadalflow.sylph.ai)\n\n\n# Quick Start\n\n\nInstall AdalFlow with pip:\n\n```bash\npip install adalflow\n```\n\n## Hello World Agent Example\n\n```python\nfrom adalflow import Agent, Runner\nfrom adalflow.components.model_client.openai_client import OpenAIClient\nfrom adalflow.core.types import (\n    ToolCallActivityRunItem, \n    RunItemStreamEvent,\n    ToolCallRunItem,\n    ToolOutputRunItem,\n    FinalOutputItem\n)\nimport asyncio\n\n# Define tools\ndef calculator(expression: str) -> str:\n    \"\"\"Evaluate a mathematical expression.\"\"\"\n    try:\n        result = eval(expression)\n        return f\"The result of {expression} is {result}\"\n    except Exception as e:\n        return f\"Error: {e}\"\n\nasync def web_search(query: str=\"what is the weather in SF today?\") -> str:\n    \"\"\"Web search on query.\"\"\"\n    await asyncio.sleep(0.5)\n    return \"San Francisco will be mostly cloudy today with some afternoon sun, reaching about 67 °F (20 °C).\"\n\ndef counter(limit: int):\n    \"\"\"A counter that counts up to a limit.\"\"\"\n    final_output = []\n    for i in range(1, limit + 1):\n        stream_item = f\"Count: {i}\u002F{limit}\"\n        final_output.append(stream_item)\n        yield ToolCallActivityRunItem(data=stream_item)\n    yield final_output\n\n# Create agent with tools\nagent = Agent(\n    name=\"MyAgent\",\n    tools=[calculator, web_search, counter],\n    model_client=OpenAIClient(),\n    model_kwargs={\"model\": \"gpt-4o\", \"temperature\": 0.3},\n    max_steps=5\n)\n\nrunner = Runner(agent=agent)\n```\n\n### 1. Synchronous Call Mode\n\n```python\n# Sync call - returns RunnerResult with complete execution history\nresult = runner.call(\n    prompt_kwargs={\"input_str\": \"Calculate 15 * 7 + 23 and count to 5\"}\n)\n\nprint(result.answer)\n# Output: The result of 15 * 7 + 23 is 128. The counter counted up to 5: 1, 2, 3, 4, 5.\n\n# Access step history\nfor step in result.step_history:\n    print(f\"Step {step.step}: {step.function.name} -> {step.observation}\")\n# Output:\n# Step 0: calculator -> The result of 15 * 7 + 23 is 128\n# Step 1: counter -> ['Count: 1\u002F5', 'Count: 2\u002F5', 'Count: 3\u002F5', 'Count: 4\u002F5', 'Count: 5\u002F5']\n```\n\n### 2. Asynchronous Call Mode\n\n```python\n# Async call - similar output structure to sync call\nresult = await runner.acall(\n    prompt_kwargs={\"input_str\": \"What's the weather in SF and calculate 42 * 3\"}\n)\n\nprint(result.answer)\n# Output: San Francisco will be mostly cloudy today with some afternoon sun, reaching about 67 °F (20 °C). \n#         The result of 42 * 3 is 126.\n```\n\n### 3. Async Streaming Mode\n\n```python\n# Async streaming - real-time event processing\nstreaming_result = runner.astream(\n    prompt_kwargs={\"input_str\": \"Calculate 100 + 50 and count to 3\"},\n)\n\n# Process streaming events in real-time\nasync for event in streaming_result.stream_events():\n    if isinstance(event, RunItemStreamEvent):\n        if isinstance(event.item, ToolCallRunItem):\n            print(f\"🔧 Calling: {event.item.data.name}\")\n        elif isinstance(event.item, ToolCallActivityRunItem):\n            print(f\"📝 Activity: {event.item.data}\")\n        elif isinstance(event.item, ToolOutputRunItem):\n            print(f\"✅ Output: {event.item.data.output}\")\n        elif isinstance(event.item, FinalOutputItem):\n            print(f\"🎯 Final: {event.item.data.answer}\")\n\n# Output:\n# 🔧 Calling: calculator\n# ✅ Output: The result of 100 + 50 is 150\n# 🔧 Calling: counter\n# 📝 Activity: Count: 1\u002F3\n# 📝 Activity: Count: 2\u002F3\n# 📝 Activity: Count: 3\u002F3\n# ✅ Output: ['Count: 1\u002F3', 'Count: 2\u002F3', 'Count: 3\u002F3']\n# 🎯 Final: The result of 100 + 50 is 150. Counted to 3 successfully.\n```\n\n_Set your `OPENAI_API_KEY` environment variable to run these examples._\n\n**Try the full Agent tutorial in Colab:** [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fnotebooks\u002Fagents\u002Fagent_tutorial.ipynb)\n\n\u003C!-- Please refer to the [full installation guide](https:\u002F\u002Fadalflow.sylph.ai\u002Fget_started\u002Finstallation.html) for more details.\n[Package changelog](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fadalflow\u002FCHANGELOG.md). -->\nView [Quickstart](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1_YnD4HshzPRARvishoU4IA-qQuX9jHrT?usp=sharing): Learn How `AdalFlow` optimizes LM workflows end-to-end in 15 mins.\n\nGo to [Documentation](https:\u002F\u002Fadalflow.sylph.ai) for tracing, human-in-the-loop, and more.\n\n\n\u003C!-- * Try the [Building Quickstart](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1TKw_JHE42Z_AWo8UuRYZCO2iuMgyslTZ?usp=sharing) in Colab to see how AdalFlow can build the task pipeline, including Chatbot, RAG, agent, and structured output.\n* Try the [Optimization Quickstart](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fnotebooks\u002Fqas\u002Fadalflow_object_count_auto_optimization.ipynb) to see how AdalFlow can optimize the task pipeline. -->\n\n\n\n# Research\n[Sep 2025] [LAD-VF: LLM-Automatic Differentiation Enables Fine-Tuning-Free Robot Planning from Formal Methods Feedback](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2509.18384)\n- Fine-tuning-free robot planning using LLM auto-differentiation\n- Integration of formal methods feedback for robot control\n\n[Jan 2025] [Auto-Differentiating Any LLM Workflow: A Farewell to Manual Prompting](https:\u002F\u002Farxiv.org\u002Fabs\u002F2501.16673)\n- LLM Applications as auto-differentiation graphs\n- Token-efficient and better performance than DsPy\n\n[Dec 2025] [Scaling Textual Gradients via Sampling-Based Momentum](https:\u002F\u002Farxiv.org\u002Fabs\u002F2506.00400)\n- Stable, scalable prompt optimization using momentum-weighted textual gradient\n- Gumbel-Top-k sampling improves exploration and integrates seamlessly with TextGrad, DSPy-COPRO, and AdalFlow\n\n\n\n# Auto-Prompt Optimization Ecosystem\n\nAdalFlow is part of a growing ecosystem of libraries that automatically optimize LLM prompts and workflows. Here's how the landscape looks:\n\n| Library | Approach | Key Idea |\n|---------|----------|----------|\n| **[AdalFlow](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow)** | PyTorch-style auto-differentiation | LLM workflows as auto-diff graphs; unified textual gradient descent + few-shot bootstrap optimization in one training loop |\n| **[DSPy](https:\u002F\u002Fgithub.com\u002Fstanfordnlp\u002Fdspy)** | Declarative programming | Write compositional Python code instead of prompts; compiler optimizes prompts and weights automatically |\n| **[Agent Lightning](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-lightning)** | Framework-agnostic agent trainer | Turn any agent (LangChain, OpenAI SDK, AutoGen, etc.) into an optimizable entity with minimal code changes; supports RL, auto-prompt optimization, and supervised fine-tuning |\n| **[TextGrad](https:\u002F\u002Fgithub.com\u002Fzou-group\u002Ftextgrad)** | Textual gradient descent | Automatic differentiation via text; uses LLM feedback as gradients to optimize prompts, code, and solutions |\n\n**Where AdalFlow fits:** AdalFlow draws inspiration from all of the above (see [Acknowledgements](#acknowledgements)) and unifies them into a single PyTorch-like framework. You get textual gradients (à la TextGrad), few-shot bootstrap (à la DSPy), and instruction history — all composable within `Parameter`, `Generator`, `AdalComponent`, and `Trainer`.\n\n# Collaborations\n\nWe work closely with the [**VITA Group** at University of Texas at Austin](https:\u002F\u002Fvita-group.github.io\u002F), under the leadership of [Dr. Atlas Wang](https:\u002F\u002Fwww.ece.utexas.edu\u002Fpeople\u002Ffaculty\u002Fatlas-wang) and in collaboration with [Dr. Junyuan Hong](https:\u002F\u002Fjyhong.gitlab.io\u002F), who provides valuable support in driving project initiatives.\n\n \u003C!-- alongside [Dr. Junyuan Hong](https:\u002F\u002Fjyhong.gitlab.io\u002F),  -->\nFor collaboration, contact [Li Yin](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fli-yin-ai\u002F).\n\n# Hiring\n\nWe are looking for a Dev Rel to help us build the community and support our users. If you are interested, please contact [Li Yin](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fli-yin-ai\u002F).\n\n\n\n\u003C!-- ## Light, Modular, and Model-Agnostic Task Pipeline\n\nLLMs are like water; AdalFlow help you quickly shape them into any applications, from GenAI applications such as chatbots, translation, summarization, code generation, RAG, and autonomous agents to classical NLP tasks like text classification and named entity recognition.\n\nAdalFlow has two fundamental, but powerful, base classes: `Component` for the pipeline and `DataClass` for data interaction with LLMs.\nThe result is a library with minimal abstraction, providing developers with *maximum customizability*.\n\nYou have full control over the prompt template, the model you use, and the output parsing for your task pipeline.\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_c8d6f0023caf.png\" alt=\"AdalFlow Task Pipeline\">\n\u003C\u002Fp>\n\nMany providers and models accessible via the same interface:\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_5736351622b6.png\" alt=\"AdalFlow Model Providers\">\n\u003C\u002Fp>\n\n[All available model providers](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html)\n\n\n\n\nFurther reading: [How We Started](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fli-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop),[Design Philosophy](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Flightrag_design_philosophy.html) and [Class hierarchy](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fclass_hierarchy.html).\n\n\n\n## Unified Framework for Auto-Optimization\n\n\nTo optimize your pipeline, simply define a ``Parameter`` and pass it to AdalFlow's ``Generator``.\nYou use `PROMPT` for prompt tuning via textual gradient descent and `DEMO` for few-shot demonstrations.\nWe let you **diagnose**, **visualize**, **debug**, and **train** your pipeline.\n\n\n### **Trainable Task Pipeline**\n\nJust define it as a ``Parameter`` and pass it to AdalFlow's ``Generator``.\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_cc988915d68a.png\" alt=\"AdalFlow Trainable Task Pipeline\">\n\u003C\u002Fp>\n\n### **AdalComponent & Trainer**\n\n``AdalComponent`` acts as the 'interpreter'  between task pipeline and the trainer, defining training and validation steps, optimizers, evaluators, loss functions, backward engine for textual gradients or tracing the demonstrations, the teacher generator.\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_956bca6cc70a.png\" alt=\"AdalFlow AdalComponent & Trainer\">\n\n\u003C\u002Fp>\n -->\n\n\n# Documentation\n\nAdalFlow full documentation available at [adalflow.sylph.ai](https:\u002F\u002Fadalflow.sylph.ai\u002F):\n\u003C!-- - [How We Started](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fli-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop)\n- [Introduction](https:\u002F\u002Fadalflow.sylph.ai\u002F)\n- [Full installation guide](https:\u002F\u002Fadalflow.sylph.ai\u002Fget_started\u002Finstallation.html)\n- [Design philosophy](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Flightrag_design_philosophy.html)\n- [Class hierarchy](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fclass_hierarchy.html)\n- [Tutorials](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Findex.html)\n- [Supported Models](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html)\n- [Supported Retrievers](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.retriever.html)\n- [API reference](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Findex.html) -->\n\n\n# AdalFlow: A Tribute to Ada Lovelace\n\n\nAdalFlow is named in honor of [Ada Lovelace](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAda_Lovelace), the pioneering female mathematician who first recognized that machines could go beyond mere calculations. As a team led by a female founder, we aim to inspire more women to pursue careers in AI.\n\n# Community & Contributors\n\nThe AdalFlow is a community-driven project, and we welcome everyone to join us in building the future of LLM applications.\n\nJoin our [Discord](https:\u002F\u002Fdiscord.gg\u002FezzszrRZvT) community to ask questions, share your projects, and get updates on AdalFlow.\n\nTo contribute, please read our [Contributor Guide](https:\u002F\u002Fadalflow.sylph.ai\u002Fcontributor\u002Findex.html).\n\n# Contributors\n\n[![contributors](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_427acaf8f43a.png)](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fgraphs\u002Fcontributors)\n\n# Acknowledgements\n\nMany existing works greatly inspired AdalFlow library! Here is a non-exhaustive list:\n\n- 📚 [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch\u002F) for design philosophy and design pattern of ``Component``, ``Parameter``, ``Sequential``.\n- 📚 [Micrograd](https:\u002F\u002Fgithub.com\u002Fkarpathy\u002Fmicrograd): A tiny autograd engine for our auto-differentiative architecture.\n- 📚 [Text-Grad](https:\u002F\u002Fgithub.com\u002Fzou-group\u002Ftextgrad) for the ``Textual Gradient Descent`` text optimizer.\n- 📚 [DSPy](https:\u002F\u002Fgithub.com\u002Fstanfordnlp\u002Fdspy) for inspiring the ``__{input\u002Foutput}__fields`` in our ``DataClass`` and the bootstrap few-shot optimizer.\n- 📚 [OPRO](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fopro) for adding past text instructions along with its accuracy in the text optimizer.\n- 📚 [PyTorch Lightning](https:\u002F\u002Fgithub.com\u002FLightning-AI\u002Fpytorch-lightning) for the ``AdalComponent`` and ``Trainer``.\n\n\u003C!-- # Citation\n\n```bibtex\n\n@software{Yin2024AdalFlow,\n  author = {Li Yin},\n  title = {{AdalFlow: The Library for Large Language Model (LLM) Applications}},\n  month = {7},\n  year = {2024},\n  doi = {10.5281\u002Fzenodo.12639531},\n  url = {https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow}\n}\n``` -->\n\n\u003C!-- # Star History\n\n[![Star History Chart](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_666d5d122ef2.png)](https:\u002F\u002Fstar-history.com\u002F#SylphAI-Inc\u002FAdalFlow&Date) -->\n\u003C!--\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F11559\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_34d606db08fc.png\" alt=\"SylphAI-Inc%2FAdalFlow | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa> -->\n","\u003C!-- \u003Ch4 align=\"center\">\n    \u003Cimg alt=\"AdalFlow logo\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_470b2f0f49b9.png\" style=\"width: 100%;\">\n\u003C\u002Fh4> -->\n\n\n\n\n\n\u003Ch2>\n    \u003Cp align=\"center\">\n     ⚡ AdalFlow 是一个类似 PyTorch 的库，用于构建和自动优化任何语言模型工作流，从聊天机器人、RAG 到智能体。⚡\n    \u003C\u002Fp>\n\u003C\u002Fh2>\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fsylph.ai\">\u003Cimg src=\"docs\u002Fsource\u002F_static\u002Fimages\u002Fadal-face-logo.svg\" alt=\"AdaL\" height=\"100\">\u003C\u002Fa>&nbsp;\n    \u003Ca href=\"https:\u002F\u002Fsylph.ai\">\u003Cimg src=\"docs\u002Fsource\u002F_static\u002Fimages\u002Fadal-text-logo.svg\" alt=\"AdaL CLI\" height=\"100\">\u003C\u002Fa>\n    \u003Cbr>\u003Cbr>\n    \u003Cstrong>AdalFlow 自豪地为 \u003Ca href=\"https:\u002F\u002Fsylph.ai\">AdaL CLI\u003C\u002Fa> 提供支持\u003C\u002Fstrong> — 这是一款 AI 编码助手\n\u003C\u002Fp>\n\n\n\n\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1_YnD4HshzPRARvishoU4IA-qQuX9jHrT?usp=sharing\">\n        \u003Cimg alt=\"在 Colab 中尝试快速入门\" src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003Ch4 align=\"center\">\n    \u003Cp>\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002F\">查看文档\u003C\u002Fa>\n        \u003C!-- \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html\">模型\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.retriever.html\">检索器\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.agent.html\">智能体\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fevaluation.html\">LLM 评估\u003C\u002Fa> |\n        \u003Ca href=\"https:\u002F\u002Fadalflow.sylph.ai\u002Fuse_cases\u002Fquestion_answering.html\">训练器与优化器\u003C\u002Fa> -->\n    \u003Cp>\n\u003C\u002Fh4>\n\u003Cp align=\"center\">\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI 版本\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fv\u002Fadalflow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI 下载量\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_4e1e644c0621.png\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fpypi.org\u002Fproject\u002Fadalflow\u002F\">\n        \u003Cimg alt=\"PyPI 下载量\" src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_4e1e644c0621.png\u002Fmonth\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fstar-history.com\u002F#SylphAI-Inc\u002FAdalFlow\">\n        \u003Cimg alt=\"GitHub 星标\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fstars\u002FSylphAI-Inc\u002FAdalFlow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\">\n        \u003Cimg alt=\"未解决问题数\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Fissues-raw\u002FSylphAI-Inc\u002FAdalFlow?style=flat-square\">\n    \u003C\u002Fa>\n    \u003Ca href=\"https:\u002F\u002Fopensource.org\u002Flicense\u002FMIT\">\n        \u003Cimg alt=\"许可证\" src=\"https:\u002F\u002Fimg.shields.io\u002Fgithub\u002Flicense\u002FSylphAI-Inc\u002FAdalFlow\">\n    \u003C\u002Fa>\n      \u003Ca href=\"https:\u002F\u002Fdiscord.gg\u002FezzszrRZvT\">\n        \u003Cimg alt=\"Discord 邀请\" src=\"https:\u002F\u002Fdcbadge.limes.pink\u002Fapi\u002Fserver\u002FezzszrRZvT?style=flat\">\n    \u003C\u002Fa>\n\u003C\u002Fp>\n\n\u003C!-- \u003Ch4>\n\u003Cp align=\"center\">\n面向希望学习 AI 技术的 AI 研究人员、产品团队和软件工程师。\n\u003C\u002Fp>\n\u003C\u002Fh4> -->\n\n\u003C!-- \u003Ch4>\n\u003Cp align=\"center\">\nAdalFlow 是一个类似 PyTorch 的库，用于构建和自动优化任何语言模型工作流，从聊天机器人、RAG 到智能体。\n\u003C\u002Fp>\n\u003C\u002Fh4> -->\n\n\n\n\n\u003C!-- \u003Ca href=\"https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1PPxYEBa6eu__LquGoFFJZkhYgWVYE6kh?usp=sharing\">\n        \u003Cimg alt=\"在 Colab 中尝试快速入门\" src=\"https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg\">\n    \u003C\u002Fa> -->\n\n\u003C!-- \u003Ca href=\"https:\u002F\u002Fpypistats.org\u002Fpackages\u002Flightrag\">\n\u003Cimg alt=\"PyPI 下载量\" src=\"https:\u002F\u002Fimg.shields.io\u002Fpypi\u002Fdm\u002FlightRAG?style=flat-square\">\n\u003C\u002Fa> -->\n\n# 为什么选择 AdalFlow\n\n1. **100% 开源的智能体 SDK**：轻量级，无需额外 API 即可设置“人工参与”和“追踪”功能。\n2. **告别手动提示**：AdalFlow 提供统一的自动微分框架，适用于零样本优化和少样本提示优化。我们的研究“LLM-AutoDiff”和“Learn-to-Reason 少样本上下文学习”在所有自动提示优化库中实现了最高的准确率。\n3. **通过配置即可切换 LLM 应用中的任何模型**：AdalFlow 为 LLM 任务流水线提供了“模型无关”的构建模块，涵盖 RAG、智能体以及经典 NLP 任务。\n\n\u003C!-- \u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b4d99c517ec5.png\" style=\"width: 80%;\" alt=\"AdalFlow 自动优化\">\n\u003C\u002Fp> -->\n\n\u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b616b49fe3cc.png\" alt=\"AdalFlow 优化后的提示\" style=\"width: 80%;\">\n\u003C\u002Fp>\n\n\u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_2c2673cf0732.png\" alt=\"AdalFlow 与 MLflow 集成\" style=\"width: 80%;\">\n\u003C\u002Fp>\n\n\u003C!-- 在所有库中，AdalFlow 在手动提示时达到了最高准确率（起始为 82%），并在优化后也取得了最高准确率。 -->\n\u003C!-- \u003Cp align=\"center\" style=\"background-color: #f0f0f0;\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_b616b49fe3cc.png\" alt=\"AdalFlow 优化后的提示\" style=\"width: 80%;\">\n\u003C\u002Fp> -->\n\n查看 [文档](https:\u002F\u002Fadalflow.sylph.ai)\n\n\n# 快速入门\n\n\n使用 pip 安装 AdalFlow：\n\n```bash\npip install adalflow\n```\n\n## Hello World 智能体示例\n\n```python\nfrom adalflow import Agent, Runner\nfrom adalflow.components.model_client.openai_client import OpenAIClient\nfrom adalflow.core.types import (\n    ToolCallActivityRunItem, \n    RunItemStreamEvent,\n    ToolCallRunItem,\n    ToolOutputRunItem,\n    FinalOutputItem\n)\nimport asyncio\n\n# 定义工具\ndef calculator(expression: str) -> str:\n    \"\"\"计算数学表达式的结果\"\"\"\n    try:\n        result = eval(expression)\n        return f\"表达式 {expression} 的结果是 {result}\"\n    except Exception as e:\n        return f\"错误：{e}\"\n\nasync def web_search(query: str=\"今天旧金山的天气如何？\") -> str:\n    \"\"\"根据查询进行网络搜索\"\"\"\n    await asyncio.sleep(0.5)\n    return \"旧金山今天多云，下午会有阳光，气温约 67°F（20°C）。\"\n\ndef counter(limit: int):\n    \"\"\"一个计数器，可以计数到指定上限\"\"\"\n    final_output = []\n    for i in range(1, limit + 1):\n        stream_item = f\"计数：{i}\u002F{limit}\"\n        final_output.append(stream_item)\n        yield ToolCallActivityRunItem(data=stream_item)\n    yield final_output\n\n# 创建带有工具的智能体\nagent = Agent(\n    name=\"MyAgent\",\n    tools=[calculator、web_search、counter],\n    model_client=OpenAIClient(),\n    model_kwargs={\"model\": \"gpt-4o\", \"temperature\": 0.3},\n    max_steps=5\n)\n\nrunner = Runner(agent=agent)\n```\n\n### 1. 同步调用模式\n\n```python\n# 同步调用 - 返回包含完整执行历史的 RunnerResult\nresult = runner.call(\n    prompt_kwargs={\"input_str\": \"计算 15 * 7 + 23，并计数到 5\"}\n)\n\nprint(result.answer)\n# 输出：表达式 15 * 7 + 23 的结果是 128。计数器已计数到 5：1、2、3、4、5。\n\n# 访问步骤历史\nfor step in result.step_history:\n    print(f\"Step {step.step}: {step.function.name} -> {step.observation}\")\n# 输出：\n# Step 0: calculator -> 15 * 7 + 23 的结果是 128\n# Step 1: counter -> ['Count: 1\u002F5', 'Count: 2\u002F5', 'Count: 3\u002F5', 'Count: 4\u002F5', 'Count: 5\u002F5']\n```\n\n### 2. 异步调用模式\n\n```python\n# 异步调用 - 输出结构与同步调用类似\nresult = await runner.acall(\n    prompt_kwargs={\"input_str\": \"旧金山的天气如何？并计算 42 * 3\"}\n)\n\nprint(result.answer)\n# 输出：今天旧金山多云，午后会有阳光，气温约 67°F（20°C）。\n#       42 * 3 的结果是 126。\n```\n\n### 3. 异步流式处理模式\n\n```python\n# 异步流式处理 - 实时事件处理\nstreaming_result = runner.astream(\n    prompt_kwargs={\"input_str\": \"计算 100 + 50，并数到 3\"},\n)\n\n# 实时处理流式事件\nasync for event in streaming_result.stream_events():\n    if isinstance(event, RunItemStreamEvent):\n        if isinstance(event.item, ToolCallRunItem):\n            print(f\"🔧 调用：{event.item.data.name}\")\n        elif isinstance(event.item, ToolCallActivityRunItem):\n            print(f\"📝 活动：{event.item.data}\")\n        elif isinstance(event.item, ToolOutputRunItem):\n            print(f\"✅ 输出：{event.item.data.output}\")\n        elif isinstance(event.item, FinalOutputItem):\n            print(f\"🎯 最终结果：{event.item.data.answer}\")\n\n# 输出：\n# 🔧 调用：calculator\n# ✅ 输出：100 + 50 的结果是 150\n# 🔧 调用：counter\n# 📝 活动：Count: 1\u002F3\n# 📝 活动：Count: 2\u002F3\n# 📝 活动：Count: 3\u002F3\n# ✅ 输出：['Count: 1\u002F3', 'Count: 2\u002F3', 'Count: 3\u002F3']\n# 🎯 最终结果：100 + 50 的结果是 150。已成功数到 3。\n```\n\n请设置你的 `OPENAI_API_KEY` 环境变量以运行这些示例。\n\n**在 Colab 中尝试完整的 Agent 教程：** [![Open In Colab](https:\u002F\u002Fcolab.research.google.com\u002Fassets\u002Fcolab-badge.svg)](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fnotebooks\u002Fagents\u002Fagent_tutorial.ipynb)\n\n\u003C!-- 请参阅[完整安装指南](https:\u002F\u002Fadalflow.sylph.ai\u002Fget_started\u002Finstallation.html)以获取更多详细信息。\n[软件包变更日志](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fadalflow\u002FCHANGELOG.md)。 -->\n查看[快速入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1_YnD4HshzPRARvishoU4IA-qQuX9jHrT?usp=sharing)：了解如何在 15 分钟内使用 `AdalFlow` 对 LM 工作流进行端到端优化。\n\n前往[文档](https:\u002F\u002Fadalflow.sylph.ai)了解更多关于追踪、人机协作等功能的信息。\n\n\n\u003C!-- * 在 Colab 中尝试[构建快速入门](https:\u002F\u002Fcolab.research.google.com\u002Fdrive\u002F1TKw_JHE42Z_AWo8UuRYZCO2iuMgyslTZ?usp=sharing)，了解 AdalFlow 如何构建任务管道，包括聊天机器人、RAG、代理和结构化输出。\n* 尝试[优化快速入门](https:\u002F\u002Fcolab.research.google.com\u002Fgithub\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fnotebooks\u002Fqas\u002Fadalflow_object_count_auto_optimization.ipynb)，看看 AdalFlow 如何优化任务管道。 -->\n\n\n\n# 研究\n[2025年9月] [LAD-VF：LLM 自动微分实现无需微调的机器人规划——基于形式方法反馈](https:\u002F\u002Farxiv.org\u002Fpdf\u002F2509.18384)\n- 使用 LLM 自动微分实现无需微调的机器人规划\n- 集成形式方法反馈用于机器人控制\n\n[2025年1月] [自动微分任意 LLM 工作流：告别手动提示](https:\u002F\u002Farxiv.org\u002Fabs\u002F2501.16673)\n- 将 LLM 应用视为自动微分图\n- 比 DsPy 更加节省 token 且性能更优\n\n[2025年12月] [通过采样式动量扩展文本梯度](https:\u002F\u002Farxiv.org\u002Fabs\u002F2506.00400)\n- 利用动量加权文本梯度实现稳定且可扩展的提示优化\n- Gumbel-Top-k 采样提高了探索能力，并能无缝集成 TextGrad、DSPy-COPRO 和 AdalFlow\n\n\n\n# 自动提示优化生态系统\n\nAdalFlow 是一个不断发展的库生态系统的一部分，该生态系统能够自动优化 LLM 提示和工作流。以下是当前的生态格局：\n\n| 库 | 方法 | 核心理念 |\n|---------|----------|----------|\n| **[AdalFlow](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow)** | 类似 PyTorch 的自动微分 | 将 LLM 工作流视为自动微分图；将文本梯度下降与少量样本引导优化统一在一个训练循环中 |\n| **[DSPy](https:\u002F\u002Fgithub.com\u002Fstanfordnlp\u002Fdspy)** | 声明式编程 | 使用组合式的 Python 代码代替提示；编译器会自动优化提示和权重 |\n| **[Agent Lightning](https:\u002F\u002Fgithub.com\u002Fmicrosoft\u002Fagent-lightning)** | 框架无关的代理训练器 | 可以将任何代理（LangChain、OpenAI SDK、AutoGen 等）转化为可优化的对象，只需极少的代码改动；支持强化学习、自动提示优化和监督微调 |\n| **[TextGrad](https:\u002F\u002Fgithub.com\u002Fzou-group\u002Ftextgrad)** | 文本梯度下降 | 通过文本实现自动微分；利用 LLM 的反馈作为梯度来优化提示、代码和解决方案 |\n\n**AdalFlow 的定位：** AdalFlow 借鉴了上述所有方法（详见[致谢](#acknowledgements)），并将它们整合进一个类似 PyTorch 的框架中。你可以获得类似于 TextGrad 的文本梯度、类似于 DSPy 的少量样本引导，以及指令历史——所有这些都可以在 `Parameter`、`Generator`、`AdalComponent` 和 `Trainer` 中进行组合。\n\n# 合作伙伴\n\n我们与德克萨斯大学奥斯汀分校的[**VITA 团队**](https:\u002F\u002Fvita-group.github.io\u002F)密切合作，在[王阿特拉斯博士](https:\u002F\u002Fwww.ece.utexas.edu\u002Fpeople\u002Ffaculty\u002Fatlas-wang)的领导下，并与[洪俊元博士](https:\u002F\u002Fjyhong.gitlab.io\u002F)合作，他在推动项目进展方面提供了宝贵的支持。\n\n \u003C!-- alongside [Dr. Junyuan Hong](https:\u002F\u002Fjyhong.gitlab.io\u002F),  -->\n如需合作，请联系[李音](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fli-yin-ai\u002F)。\n\n# 招聘\n\n我们正在寻找一位开发者关系专员，帮助我们构建社区并支持我们的用户。如果您感兴趣，请联系 [Li Yin](https:\u002F\u002Fwww.linkedin.com\u002Fin\u002Fli-yin-ai\u002F)。\n\n\n\n\u003C!-- ## 轻量、模块化且模型无关的任务流水线\n\nLLM 就像水一样；AdalFlow 可以帮助您快速将其塑造成各种应用，从聊天机器人、翻译、摘要生成、代码生成、RAG 和自主代理等生成式 AI 应用，到文本分类和命名实体识别等经典 NLP 任务。\n\nAdalFlow 拥有两个基础但强大的基类：用于流水线的 `Component` 和用于与 LLM 进行数据交互的 `DataClass`。\n其结果是一个抽象程度极低的库，为开发者提供了*最大的可定制性*。\n\n您可以完全控制提示模板、所使用的模型以及任务流水线的输出解析。\n\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_c8d6f0023caf.png\" alt=\"AdalFlow 任务流水线\">\n\u003C\u002Fp>\n\n许多提供商和模型可以通过相同的接口访问：\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_5736351622b6.png\" alt=\"AdalFlow 模型提供商\">\n\u003C\u002Fp>\n\n[所有可用的模型提供商](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html)\n\n\n\n\n进一步阅读：[我们的起步](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fli-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop),[设计哲学](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Flightrag_design_philosophy.html) 和 [类层次结构](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fclass_hierarchy.html)。\n\n\n\n## 自动优化的统一框架\n\n\n要优化您的流水线，只需定义一个 ``Parameter`` 并将其传递给 AdalFlow 的 ``Generator``。\n您可以使用 `PROMPT` 通过文本梯度下降进行提示调优，使用 `DEMO` 进行少样本演示。\n我们让您能够**诊断**、**可视化**、**调试**和**训练**您的流水线。\n\n\n### **可训练的任务流水线**\n\n只需将其定义为 ``Parameter`` 并传递给 AdalFlow 的 ``Generator``。\n\n\u003Cp align=\"center\">\n  \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_cc988915d68a.png\" alt=\"AdalFlow 可训练的任务流水线\">\n\u003C\u002Fp>\n\n### **AdalComponent & 训练器**\n\n``AdalComponent`` 充当任务流水线与训练器之间的“解释器”，定义训练和验证步骤、优化器、评估器、损失函数、用于文本梯度的反向引擎或演示跟踪机制，以及教师生成器。\n\n\u003Cp align=\"center\">\n    \u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_956bca6cc70a.png\" alt=\"AdalFlow AdalComponent & 训练器\">\n\n\u003C\u002Fp>\n -->\n\n\n# 文档\n\nAdalFlow 的完整文档可在 [adalflow.sylph.ai](https:\u002F\u002Fadalflow.sylph.ai\u002F) 上找到：\n\u003C!-- - [我们的起步](https:\u002F\u002Fwww.linkedin.com\u002Fposts\u002Fli-yin-ai_both-ai-research-and-engineering-use-pytorch-activity-7189366364694892544-Uk1U?utm_source=share&utm_medium=member_desktop)\n- [简介](https:\u002F\u002Fadalflow.sylph.ai\u002F)\n- [完整安装指南](https:\u002F\u002Fadalflow.sylph.ai\u002Fget_started\u002Finstallation.html)\n- [设计哲学](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Flightrag_design_philosophy.html)\n- [类层次结构](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Fclass_hierarchy.html)\n- [教程](https:\u002F\u002Fadalflow.sylph.ai\u002Ftutorials\u002Findex.html)\n- [支持的模型](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.model_client.html)\n- [支持的检索器](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Fcomponents\u002Fcomponents.retriever.html)\n- [API 参考](https:\u002F\u002Fadalflow.sylph.ai\u002Fapis\u002Findex.html) -->\n\n\n# AdalFlow：致敬艾达·洛夫莱斯\n\n\nAdalFlow 以[艾达·洛夫莱斯](https:\u002F\u002Fen.wikipedia.org\u002Fwiki\u002FAda_Lovelace)的名字命名，她是首位认识到机器可以超越单纯计算的女性数学家。作为一支由女性创始人领导的团队，我们希望激励更多女性投身于人工智能领域。\n\n# 社区与贡献者\n\nAdalFlow 是一个社区驱动的项目，我们欢迎所有人加入我们，共同构建 LLM 应用的未来。\n\n加入我们的 [Discord](https:\u002F\u002Fdiscord.gg\u002FezzszrRZvT) 社区，提出问题、分享您的项目，并获取 AdalFlow 的最新动态。\n\n如需贡献，请阅读我们的 [贡献者指南](https:\u002F\u002Fadalflow.sylph.ai\u002Fcontributor\u002Findex.html)。\n\n# 贡献者\n\n[![contributors](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_427acaf8f43a.png)](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fgraphs\u002Fcontributors)\n\n# 致谢\n\n许多现有工作极大地启发了 AdalFlow 库！以下是一个不完全列表：\n\n- 📚 [PyTorch](https:\u002F\u002Fgithub.com\u002Fpytorch\u002Fpytorch\u002F) 为 ``Component``、``Parameter``、``Sequential`` 的设计哲学和设计模式提供了灵感。\n- 📚 [Micrograd](https:\u002F\u002Fgithub.com\u002Fkarpathy\u002Fmicrograd)：为我们自动微分架构提供了一个小型自动微分引擎。\n- 📚 [Text-Grad](https:\u002F\u002Fgithub.com\u002Fzou-group\u002Ftextgrad) 为我们提供了 ``文本梯度下降`` 文本优化器。\n- 📚 [DSPy](https:\u002F\u002Fgithub.com\u002Fstanfordnlp\u002Fdspy) 启发了我们在 ``DataClass`` 中的 ``__{input\u002Foutput}__fields`` 以及自举式少样本优化器。\n- 📚 [OPRO](https:\u002F\u002Fgithub.com\u002Fgoogle-deepmind\u002Fopro) 在文本优化器中加入了过往的文本指令及其准确性。\n- 📚 [PyTorch Lightning](https:\u002F\u002Fgithub.com\u002FLightning-AI\u002Fpytorch-lightning) 为 ``AdalComponent`` 和 ``Trainer`` 提供了参考。\n\n\u003C!-- # 引用\n\n```bibtex\n\n@software{Yin2024AdalFlow,\n  author = {Li Yin},\n  title = {{AdalFlow: 大型语言模型 (LLM) 应用程序库}},\n  month = {7},\n  year = {2024},\n  doi = {10.5281\u002Fzenodo.12639531},\n  url = {https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow}\n}\n``` -->\n\n\u003C!-- # 星标历史\n\n[![星标历史图表](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_666d5d122ef2.png)](https:\u002F\u002Fstar-history.com\u002F#SylphAI-Inc\u002FAdalFlow&Date) -->\n\u003C!--\n\u003Ca href=\"https:\u002F\u002Ftrendshift.io\u002Frepositories\u002F11559\" target=\"_blank\">\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_readme_34d606db08fc.png\" alt=\"SylphAI-Inc%2FAdalFlow | Trendshift\" style=\"width: 250px; height: 55px;\" width=\"250\" height=\"55\"\u002F>\u003C\u002Fa> -->","# AdalFlow 快速上手指南\n\nAdalFlow 是一个类 PyTorch 的库，用于构建和自动优化任何大语言模型（LM）工作流，涵盖聊天机器人、RAG（检索增强生成）到智能体（Agents）。其核心特色是支持**自动微分提示优化**，无需手动调整 Prompt 即可提升任务准确率。\n\n## 环境准备\n\n*   **系统要求**：支持 Linux、macOS 和 Windows。\n*   **Python 版本**：建议 Python 3.9 或更高版本。\n*   **前置依赖**：\n    *   需要拥有 OpenAI API Key（或其他兼容模型的 API Key）。\n    *   确保网络环境可以访问 PyPI 和 OpenAI API。\n\n## 安装步骤\n\n使用 pip 进行安装。国内用户推荐使用清华或阿里镜像源以加速下载：\n\n```bash\n# 使用默认源安装\npip install adalflow\n\n# 或使用国内镜像源加速安装\npip install adalflow -i https:\u002F\u002Fpypi.tuna.tsinghua.edu.cn\u002Fsimple\n```\n\n## 基本使用\n\n以下是一个最简单的“你好世界”智能体示例，展示了如何定义工具、创建智能体并运行同步调用。\n\n### 1. 配置环境变量\n\n在运行代码前，请确保在终端中设置好您的 API Key：\n\n```bash\nexport OPENAI_API_KEY=\"your-api-key-here\"\n```\n\n### 2. 代码示例\n\n创建一个 Python 文件（例如 `hello_agent.py`），填入以下代码：\n\n```python\nfrom adalflow import Agent, Runner\nfrom adalflow.components.model_client.openai_client import OpenAIClient\nimport asyncio\n\n# 1. 定义工具函数\ndef calculator(expression: str) -> str:\n    \"\"\"Evaluate a mathematical expression.\"\"\"\n    try:\n        result = eval(expression)\n        return f\"The result of {expression} is {result}\"\n    except Exception as e:\n        return f\"Error: {e}\"\n\n# 2. 创建智能体\nagent = Agent(\n    name=\"MyAgent\",\n    tools=[calculator],  # 注册计算器工具\n    model_client=OpenAIClient(),\n    model_kwargs={\"model\": \"gpt-4o\", \"temperature\": 0.3},\n    max_steps=5\n)\n\n# 3. 初始化运行器\nrunner = Runner(agent=agent)\n\n# 4. 同步调用执行任务\nresult = runner.call(\n    prompt_kwargs={\"input_str\": \"Calculate 15 * 7 + 23\"}\n)\n\n# 5. 输出结果\nprint(result.answer)\n\n# (可选) 查看执行步骤历史\nfor step in result.step_history:\n    print(f\"Step {step.step}: {step.function.name} -> {step.observation}\")\n```\n\n### 3. 运行结果\n\n执行脚本后，您将看到类似以下的输出，表明智能体已成功调用工具并返回结果：\n\n```text\nThe result of 15 * 7 + 23 is 128\nStep 0: calculator -> The result of 15 * 7 + 23 is 128\n```\n\n> **提示**：AdalFlow 还支持异步调用 (`acall`) 和流式输出 (`astream`) 模式，适用于更复杂的实时交互场景。更多高级用法（如 RAG 构建、自动提示优化）请参考官方文档或 Colab 教程。","某电商初创团队正在开发一款能根据用户评论自动优化商品详情页描述的 AI 助手，旨在提升转化率。\n\n### 没有 AdalFlow 时\n- **提示词调优靠“猜”**：开发人员只能凭经验手动反复修改 Prompt 模板，耗时数天却难以找到最优解，且缺乏科学依据。\n- **模型切换成本高昂**：当需要测试不同大模型（如从 GPT-4 切换到开源 Llama 3）时，必须重写大量底层代码来适配不同的 API 格式。\n- **缺乏自动化评估闭环**：无法量化评估生成内容的质量，只能依赖人工抽检，导致迭代周期长，难以发现细微的性能下降。\n- **调试过程黑盒化**：遇到生成结果不佳时，缺乏内置的追踪机制，难以定位是检索环节出错还是推理逻辑偏差。\n\n### 使用 AdalFlow 后\n- **自动微分优化提示词**：利用 AdalFlow 独有的 `LLM-AutoDiff` 技术，系统能基于反馈数据自动迭代优化 Few-shot 示例和指令，将准确率提升至行业领先水平。\n- **配置化一键切换模型**：通过简单的配置文件即可在 PyTorch 风格的流水线中无缝切换任意大模型，无需改动核心业务逻辑代码。\n- **内置可量化的评估体系**：直接调用库中的评估组件，对生成结果进行自动化打分和对比，让每次迭代的效果提升清晰可见。\n- **原生支持全链路追踪**：借助轻量级的原生追踪功能，开发者能快速定位工作流中的具体故障点，大幅缩短调试时间。\n\nAdalFlow 将原本依靠人工直觉的“玄学”调优过程，转变为可量化、自动化的科学工程流程，极大加速了高质量 LLM 应用的落地。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FSylphAI-Inc_AdalFlow_b4d99c51.png","SylphAI-Inc","SylphAI","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FSylphAI-Inc_e30a06cd.jpg","The world's best coding agent!",null,"https:\u002F\u002Fadal.ml","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc",[82,86,90],{"name":83,"color":84,"percentage":85},"Python","#3572A5",99.9,{"name":87,"color":88,"percentage":89},"Makefile","#427819",0,{"name":91,"color":92,"percentage":89},"Shell","#89e051",4109,368,"2026-04-19T08:31:22","MIT","未说明",{"notes":99,"python":97,"dependencies":100},"该工具是一个类似 PyTorch 的库，用于构建和优化大语言模型（LLM）工作流。安装方式为 pip install adalflow。运行示例代码需要配置 OPENAI_API_KEY 环境变量以调用 OpenAI 模型。文档中未明确列出具体的操作系统、GPU、内存或 Python 版本要求，也未列出除自身包以外的底层依赖库（如 torch 等），推测其依赖可能随包自动安装或对运行环境无特殊硬件强制要求（主要依赖云端 API）。",[101],"adalflow",[35,15,13,103,14],"其他",[105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124],"agent","framework","llm","rag","generative-ai","machine-learning","nlp","python","retriever","ai","chatbot","information-retrieval","question-answering","summarization","bm25","faiss","reranker","optimizer","trainer","auto-prompting","2026-03-27T02:49:30.150509","2026-04-20T07:17:56.576458",[128,133,138,143,148,153],{"id":129,"question_zh":130,"answer_zh":131,"source_url":132},44222,"如何在 AdalFlow 中配置自定义的 OpenAI API 端点（base_url）？","AdalFlow 不支持像 DSPy 那样的全局配置，你需要在初始化 OpenAI 客户端时直接传入自定义参数。确保使用支持 `base_url` 参数的新版 OpenAI 客户端。示例代码如下：\n\n```python\nimport adalflow\n# 初始化时传入 custom base_url 和 api_key\nclient = adalflow.OpenAI(\n    model='gpt-4o',\n    api_key='your_bearer_token',\n    base_url='https:\u002F\u002Fllm.prod.xxx.com',\n    temperature=0,\n    max_tokens=1000\n)\n```\n如果遇到 `module 'adalflow' has no attribute 'OpenAI'` 错误，请确保已安装最新版本的 adalflow (`pip install -U adalflow`)。","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F190",{"id":134,"question_zh":135,"answer_zh":136,"source_url":137},44223,"运行 RAG 教程笔记本时报错 `TypeError: LocalDB.register_transformer() takes 1 positional argument but 4 were given` 如何解决？","这是一个已知的问题，通常是因为教程笔记本代码未适配最新的 AdalFlow API 变更（参数变为关键字参数或签名改变）。\n解决方案：\n1. 尝试更新到最新版本：`pip install -U adalflow`。\n2. 检查并修改调用 `db.transform` 或 `register_transformer` 的代码，确保参数传递方式符合最新文档（通常需要将位置参数改为关键字参数）。\n3. 参考已修复该问题的 PR (#376) 或等待笔记本官方更新。维护者已确认该问题正在修复中，旧版笔记本中的 `prepare_database_with_index` 函数可能需要手动调整参数传递方式。","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F381",{"id":139,"question_zh":140,"answer_zh":141,"source_url":142},44224,"AdalFlow 是否支持集成 LiteLLM 以访问更多模型？","目前官方暂不计划集成 LiteLLM。维护者表示，为了提供更好的开发者体验（Developer Experience），AdalFlow 选择直接单独集成各个主流推理提供商，而不是通过 LiteLLM 这样的中间层。因此，建议直接使用 AdalFlow 原生支持的模型客户端。","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F269",{"id":144,"question_zh":145,"answer_zh":146,"source_url":147},44225,"教程中仍然引用旧名称 `lightrag` 而不是 `adalflow`，在哪里可以找到更新后的教程？","维护者已确认需要更新相关教程和 Colab 笔记本。受影响的资源包括 Prompt 和 Agent 相关的 Colab 链接。请关注 GitHub Issue #194 获取最新的更新指南和修正后的 Colab 笔记本链接。在此之前，请手动将代码中的 `lightrag` 替换为 `adalflow`。","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F191",{"id":149,"question_zh":150,"answer_zh":151,"source_url":152},44226,"如何在使用 Mistral 模型时实现异步调用（async call）？","可以通过包装同步客户端来实现异步调用。利用 `asyncio.to_thread` 将同步的 API 调用放入线程中执行。示例代码如下：\n\n```python\nimport asyncio\nfrom typing import Dict\n\n# 定义异步包装方法\nasync def acall(self, api_kwargs: Dict = {}):\n    response = await asyncio.to_thread(self.call, api_kwargs)\n    return response\n\n# 使用示例\nasync def example():\n    client = MistralClient()\n    response = await client.acall(\n        {\"prompt\": \"Hello!\"},\n        model_type=ModelType.LLM\n    )\n    return response\n```","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F286",{"id":154,"question_zh":155,"answer_zh":156,"source_url":157},44227,"损失函数（Loss Function）报错 `acc_score_list should only contain 0 and 1`，是否支持 0 到 1 之间的浮点数？","该限制在旧版本中存在，但在新版本的更新中已经修复。现在应该支持更灵活的评分范围。如果您仍遇到此错误，请确保已将 AdalFlow 升级到最新版本 (`pip install -U adalflow`) 后重试。","https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fissues\u002F311",[159,164,169,174,179,184,189],{"id":160,"version":161,"summary_zh":162,"released_at":163},351811,"v1.1.3","## AdalFlow v1.1.3\n\n详情请参阅 [CHANGELOG.md](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fadalflow\u002FCHANGELOG.md)。\n","2025-09-25T03:25:26",{"id":165,"version":166,"summary_zh":167,"released_at":168},351812,"v1.1.2","## AdalFlow 1.1.2\n\n详情请参阅 [CHANGELOG.md](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fadalflow\u002FCHANGELOG.md)。","2025-08-16T22:25:12",{"id":170,"version":171,"summary_zh":172,"released_at":173},351813,"v1.1.1","## AdalFlow v1.1.1\n\n详情请参阅 [CHANGELOG.md](https:\u002F\u002Fgithub.com\u002FSylphAI-Inc\u002FAdalFlow\u002Fblob\u002Fmain\u002Fadalflow\u002FCHANGELOG.md)。","2025-08-10T04:31:52",{"id":175,"version":176,"summary_zh":177,"released_at":178},351814,"v1.0.5a1","添加代理、运行器、MCP 工具，并修改生成器输出。","2025-07-17T23:36:43",{"id":180,"version":181,"summary_zh":182,"released_at":183},351815,"v0.1.0.beta.1","请遵循 changelog.md 文件。","2024-07-15T19:08:33",{"id":185,"version":186,"summary_zh":187,"released_at":188},351816,"v0.0.0-alpha-8","首次公开发布前\r\n测试","2024-07-03T16:34:52",{"id":190,"version":191,"summary_zh":192,"released_at":193},351817,"v0.0.0-alpha","这是预发布Alpha版本测试。","2024-07-02T04:12:59"]