autogen

2025-12-11 0 987

重要的是:这是官方项目。我们不隶属于任何叉子或启动。请参阅我们的陈述。

autogen

autogen是创建可以自主行动或与人一起工作的多代理AI应用程序的框架。

安装

autogen需要Python 3.10或更高版本

autogen –ext[openai]\”\”>

 # Install AgentChat and OpenAI client from Extensions
pip install -U \" autogen -agentchat \" \" autogen -ext[openai] \"

当前稳定版本为v0.4。如果您正在从autogen V0.2升级,请参阅《迁移指南》,以获取有关如何更新代码和配置的详细说明。

autogen Studio for no-code GUI
pip install -U \” autogen studio\”\”>

 # Install autogen Studio for no-code GUI
pip install -U \" autogen studio \" 

Quickstart

你好世界

使用OpenAI的GPT-4O模型创建助理代理。请参阅其他支持的模型。

autogen_agentchat.agents import AssistantAgent
from autogen _ext.models.openai import OpenAIChatCompletionClient

async def main() -> None:
model_client = OpenAIChatCompletionClient(model=\”gpt-4o\”)
agent = AssistantAgent(\”assistant\”, model_client=model_client)
print(await agent.run(task=\”Say \’Hello World!\’\”))
await model_client.close()

asyncio.run(main())\”>

 import asyncio
from autogen _agentchat . agents import AssistantAgent
from autogen _ext . models . openai import OpenAIChatCompletionClient

async def main () -> None :
    model_client = OpenAIChatCompletionClient ( model = \"gpt-4o\" )
    agent = AssistantAgent ( \"assistant\" , model_client = model_client )
    print ( await agent . run ( task = \"Say \'Hello World!\'\" ))
    await model_client . close ()

asyncio . run ( main ())

网络浏览代理团队

使用网络冲浪者代理和用于Web浏览任务的用户代理代理创建组聊天团队。您需要安装剧作家。

autogen -ext[openai,web-surfer]
# playwright install
import asyncio
from autogen _agentchat.agents import UserProxyAgent
from autogen _agentchat.conditions import TextMentionTermination
from autogen _agentchat.teams import RoundRobinGroupChat
from autogen _agentchat.ui import Console
from autogen _ext.models.openai import OpenAIChatCompletionClient
from autogen _ext.agents.web_surfer import MultimodalWebSurfer

async def main() -> None:
model_client = OpenAIChatCompletionClient(model=\”gpt-4o\”)
# The web surfer will open a Chromium browser window to perform web browsing tasks.
web_surfer = MultimodalWebSurfer(\”web_surfer\”, model_client, headless=False, animate_actions=True)
# The user proxy agent is used to get user input after each step of the web surfer.
# NOTE: you can skip input by pressing Enter.
user_proxy = UserProxyAgent(\”user_proxy\”)
# The termination condition is set to end the conversation when the user types \’exit\’.
termination = TextMentionTermination(\”exit\”, sources=[\”user_proxy\”])
# Web surfer and user proxy take turns in a round-robin fashion.
team = RoundRobinGroupChat([web_surfer, user_proxy], termination_condition=termination)
try:
# Start the team and wait for it to terminate.
await Console(team.run_stream(task=\”Find information about autogen and write a short summary.\”))
finally:
await web_surfer.close()
await model_client.close()

asyncio.run(main())\”>

 # pip install -U autogen -agentchat autogen -ext[openai,web-surfer]
# playwright install
import asyncio
from autogen _agentchat . agents import UserProxyAgent
from autogen _agentchat . conditions import TextMentionTermination
from autogen _agentchat . teams import RoundRobinGroupChat
from autogen _agentchat . ui import Console
from autogen _ext . models . openai import OpenAIChatCompletionClient
from autogen _ext . agents . web_surfer import MultimodalWebSurfer

async def main () -> None :
    model_client = OpenAIChatCompletionClient ( model = \"gpt-4o\" )
    # The web surfer will open a Chromium browser window to perform web browsing tasks.
    web_surfer = MultimodalWebSurfer ( \"web_surfer\" , model_client , headless = False , animate_actions = True )
    # The user proxy agent is used to get user input after each step of the web surfer.
    # NOTE: you can skip input by pressing Enter.
    user_proxy = UserProxyAgent ( \"user_proxy\" )
    # The termination condition is set to end the conversation when the user types \'exit\'.
    termination = TextMentionTermination ( \"exit\" , sources = [ \"user_proxy\" ])
    # Web surfer and user proxy take turns in a round-robin fashion.
    team = RoundRobinGroupChat ([ web_surfer , user_proxy ], termination_condition = termination )
    try :
        # Start the team and wait for it to terminate.
        await Console ( team . run_stream ( task = \"Find information about autogen and write a short summary.\" ))
    finally :
        await web_surfer . close ()
        await model_client . close ()

asyncio . run ( main ())

autogen Studio

使用autogen Studio进行原型制作,并在不编写代码的情况下运行多代理工作流程。

autogen Studio on http://**lo*calhost:8080
autogen studio ui –port 8080 –appdir ./my-app\”>

 # Run autogen Studio on http://**lo*calhost:8080
autogen studio ui --port 8080 --appdir ./my-app

为什么要使用autogen ?

autogen生态系统提供了创建AI代理,尤其是多代理工作流程(框架,开发人员工具和应用程序)所需的一切。

框架使用分层且可扩展的设计。层明确分配了责任,并在下面的层顶上建立。该设计使您可以在不同级别的抽象级别上使用框架,从高级API到低级组件。

  • Core API实现消息传递,事件驱动的代理以及本地和分布式运行时,以进行灵活性和功率。它还支持.NET和Python的跨语言支持。
  • AgentChat API实现了快速原型制作的更简单但有用的API。该API建立在核心API之上,最接近V0.2的用户熟悉的用户,并支持常见的多代理模式,例如两种代理聊天或组聊天。
  • 扩展API启用第一和第三方扩展,不断扩展框架功能。它支持LLM客户端(例如OpenAI,Azureopenai)的特定实现以及代码执行等功能。

生态系统还支持两个基本开发人员工具

  • autogen Studio提供了用于构建多代理应用程序的无代码GUI。
  • autogen Batch提供了一个用于评估代理性能的基准测试套件。

您可以使用autogen框架和开发人员工具为您的域创建应用程序。例如,Magentic-One是使用AgentChat API和扩展API构建的最先进的多代理团队,可以处理需要Web浏览,代码执行和文件处理的各种任务。

使用autogen您可以加入并为蓬勃发展的生态系统做出贡献。我们每周举办办公时间,并与维护者和社区进行会谈。我们还提供一个用于实时聊天的Discord服务器,QUTHUB讨论问答以及一个用于教程和更新的博客。

接下来去哪里?

安装
Quickstart
教程
API参考
软件包

有兴趣贡献吗?有关如何入门的指南,请参见贡献。我们欢迎各种贡献,包括错误修复,新功能和文档改进。加入我们的社区,帮助我们改善autogen !

有问题吗?查看我们常见问题(FAQ)以获取常见查询的答案。如果您找不到想要的东西,请随时在我们的Github讨论中询问或加入我们的Discord服务器以进行实时支持。您还可以阅读我们的博客以获取更新。

法律通知

Microsoft和任何贡献者在Creative Commons Attribution 4.0国际公共许可证下授予Microsoft文档和该存储库中其他内容的许可证,请参阅许可证文件,并授予您在MIT许可证中的存储库中的任何代码的许可证,请参阅许可证代码文件。

文档中引用的Microsoft,Windows,Microsoft Azure和/或其他Microsoft产品和服务可以是美国和/或其他国家的Microsoft的商标或注册商标。该项目的许可证不授予您使用任何Microsoft名称,徽标或商标的权利。可以在http://go.m**icros*oft.com/fwlink/?linkid=254653上找到Microsoft的一般商标准则。

隐私信息可以在https://go.m*icro**soft.com/fwlink/?linkid=521839中找到

Microsoft和任何贡献者都保留所有其他权利,无论是在各自的版权,专利还是商标下,无论是通过暗示,禁止反言,还是其他权利。

↑回到顶部↑

下载源码

通过命令行克隆项目:

git clone https://github.com/microsoft/autogen.git

收藏 (0) 打赏

感谢您的支持,我会继续努力的!

打开微信/支付宝扫一扫,即可进行扫码打赏哦,分享从这里开始,精彩与您同在
点赞 (0)

申明:本文由第三方发布,内容仅代表作者观点,与本网站无关。对本文以及其中全部或者部分内容的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。本网发布或转载文章出于传递更多信息之目的,并不意味着赞同其观点或证实其描述,也不代表本网对其真实性负责。

左子网 编程相关 autogen https://www.zuozi.net/33969.html

annoy
上一篇: annoy
OpenBB
下一篇: OpenBB
常见问题
  • 1、自动:拍下后,点击(下载)链接即可下载;2、手动:拍下后,联系卖家发放即可或者联系官方找开发者发货。
查看详情
  • 1、源码默认交易周期:手动发货商品为1-3天,并且用户付款金额将会进入平台担保直到交易完成或者3-7天即可发放,如遇纠纷无限期延长收款金额直至纠纷解决或者退款!;
查看详情
  • 1、描述:源码描述(含标题)与实际源码不一致的(例:货不对板); 2、演示:有演示站时,与实际源码小于95%一致的(但描述中有”不保证完全一样、有变化的可能性”类似显著声明的除外); 3、发货:不发货可无理由退款; 4、安装:免费提供安装服务的源码但卖家不履行的; 5、收费:价格虚标,额外收取其他费用的(但描述中有显著声明或双方交易前有商定的除外); 6、其他:如质量方面的硬性常规问题BUG等。 注:经核实符合上述任一,均支持退款,但卖家予以积极解决问题则除外。
查看详情
  • 1、左子会对双方交易的过程及交易商品的快照进行永久存档,以确保交易的真实、有效、安全! 2、左子无法对如“永久包更新”、“永久技术支持”等类似交易之后的商家承诺做担保,请买家自行鉴别; 3、在源码同时有网站演示与图片演示,且站演与图演不一致时,默认按图演作为纠纷评判依据(特别声明或有商定除外); 4、在没有”无任何正当退款依据”的前提下,商品写有”一旦售出,概不支持退款”等类似的声明,视为无效声明; 5、在未拍下前,双方在QQ上所商定的交易内容,亦可成为纠纷评判依据(商定与描述冲突时,商定为准); 6、因聊天记录可作为纠纷评判依据,故双方联系时,只与对方在左子上所留的QQ、手机号沟通,以防对方不承认自我承诺。 7、虽然交易产生纠纷的几率很小,但一定要保留如聊天记录、手机短信等这样的重要信息,以防产生纠纷时便于左子介入快速处理。
查看详情

相关文章

猜你喜欢
发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务