برنامه نویسی

ادغام ابزار Cross-Framework LLM با AG2

نویسنده: رابرت جامبرسیچ


TL; DR

AG2 به شما امکان می دهد وارد کنید ابزار از فریمورک های مختلف مانند LangChain، CrewAI، و PydanticAI.

  • ابزار LangChain: برای کارهایی مانند پرس و جوی API و اسکراپی وب مفید است.

  • ابزارهای CrewAI: ابزارهای مختلفی را برای خراش دادن وب، جستجو و موارد دیگر ارائه می دهد.

  • ابزار PydanticAI: ابزارهای مبتنی بر زمینه و پردازش ساختار یافته داده را اضافه می کند.

میم قابلیت همکاری ابزار

با AG2 می توانید این ابزارها را ترکیب کرده و قابلیت های نمایندگان خود را افزایش دهید.

در این پست، نحوه ادغام ابزارها از فریمورک‌های مختلف را توضیح خواهیم داد ابزار LangChain، ابزارهای CrewAI، و ابزار PydanticAI– به AG2.

زیرا، واقعاً، جادو زمانی اتفاق می افتد که همه آنها را ترکیب کنید. این به شما امکان می دهد از ابزارهایی از فریمورک های مختلف در AG2 استفاده کنید و به نمایندگان خود قدرت و انعطاف بیشتری می دهد. این وبلاگ بر اساس مفاهیم تحت پوشش است نوت بوک ادغام ابزار.

در این پست، نحوه پیکربندی عامل ها، تطبیق این ابزارها برای استفاده در AG2 و اعتبارسنجی ادغام را از طریق مثال های عملی خواهید فهمید.

ادغام ابزارهای LangChain

LangChain یک چارچوب محبوب با ابزارهای زیادی برای کار با LLM است. طیف وسیعی از ابزارها را دارد که به راحتی می توان آنها را در AG2 ادغام کرد. اگر می‌خواهید لیست کامل را ببینید، به آن مراجعه کنید LangChain Community Tools. می توانید به سرعت مواردی مانند پرس و جوهای API، اسکراپینگ وب و تولید متن را به تنظیمات AG2 خود اضافه کنید.

نصب و راه اندازی

برای اینکه ابزارهای LangChain با AG2 کار کنند، باید چند وابستگی را نصب کنید:

pip install ag2[interop-langchain]
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

همچنین، ما از LangChain استفاده خواهیم کرد ابزار ویکی پدیا، که به بسته ویکی پدیا نیاز دارد. اینجوری نصبش کن:

pip install wikipedia
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

واردات

حالا بیایید ماژول ها و ابزارهای لازم را وارد کنیم.

import os

from langchain_community.tools import WikipediaQueryRun
from langchain_community.utilities import WikipediaAPIWrapper

from autogen import AssistantAgent, UserProxyAgent
from autogen.interop import Interoperability
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

پیکربندی عامل

بیایید عوامل را برای تعامل تنظیم کنیم.

  • config_list جایی است که پیکربندی LLM مانند مدل و کلید API را تعریف می کنید.

  • UserProxyAgent ورودی های کاربر را بدون نیاز به تعامل واقعی انسانی شبیه سازی می کند (تنظیم به NEVER).

  • AssistantAgent نماینده AI را نشان می دهد که با تنظیمات LLM پیکربندی شده است.

config_list = [{"model": "gpt-4o", "api_key": os.environ["OPENAI_API_KEY"]}]
user_proxy = UserProxyAgent(
    name="User",
    human_input_mode="NEVER",
)

chatbot = AssistantAgent(
    name="chatbot",
    llm_config={"config_list": config_list},
)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

یکپارچه سازی ابزار

اینجا جایی است که ما همه چیز را به هم وصل می کنیم.

  • ابتدا راه اندازی کردیم ویکی پدیا APIWrapper، که نتیجه برتر ویکی پدیا (با محدودیت کاراکتر) را دریافت می کند.

  • سپس، استفاده می کنیم WikipediaQueryRun برای انجام پرس و جوهای ویکی پدیا

  • Interoperability به تبدیل ابزار LangChain به فرمت AG2 کمک می کند.

  • در نهایت، ابزار را برای استفاده با هر دو ثبت می کنیم user_proxy و chatbot.

api_wrapper = WikipediaAPIWrapper(top_k_results=1, doc_content_chars_max=1000)
langchain_tool = WikipediaQueryRun(api_wrapper=api_wrapper)

interop = Interoperability()
ag2_tool = interop.convert_tool(tool=langchain_tool, type="langchain")

ag2_tool.register_for_execution(user_proxy)
ag2_tool.register_for_llm(chatbot)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

شروع چت

وقتی همه چیز تنظیم شد، می‌توانیم پیامی به ربات چت بفرستیم و آن از ابزار ویکی‌پدیا برای واکشی اطلاعات مربوطه استفاده می‌کند.

message = "Tell me about the history of the United States"
user_proxy.initiate_chat(recipient=chatbot, message=message, max_turns=2)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

خروجی

هنگامی که چت شروع می شود، در اینجا خروجی را مشاهده خواهید کرد:

User (to chatbot):

Tell me about the history of the United States

--------------------------------------------------------------------------------
chatbot (to User):

***** Suggested tool call (call_hhy2G43ymytUFmJlDsK9J0tk): wikipedia *****
Arguments:
{"tool_input":{"query":"history of the United States"}}
**************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION wikipedia...
User (to chatbot):

***** Response from calling tool (call_hhy2G43ymytUFmJlDsK9J0tk) *****
Page: History of the United States
Summary: The history of the lands that became the United States began with the arrival of the first people in the Americas around 15,000 BC. After European colonization of North America began in the late 15th century, wars and epidemics decimated Indigenous societies. By the 1760s, the thirteen British colonies were established. The Southern Colonies built an agricultural system on slave labor, enslaving millions from Africa. After defeating France, the British Parliament imposed a series of taxes; resistance to these taxes, especially the Boston Tea Party in 1773, led to Parliament issuing the Intolerable Acts designed to end self-government.
In 1776, the United States declared its independence. Led by General George Washington, it won the Revolutionary War in 1783. The Constitution was adopted in 1789, and a Bill of Rights was added in 1791 to guarantee inalienable rights. Washington, the first president, and his adviser Alexander Hamilton created a
**********************************************************************

--------------------------------------------------------------------------------
chatbot (to User):

The history of the United States begins with the arrival of the first peoples in the Americas around 15,000 BC. This pre-Columbian era was followed by European colonization, beginning in the late 15th century, which dramatically altered the indigenous societies through wars and epidemics.

By the 1760s, thirteen British colonies were established along the Atlantic seaboard. In the Southern Colonies, an agricultural economy heavily reliant on enslaved labor from Africa was developed. The British victory over France in the Seven Years' War led Parliament to impose various taxes on the colonies. Resistance to these taxes, exemplified by the Boston Tea Party in 1773, prompted the Parliament to enact the Intolerable Acts, seeking to curtail colonial self-governance.

The United States declared independence in 1776. Under the leadership of General George Washington, the American Revolutionary War concluded successfully in 1783. Subsequently, the U.S. Constitution was adopted in 1789, with the Bill of Rights added in 1791 to ensure inalienable rights. During this early period, President George Washington and his advisor Alexander Hamilton played significant roles in forming the young nation's governmental and economic foundations.

This overview covers the early formation and foundational moments of what became the United States, setting the stage for the country's subsequent expansion and development. TERMINATE

--------------------------------------------------------------------------------
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

یکپارچه سازی ابزارهای CrewAI

CrewAI انواع ابزارهای قدرتمندی را ارائه می دهد که برای کارهایی مانند خراش دادن وب، جستجو، تفسیر کد و موارد دیگر طراحی شده اند. این ابزارها به راحتی در چارچوب AG2 ادغام می شوند و به شما امکان می دهند عوامل خود را با قابلیت های پیشرفته ارتقا دهید. شما می توانید لیست کامل ابزارهای موجود را در این قسمت کاوش کنید ابزارهای CrewAI مخزن

نصب و راه اندازی

بسته های مورد نیاز را برای ادغام ابزارهای CrewAI در چارچوب AG2 نصب کنید. این تضمین می کند که همه وابستگی ها برای هر دو فریمورک نصب شده باشند.

pip install ag2[interop-crewai]
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

واردات

ماژول ها و ابزارهای لازم را وارد کنید.

import os

from crewai_tools import ScrapeWebsiteTool

from autogen import AssistantAgent, UserProxyAgent
from autogen.interop import Interoperability
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

پیکربندی عامل

عوامل را برای تعامل پیکربندی کنید.

  • config_list پیکربندی های LLM از جمله مدل و کلید API را تعریف می کند.

  • UserProxyAgent ورودی های کاربر را بدون نیاز به تعامل واقعی انسانی شبیه سازی می کند (تنظیم به NEVER).

  • AssistantAgent نماینده AI را نشان می دهد که با تنظیمات LLM پیکربندی شده است.

config_list = [{"model": "gpt-4o", "api_key": os.environ["OPENAI_API_KEY"]}]
user_proxy = UserProxyAgent(
    name="User",
    human_input_mode="NEVER",
)

chatbot = AssistantAgent(
    name="chatbot",
    llm_config={"config_list": config_list},
)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

یکپارچه سازی ابزار

ابزار CrewAI را با AG2 ادغام کنید.

  • Interoperability ابزار CrewAI را به فرمت سازگار با AG2 تبدیل می کند.

  • ScrapeWebsiteTool برای کارهای خراش دادن وب استفاده می شود.

  • ابزار را برای اجرا و تعامل با LLM ها ثبت کنید.

interop = Interoperability()
crewai_tool = ScrapeWebsiteTool()
ag2_tool = interop.convert_tool(tool=crewai_tool, type="crewai")

ag2_tool.register_for_execution(user_proxy)
ag2_tool.register_for_llm(chatbot)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

شروع چت

شروع گفتگو بین UserProxyAgent و AssistantAgent برای استفاده از ابزار CrewAI.

message = "Scrape the website https://ag2.ai/"
chat_result = user_proxy.initiate_chat(recipient=chatbot, message=message, max_turns=2)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

خروجی

را chatbot نتایج را بر اساس عملیات خراش دادن وب ارائه می دهد:

User (to chatbot):

Scrape the website https://ag2.ai/

--------------------------------------------------------------------------------
chatbot (to User):

***** Suggested tool call (call_ZStuwmexfN7j56uJKOi6BCid): Read_website_content *****
Arguments:
{"args":{"website_url":"https://ag2.ai/"}}
*************************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION Read_website_content...
Using Tool: Read website content
User (to chatbot):

***** Response from calling tool (call_ZStuwmexfN7j56uJKOi6BCid) *****

AgentOS
Join our growing community of over 20,000 agent builders Join our growing community of over 20,000 agent builders The Open-Source AgentOS Build production-ready multi-agent systems in minutes, not months. Github Discord The End-to-End Platform for Multi-Agent Automation The End-to-End Platform for Multi-Agent Automation Flexible Agent Construction and Orchestration Create specialized agents that work together seamlessly. AG2 makes it easy to define roles, configure behaviors, and orchestrate collaboration - all through simple, intuitive code. → Assistant agents for problem-solving → Executor agents for taking action → Critic agents for validation → Group chat managers for coordination Built-in Conversation Patterns Built-in Conversation Patterns Stop wrestling with agent coordination. AG2 handles message routing, state management, and conversation flow automatically. → Two-agent conversations → Group chats with dynamic speaker selection → Sequential chats with context carryover → Nested conversations for modularity Seamless Human-AI collaboration Seamless Human-AI collaboration Seamlessly integrate human oversight and input into your agent workflows. → Configurable human input modes → Flexible intervention points → Optional human approval workflows → Interactive conversation interfaces → Context-aware human handoff Roadmap AG2 STUDIO → Visual agent system design → Real-time testing and debugging → One-click deployment to production → Perfect for prototyping and MVPs AG2 STUDIO → Visual agent system design → Real-time testing and debugging → One-click deployment to production → Perfect for prototyping and MVPs AG2 STUDIO → Visual agent system design → Real-time testing and debugging → One-click deployment to production → Perfect for prototyping and MVPs AG2 MARKETPLACE → Share and monetize your agents → Discover pre-built solution templates → Quick-start your agent development → Connect with other builders AG2 MARKETPLACE → Share and monetize your agents → Discover pre-built solution templates → Quick-start your agent development → Connect with other builders AG2 MARKETPLACE → Share and monetize your agents → Discover pre-built solution templates → Quick-start your agent development → Connect with other builders SCALING TOOLS → Zero to production deployment guides → Usage analytics and cost optimization → Team collaboration features → Enterprise-ready security controls SCALING TOOLS → Zero to production deployment guides → Usage analytics and cost optimization → Team collaboration features → Enterprise-ready security controls SCALING TOOLS → Zero to production deployment guides → Usage analytics and cost optimization → Team collaboration features → Enterprise-ready security controls AG2 STUDIO → Visual agent system design → Real-time testing and debugging → One-click deployment to production → Perfect for prototyping and MVPs AG2 STUDIO → Visual agent system design → Real-time testing and debugging → One-click deployment to production → Perfect for prototyping and MVPs AG2 MARKETPLACE → Share and monetize your agents → Discover pre-built solution templates → Quick-start your agent development → Connect with other builders AG2 MARKETPLACE → Share and monetize your agents → Discover pre-built solution templates → Quick-start your agent development → Connect with other builders SCALING TOOLS → Zero to production deployment guides → Usage analytics and cost optimization → Team collaboration features → Enterprise-ready security controls SCALING TOOLS → Zero to production deployment guides → Usage analytics and cost optimization → Team collaboration features → Enterprise-ready security controls Whether you're a solo founder prototyping the next big AI product, or an enterprise team deploying at scale we're building AG2 for you. This is AgentOS - making multi-agent development accessible to everyone. Github Join Our Growing Community Join Our Growing Community → 20,000+ active agent builders → Daily technical discussions → Weekly community calls → Open RFC process → Regular contributor events (Coming soon) Discord Problem Features Roadmap Community Documentation Problem Features Roadmap Community Documentation Problem Features Roadmap Community Documentation

**********************************************************************

--------------------------------------------------------------------------------
chatbot (to User):

The website "https://ag2.ai/" promotes a platform named AgentOS, which is designed for building multi-agent systems efficiently. Key highlights from the website are:

- **Community**: They have a growing community of over 20,000 agent builders.

- **End-to-End Platform**: AG2 is described as an end-to-end platform for multi-agent automation. It supports flexible agent construction and orchestration, helping to define roles, configure behaviors, and orchestrate collaboration.

- **Agent Types**: It includes assistant agents for problem-solving, executor agents for taking action, critic agents for validation, and group chat managers for coordination.

- **Built-in Conversation Patterns**: AG2 offers capabilities for message routing, state management, and conversation flow management, supporting various conversation types like two-agent conversations, group chats, and nested conversations.

- **Human-AI Collaboration**: The platform facilitates seamless integration of human oversight and input, with options for human intervention and approval workflows.

- **AG2 Studio**: This feature provides visual agent system design, real-time testing, debugging, and one-click deployment, suited for prototyping and MVPs.

- **AG2 Marketplace**: Provides a place to share, monetize agents, discover pre-built solution templates, and connect with other builders.

- **Scaling Tools**: Includes guides for deployment, analytics, cost optimization, team collaboration features, and enterprise-ready security controls.

- **Community and Documentation**: They encourage connecting through GitHub and Discord and have regular community calls and events planned.

This comprehensive platform seems to aim at both individual developers and enterprise teams looking to deploy multi-agent systems effectively and collaboratively. TERMINATE

--------------------------------------------------------------------------------
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

همچنین می توانید به خلاصه ای دقیق از تعامل دسترسی داشته باشید:

print(chat_result.summary)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

The website "https://ag2.ai/" promotes a platform named AgentOS, which is designed for building multi-agent systems efficiently. Key highlights from the website are:

- **Community**: They have a growing community of over 20,000 agent builders.

- **End-to-End Platform**: AG2 is described as an end-to-end platform for multi-agent automation. It supports flexible agent construction and orchestration, helping to define roles, configure behaviors, and orchestrate collaboration.

- **Agent Types**: It includes assistant agents for problem-solving, executor agents for taking action, critic agents for validation, and group chat managers for coordination.

- **Built-in Conversation Patterns**: AG2 offers capabilities for message routing, state management, and conversation flow management, supporting various conversation types like two-agent conversations, group chats, and nested conversations.

- **Human-AI Collaboration**: The platform facilitates seamless integration of human oversight and input, with options for human intervention and approval workflows.

- **AG2 Studio**: This feature provides visual agent system design, real-time testing, debugging, and one-click deployment, suited for prototyping and MVPs.

- **AG2 Marketplace**: Provides a place to share, monetize agents, discover pre-built solution templates, and connect with other builders.

- **Scaling Tools**: Includes guides for deployment, analytics, cost optimization, team collaboration features, and enterprise-ready security controls.

- **Community and Documentation**: They encourage connecting through GitHub and Discord and have regular community calls and events planned.

This comprehensive platform seems to aim at both individual developers and enterprise teams looking to deploy multi-agent systems effectively and collaboratively.
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

یکپارچه سازی ابزار PydanticAI

PydanticAI یک چارچوب جدیدتر است که ویژگی های قدرتمندی را برای کار با LLM به ارمغان می آورد. اگرچه هنوز مجموعه ای از ابزارهای از پیش ساخته شده مانند سایر فریم ورک ها را ندارد، اما قابلیت های مفیدی مانند تزریق وابستگی. این ویژگی به شما امکان می دهد یک “Context” را به ابزارها تزریق کنید، که می تواند به عبور پارامترها یا مدیریت وضعیت بدون اتکا به LLM کمک کند. اگرچه هنوز در حال تکامل است، شما به راحتی می توانید ابزار PydanticAI را در AG2 ادغام کنید تا قابلیت های عامل را تقویت کنید، به ویژه برای کارهایی که شامل داده های ساختاریافته و منطق مبتنی بر زمینه است.

نصب و راه اندازی

برای اینکه ابزار PydanticAI با AG2 کار کند، وابستگی های لازم را نصب کنید:

pip install ag2[interop-pydantic-ai]
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

واردات

ماژول ها و ابزارهای لازم را وارد کنید.

  • آنها مدل هستند: برای تعریف ساختار داده برای ورودی و خروجی ابزار استفاده می شود.

  • RunContext: زمینه را در حین اجرای ابزارها فراهم می کند.

  • PydanticAITool: نشان دهنده ابزاری در چارچوب PydanticAI است.

  • AssistantAgent و UserProxyAgent: عواملی که ارتباط را در چارچوب AG2 تسهیل می کنند.

  • Interoperability: این ماژول به عنوان یک پل عمل می کند و ادغام ابزار PydanticAI با معماری AG2 را آسان تر می کند.

import os
from typing import Optional

from pydantic import BaseModel
from pydantic_ai import RunContext
from pydantic_ai.tools import Tool as PydanticAITool

from autogen import AssistantAgent, UserProxyAgent
from autogen.interop import Interoperability
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

پیکربندی عامل

عوامل را برای تعامل پیکربندی کنید.

  • config_list پیکربندی های LLM از جمله مدل و کلید API را تعریف می کند.

  • UserProxyAgent ورودی های کاربر را بدون نیاز به تعامل واقعی انسانی شبیه سازی می کند (تنظیم به NEVER).

  • AssistantAgent نماینده AI را نشان می دهد که با تنظیمات LLM پیکربندی شده است.

config_list = [{"model": "gpt-4o", "api_key": os.environ["OPENAI_API_KEY"]}]
user_proxy = UserProxyAgent(
    name="User",
    human_input_mode="NEVER",
)

chatbot = AssistantAgent(
    name="chatbot",
    llm_config={"config_list": config_list},
)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

یکپارچه سازی ابزار

برای ادغام ابزار PydanticAI در AG2:

  • ابتدا a را تعریف کنید Player مدل با استفاده از آنها مدل هستند برای ساختار داده های ورودی

  • استفاده کنید RunContext برای تزریق وابستگی ها (مانند Player به عنوان مثال) به طور ایمن وارد ابزار می شود.

  • را get_player تابع عملکرد ابزار را تعریف می کند و داده های تزریق شده را از طریق بازیابی می کند ctx.deps.

  • سپس، ابزار را به یک فرمت سازگار با AG2 تبدیل کنید Interoperability.

  • ثبت ابزار برای اجرا و تعامل با هر دو user_proxy و chatbot.

class Player(BaseModel):
    name: str
    age: int


def get_player(ctx: RunContext[Player], additional_info: Optional[str] = None) -> str:  # type: ignore[valid-type]
    """Get the player's name.

    Args:
        additional_info: Additional information which can be used.
    """
    return f"Name: {ctx.deps.name}, Age: {ctx.deps.age}, Additional info: {additional_info}"  # type: ignore[attr-defined]


interop = Interoperability()
pydantic_ai_tool = PydanticAITool(get_player, takes_ctx=True)

# player will be injected as a dependency
player = Player(name="Luka", age=25)
ag2_tool = interop.convert_tool(tool=pydantic_ai_tool, type="pydanticai", deps=player)

ag2_tool.register_for_execution(user_proxy)
ag2_tool.register_for_llm(chatbot)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

شروع چت

اکنون که همه چیز تنظیم شده است، می توانید یک چت بین آن ها شروع کنید UserProxyAgent و AssistantAgent:

  • را user_proxy پیامی به chatbot.

  • کاربر اطلاعات بازیکن را درخواست می کند و “دروازه بان” را به عنوان زمینه اضافی درج می کند.

  • را Player داده ها به طور ایمن به ابزار تزریق می شوند و ربات چت می تواند در طول چت به آن دسترسی داشته باشد و از آن استفاده کند.

user_proxy.initiate_chat(
    recipient=chatbot, message="Get player, for additional information use 'goal keeper'", max_turns=3
)
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

خروجی

User (to chatbot):

Get player, for additional information use 'goal keeper'

--------------------------------------------------------------------------------
chatbot (to User):

***** Suggested tool call (call_lPXIohFiJfnjmgwDnNFPQCzc): get_player *****
Arguments:
{"additional_info":"goal keeper"}
***************************************************************************

--------------------------------------------------------------------------------

>>>>>>>> EXECUTING FUNCTION get_player...
User (to chatbot):

***** Response from calling tool (call_lPXIohFiJfnjmgwDnNFPQCzc) *****
Name: Luka, Age: 25, Additional info: goal keeper
**********************************************************************

--------------------------------------------------------------------------------
chatbot (to User):

The player's name is Luka, who is a 25-year-old goalkeeper. TERMINATE
وارد حالت تمام صفحه شوید

از حالت تمام صفحه خارج شوید

راخلاصه

در این پست، نحوه ادغام ابزارها از چندین فریمورک (LangChain، CrewAI و PydanticAI) را در چارچوب AG2 مورد بررسی قرار داده‌ایم که امکان همکاری بین چارچوبی را فراهم می‌کند. با ادغام این ابزارها، می‌توانید عوامل خود را با قابلیت‌های مختلف، مانند پرس‌وجو API، اسکراپینگ وب و پردازش داده‌های ساخت‌یافته تقویت کنید.

  • LangChain طیف گسترده ای از ابزارهای از پیش ساخته شده را برای کار با API ها و خراش دادن وب ارائه می دهد که گسترش عملکرد AG2 را آسان می کند.

  • CrewAI ابزارهای متنوعی را برای جستجو، خراش دادن وب و موارد دیگر به ارمغان می‌آورد که امکان تعامل قوی با عامل را فراهم می‌کند.

  • PydanticAI تزریق وابستگی و منطق مبتنی بر زمینه را معرفی می کند و امکان مدیریت کارآمد داده ها را بدون تکیه بر LLM ها فراهم می کند.

با معماری انعطاف پذیر AG2 و قدرت این فریم ورک ها، توسعه دهندگان می توانند عواملی را ایجاد کنند که توانمندتر و سازگارتر باشند. با دنبال کردن مراحل یکپارچه سازی برای هر فریم ورک، می توانید عملکرد نمایندگان خود را افزایش دهید، قابلیت های آنها را گسترش دهید و تعاملات پویاتری ایجاد کنید.

اکنون باید درک بهتری از نحوه ادغام ابزارها از چارچوب های مختلف در AG2 و نحوه استفاده موثر از این ابزارها در پروژه های خود داشته باشید.

https://www.youtube.com/watch?v=B_NTwUoJrew

پیدا کردن این مفید است؟

را تیم AG2 به سختی برای ایجاد محتوایی مانند این کار می کند، به غیر از ایجاد یک پلتفرم قدرتمند، منبع باز و سرتاسر برای اتوماسیون چند عاملی.

ساده ترین راه برای نشان دادن حمایت خود، ستاره کردن است مخزن AG2، بلکه برای مشارکت یا صرفاً برای امتحان کردن به آن نگاهی بیندازید.

همچنین، اگر موارد کاربردی جالبی برای قابلیت همکاری ابزار دارید، به ما اطلاع دهید؟ یا شاید دوست دارید ویژگی ها یا پیشرفت های بیشتری ببینید؟ به ما بپیوندید اختلاف سرور برای بحث

نوشته های مشابه

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

دکمه بازگشت به بالا