
Miniautogen은 LLM (Lange Language Models)의 차세대 응용 프로그램을 위해 설계된 혁신적인 오픈 소스 라이브러리입니다. 다중 에이전트 대화를 가능하게하는 데 중점을 둔 Miniautogen은 가볍고 유연한 구조로 유명합니다. 대화 AI의 국경을 탐색하고 확장하는 것을 목표로하는 개발자와 연구원에게 이상적입니다.
Autogen에서 영감을 얻은 Miniautogen은 포괄적 인 도구 제품군을 제공합니다.
chat ) : 다중 에이전트 대화의 생성 및 관리를 용이하게합니다.chatadmin ) : 에이전트의 효율적인 동기화 및 관리를 보장합니다.agent ) : 특정 요구에 따라 에이전트를 조정할 수있는 유연성을 제공합니다.pipeline ) : 에이전트 작업을 자동화하고 간소화하여 확장 성 및 유지 보수를 향상시킵니다.미니 우토 겐은 리텔을 통합하여 이미 100 개 이상의 LLM과 통합됩니다. 기반암, Azure, Openai, Cohere, Anthropic, Ollama, Sagemaker, Huggingface, Replice를 사용하십시오.
agent 파이프 라인에 직접 통합 할 수 있습니다.사전 구축 된 구성 요소의 구색을 살펴보십시오.
pip install miniautogen 설치 미니 우토 겐을 설치하십시오
LLM과 채팅을하지 마십시오
#Initializing LLM Clients
import os
os.environ["OPENAI_API_KEY"] = "your-openai-key"
from miniautogen.llms.llm_client import LiteLLMClient
openai_client = LiteLLMClient(model='gpt-3.5-turbo-16k')
# Building the Chat Environment
from miniautogen.chat.chat import Chat
from miniautogen.agent.agent import Agent
from miniautogen.chat.chatadmin import ChatAdmin
from miniautogen.pipeline.pipeline import Pipeline
from miniautogen.pipeline.components.components import (
UserResponseComponent, AgentReplyComponent, TerminateChatComponent,
Jinja2SingleTemplateComponent, LLMResponseComponent, NextAgentSelectorComponent
)
# Define a Jinja2 template for formatting messages
template_str = """
[{"role": "system", "content": "{{ agent.role }}"}{% for message in messages %},
{% if message.sender_id == agent.agent_id %}
{"role": "assistant", "content": {{ message.message | tojson | safe }}}
{% else %}
{"role": "user", "content": {{ message.message | tojson | safe }}}
{% endif %}
{% endfor %}]
"""
# Initialize Jinja2 component with the template
jinja_component = Jinja2SingleTemplateComponent()
jinja_component.set_template_str(template_str)
# Set up pipelines for different components
pipeline_user = Pipeline([UserResponseComponent()])
pipeline_jinja = Pipeline([jinja_component, LLMResponseComponent(litellm_client)])
pipeline_admin = Pipeline([NextAgentSelectorComponent(), AgentReplyComponent(), TerminateChatComponent()])
# Create the chat environment
chat = Chat()
# Define agents with JSON data
json_data = {'agent_id': 'Bruno', 'name': 'Bruno', 'role': 'user'}
agent1 = Agent.from_json(json_data)
agent1.pipeline = pipeline_user # Assign the user pipeline to agent1
agent2 = Agent("dev", "Carlos", "Python Senior Developer")
agent2.pipeline = pipeline_jinja # Assign the LLM pipeline to agent2
# Add agents to the chat
chat.add_agent(agent1)
chat.add_agent(agent2)
# Add test messages to the chat
json_messages = [{'sender_id': 'Bruno', 'message': 'It’s a test, don’t worry'}]
chat.add_messages(json_messages)
# Initialize and configure ChatAdmin
chat_admin = ChatAdmin("admin", "Admin", "admin_role", pipeline_admin, chat, 10)
#running the chat
chat_admin.run()
다중 에이전트 대화는 자율적이든 인간이든 여러 에이전트와 관련된 상호 작용을 나타냅니다. 각자는 자율성과 전문화 된 능력이 부여되었습니다. 그들은 복잡한 문제를 해결하거나 정보를 공유하거나 특정 작업을 수행하기 위해 협력합니다.
이 예에서는 두 에이전트 간의 대화를 설정합니다. 하나는 제품 소유자의 역할을 수행하고 다른 하나는 파이썬에서 미니 아겐 구성 요소 개발 전문가 역할을합니다.
이 테스트의 주요 목표는 라이브러리의 유연한 디자인 덕분에 다중 에이전트 대화를 만들고 조정하는 미니 겐의 유연성, 용이성 및 효율성을 보여주는 것입니다.
완전한 대화 기록 : chat_history.md
여기에서 노트북을보십시오
추가 통찰력과 영감을 얻으려면 예제 폴더를 방문하십시오. 여기에서는 다른 맥락에서 미니 아겐의 다양성과 능력을 보여주는 다양한 시나리오를 찾을 수 있습니다.
우리는 AI 애호가, 개발자 및 연구원을 초대하여 다중 에이전트 대화의 미래에 기여하고 형성합니다. 귀하의 전문 지식은 미니 우토 겐을 발전시키는 데 도움이되어보다 강력하고 다양한 응용 프로그램을 만들 수 있습니다.
자세히보기 : 기여하십시오
MINIAUTOGEN : 지능적이고 대화식 대화의 미래를 개척합니다.