ag2 0.7.4b2__py3-none-any.whl → 0.7.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of ag2 might be problematic. Click here for more details.
- ag2-0.7.5.dist-info/METADATA +463 -0
- ag2-0.7.5.dist-info/RECORD +6 -0
- ag2-0.7.4b2.dist-info/METADATA +0 -463
- ag2-0.7.4b2.dist-info/RECORD +0 -6
- {ag2-0.7.4b2.dist-info → ag2-0.7.5.dist-info}/LICENSE +0 -0
- {ag2-0.7.4b2.dist-info → ag2-0.7.5.dist-info}/NOTICE.md +0 -0
- {ag2-0.7.4b2.dist-info → ag2-0.7.5.dist-info}/WHEEL +0 -0
- {ag2-0.7.4b2.dist-info → ag2-0.7.5.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: ag2
|
|
3
|
+
Version: 0.7.5
|
|
4
|
+
Summary: Alias package for pyautogen
|
|
5
|
+
Home-page: https://github.com/ag2ai/ag2
|
|
6
|
+
Author: Chi Wang & Qingyun Wu
|
|
7
|
+
Author-email: support@ag2.ai
|
|
8
|
+
License: Apache Software License 2.0
|
|
9
|
+
Platform: UNKNOWN
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Requires-Python: >=3.9,<3.14
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
License-File: LICENSE
|
|
16
|
+
License-File: NOTICE.md
|
|
17
|
+
Requires-Dist: pyautogen==0.7.5
|
|
18
|
+
Provides-Extra: anthropic
|
|
19
|
+
Requires-Dist: pyautogen[anthropic]==0.7.5; extra == "anthropic"
|
|
20
|
+
Provides-Extra: autobuild
|
|
21
|
+
Requires-Dist: pyautogen[autobuild]==0.7.5; extra == "autobuild"
|
|
22
|
+
Provides-Extra: bedrock
|
|
23
|
+
Requires-Dist: pyautogen[bedrock]==0.7.5; extra == "bedrock"
|
|
24
|
+
Provides-Extra: blendsearch
|
|
25
|
+
Requires-Dist: pyautogen[blendsearch]==0.7.5; extra == "blendsearch"
|
|
26
|
+
Provides-Extra: browser-use
|
|
27
|
+
Requires-Dist: pyautogen[browser-use]==0.7.5; extra == "browser-use"
|
|
28
|
+
Provides-Extra: captainagent
|
|
29
|
+
Requires-Dist: pyautogen[captainagent]==0.7.5; extra == "captainagent"
|
|
30
|
+
Provides-Extra: cerebras
|
|
31
|
+
Requires-Dist: pyautogen[cerebras]==0.7.5; extra == "cerebras"
|
|
32
|
+
Provides-Extra: cohere
|
|
33
|
+
Requires-Dist: pyautogen[cohere]==0.7.5; extra == "cohere"
|
|
34
|
+
Provides-Extra: commsagent-discord
|
|
35
|
+
Requires-Dist: pyautogen[commsagent-discord]==0.7.5; extra == "commsagent-discord"
|
|
36
|
+
Provides-Extra: commsagent-slack
|
|
37
|
+
Requires-Dist: pyautogen[commsagent-slack]==0.7.5; extra == "commsagent-slack"
|
|
38
|
+
Provides-Extra: commsagent-telegram
|
|
39
|
+
Requires-Dist: pyautogen[commsagent-telegram]==0.7.5; extra == "commsagent-telegram"
|
|
40
|
+
Provides-Extra: cosmosdb
|
|
41
|
+
Requires-Dist: pyautogen[cosmosdb]==0.7.5; extra == "cosmosdb"
|
|
42
|
+
Provides-Extra: crawl4ai
|
|
43
|
+
Requires-Dist: pyautogen[crawl4ai]==0.7.5; extra == "crawl4ai"
|
|
44
|
+
Provides-Extra: dev
|
|
45
|
+
Requires-Dist: pyautogen[dev]==0.7.5; extra == "dev"
|
|
46
|
+
Provides-Extra: docs
|
|
47
|
+
Requires-Dist: pyautogen[docs]==0.7.5; extra == "docs"
|
|
48
|
+
Provides-Extra: flaml
|
|
49
|
+
Requires-Dist: pyautogen[flaml]==0.7.5; extra == "flaml"
|
|
50
|
+
Provides-Extra: gemini
|
|
51
|
+
Requires-Dist: pyautogen[gemini]==0.7.5; extra == "gemini"
|
|
52
|
+
Provides-Extra: graph
|
|
53
|
+
Requires-Dist: pyautogen[graph]==0.7.5; extra == "graph"
|
|
54
|
+
Provides-Extra: graph-rag-falkor-db
|
|
55
|
+
Requires-Dist: pyautogen[graph-rag-falkor-db]==0.7.5; extra == "graph-rag-falkor-db"
|
|
56
|
+
Provides-Extra: groq
|
|
57
|
+
Requires-Dist: pyautogen[groq]==0.7.5; extra == "groq"
|
|
58
|
+
Provides-Extra: interop
|
|
59
|
+
Requires-Dist: pyautogen[interop]==0.7.5; extra == "interop"
|
|
60
|
+
Provides-Extra: interop-crewai
|
|
61
|
+
Requires-Dist: pyautogen[interop-crewai]==0.7.5; extra == "interop-crewai"
|
|
62
|
+
Provides-Extra: interop-langchain
|
|
63
|
+
Requires-Dist: pyautogen[interop-langchain]==0.7.5; extra == "interop-langchain"
|
|
64
|
+
Provides-Extra: interop-pydantic-ai
|
|
65
|
+
Requires-Dist: pyautogen[interop-pydantic-ai]==0.7.5; extra == "interop-pydantic-ai"
|
|
66
|
+
Provides-Extra: jupyter-executor
|
|
67
|
+
Requires-Dist: pyautogen[jupyter-executor]==0.7.5; extra == "jupyter-executor"
|
|
68
|
+
Provides-Extra: lint
|
|
69
|
+
Requires-Dist: pyautogen[lint]==0.7.5; extra == "lint"
|
|
70
|
+
Provides-Extra: lmm
|
|
71
|
+
Requires-Dist: pyautogen[lmm]==0.7.5; extra == "lmm"
|
|
72
|
+
Provides-Extra: long-context
|
|
73
|
+
Requires-Dist: pyautogen[long-context]==0.7.5; extra == "long-context"
|
|
74
|
+
Provides-Extra: mathchat
|
|
75
|
+
Requires-Dist: pyautogen[mathchat]==0.7.5; extra == "mathchat"
|
|
76
|
+
Provides-Extra: mistral
|
|
77
|
+
Requires-Dist: pyautogen[mistral]==0.7.5; extra == "mistral"
|
|
78
|
+
Provides-Extra: neo4j
|
|
79
|
+
Requires-Dist: pyautogen[neo4j]==0.7.5; extra == "neo4j"
|
|
80
|
+
Provides-Extra: ollama
|
|
81
|
+
Requires-Dist: pyautogen[ollama]==0.7.5; extra == "ollama"
|
|
82
|
+
Provides-Extra: rag
|
|
83
|
+
Requires-Dist: pyautogen[rag]==0.7.5; extra == "rag"
|
|
84
|
+
Provides-Extra: redis
|
|
85
|
+
Requires-Dist: pyautogen[redis]==0.7.5; extra == "redis"
|
|
86
|
+
Provides-Extra: retrievechat
|
|
87
|
+
Requires-Dist: pyautogen[retrievechat]==0.7.5; extra == "retrievechat"
|
|
88
|
+
Provides-Extra: retrievechat-couchbase
|
|
89
|
+
Requires-Dist: pyautogen[retrievechat-couchbase]==0.7.5; extra == "retrievechat-couchbase"
|
|
90
|
+
Provides-Extra: retrievechat-mongodb
|
|
91
|
+
Requires-Dist: pyautogen[retrievechat-mongodb]==0.7.5; extra == "retrievechat-mongodb"
|
|
92
|
+
Provides-Extra: retrievechat-pgvector
|
|
93
|
+
Requires-Dist: pyautogen[retrievechat-pgvector]==0.7.5; extra == "retrievechat-pgvector"
|
|
94
|
+
Provides-Extra: retrievechat-qdrant
|
|
95
|
+
Requires-Dist: pyautogen[retrievechat-qdrant]==0.7.5; extra == "retrievechat-qdrant"
|
|
96
|
+
Provides-Extra: teachable
|
|
97
|
+
Requires-Dist: pyautogen[teachable]==0.7.5; extra == "teachable"
|
|
98
|
+
Provides-Extra: test
|
|
99
|
+
Requires-Dist: pyautogen[test]==0.7.5; extra == "test"
|
|
100
|
+
Provides-Extra: together
|
|
101
|
+
Requires-Dist: pyautogen[together]==0.7.5; extra == "together"
|
|
102
|
+
Provides-Extra: twilio
|
|
103
|
+
Requires-Dist: pyautogen[twilio]==0.7.5; extra == "twilio"
|
|
104
|
+
Provides-Extra: types
|
|
105
|
+
Requires-Dist: pyautogen[types]==0.7.5; extra == "types"
|
|
106
|
+
Provides-Extra: websockets
|
|
107
|
+
Requires-Dist: pyautogen[websockets]==0.7.5; extra == "websockets"
|
|
108
|
+
Provides-Extra: websurfer
|
|
109
|
+
Requires-Dist: pyautogen[websurfer]==0.7.5; extra == "websurfer"
|
|
110
|
+
|
|
111
|
+
<a name="readme-top"></a>
|
|
112
|
+
|
|
113
|
+
<p align="center">
|
|
114
|
+
<!-- The image URL points to the GitHub-hosted content, ensuring it displays correctly on the PyPI website.-->
|
|
115
|
+
<img src="https://raw.githubusercontent.com/ag2ai/ag2/27b37494a6f72b1f8050f6bd7be9a7ff232cf749/website/static/img/ag2.svg" width="150" title="hover text">
|
|
116
|
+
<br>
|
|
117
|
+
<br>
|
|
118
|
+
<img src="https://img.shields.io/pypi/dm/pyautogen?label=PyPI%20downloads">
|
|
119
|
+
<a href="https://badge.fury.io/py/autogen"><img src="https://badge.fury.io/py/autogen.svg"></a>
|
|
120
|
+
<a href="https://github.com/ag2ai/ag2/actions/workflows/python-package.yml">
|
|
121
|
+
<img src="https://github.com/ag2ai/ag2/actions/workflows/python-package.yml/badge.svg">
|
|
122
|
+
</a>
|
|
123
|
+
<img src="https://img.shields.io/badge/3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12-blue">
|
|
124
|
+
<a href="https://discord.gg/pAbnFJrkgZ">
|
|
125
|
+
<img src="https://img.shields.io/discord/1153072414184452236?logo=discord&style=flat">
|
|
126
|
+
</a>
|
|
127
|
+
<a href="https://x.com/ag2oss">
|
|
128
|
+
<img src="https://img.shields.io/twitter/url/https/twitter.com/cloudposse.svg?style=social&label=Follow%20%40ag2ai">
|
|
129
|
+
</a>
|
|
130
|
+
</p>
|
|
131
|
+
|
|
132
|
+
<p align="center">
|
|
133
|
+
<a href="https://docs.ag2.ai/">📚 Documentation</a> |
|
|
134
|
+
<a href="https://github.com/ag2ai/build-with-ag2">💡 Examples</a> |
|
|
135
|
+
<a href="https://docs.ag2.ai/docs/contributor-guide/contributing">🤝 Contributing</a> |
|
|
136
|
+
<a href="#related-papers">📝 Cite paper</a> |
|
|
137
|
+
<a href="https://discord.gg/pAbnFJrkgZ">💬 Join Discord</a>
|
|
138
|
+
</p>
|
|
139
|
+
|
|
140
|
+
<p align="center">
|
|
141
|
+
AG2 was evolved from AutoGen. Fully open-sourced. We invite collaborators from all organizations to contribute.
|
|
142
|
+
</p>
|
|
143
|
+
|
|
144
|
+
# AG2: Open-Source AgentOS for AI Agents
|
|
145
|
+
|
|
146
|
+
AG2 (formerly AutoGen) is an open-source programming framework for building AI agents and facilitating cooperation among multiple agents to solve tasks. AG2 aims to streamline the development and research of agentic AI. It offers features such as agents capable of interacting with each other, facilitates the use of various large language models (LLMs) and tool use support, autonomous and human-in-the-loop workflows, and multi-agent conversation patterns.
|
|
147
|
+
|
|
148
|
+
The project is currently maintained by a [dynamic group of volunteers](MAINTAINERS.md) from several organizations. Contact project administrators Chi Wang and Qingyun Wu via [support@ag2.ai](mailto:support@ag2.ai) if you are interested in becoming a maintainer.
|
|
149
|
+
|
|
150
|
+
## Table of contents
|
|
151
|
+
|
|
152
|
+
- [AG2: Open-Source AgentOS for AI Agents](#ag2-open-source-agentos-for-ai-agents)
|
|
153
|
+
- [Table of contents](#table-of-contents)
|
|
154
|
+
- [Getting started](#getting-started)
|
|
155
|
+
- [Installation](#installation)
|
|
156
|
+
- [Setup your API keys](#setup-your-api-keys)
|
|
157
|
+
- [Run your first agent](#run-your-first-agent)
|
|
158
|
+
- [Example applications](#example-applications)
|
|
159
|
+
- [Introduction of different agent concepts](#introduction-of-different-agent-concepts)
|
|
160
|
+
- [Conversable agent](#conversable-agent)
|
|
161
|
+
- [Human in the loop](#human-in-the-loop)
|
|
162
|
+
- [Orchestrating multiple agents](#orchestrating-multiple-agents)
|
|
163
|
+
- [Tools](#tools)
|
|
164
|
+
- [Advanced agentic design patterns](#advanced-agentic-design-patterns)
|
|
165
|
+
- [Announcements](#announcements)
|
|
166
|
+
- [Contributors Wall](#contributors-wall)
|
|
167
|
+
- [Code style and linting](#code-style-and-linting)
|
|
168
|
+
- [Related papers](#related-papers)
|
|
169
|
+
- [Cite the project](#cite-the-project)
|
|
170
|
+
- [License](#license)
|
|
171
|
+
|
|
172
|
+
## Getting started
|
|
173
|
+
|
|
174
|
+
For a step-by-step walk through of AG2 concepts and code, see [Basic Concepts](https://docs.ag2.ai/docs/user-guide/basic-concepts) in our documentation.
|
|
175
|
+
|
|
176
|
+
### Installation
|
|
177
|
+
|
|
178
|
+
AG2 requires **Python version >= 3.9, < 3.14**. AG2 is available via `ag2` (or its alias `pyautogen` or `autogen`) on PyPI.
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
pip install ag2
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Minimal dependencies are installed by default. You can install extra options based on the features you need.
|
|
185
|
+
|
|
186
|
+
### Setup your API keys
|
|
187
|
+
|
|
188
|
+
To keep your LLM dependencies neat we recommend using the `OAI_CONFIG_LIST` file to store your API keys.
|
|
189
|
+
|
|
190
|
+
You can use the sample file `OAI_CONFIG_LIST_sample` as a template.
|
|
191
|
+
|
|
192
|
+
```json
|
|
193
|
+
[
|
|
194
|
+
{
|
|
195
|
+
"model": "gpt-4o",
|
|
196
|
+
"api_key": "<your OpenAI API key here>"
|
|
197
|
+
}
|
|
198
|
+
]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Run your first agent
|
|
202
|
+
|
|
203
|
+
Create a script or a Jupyter Notebook and run your first agent.
|
|
204
|
+
|
|
205
|
+
```python
|
|
206
|
+
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
|
|
207
|
+
|
|
208
|
+
llm_config = {
|
|
209
|
+
"config_list": config_list_from_json(env_or_file="OAI_CONFIG_LIST")
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
assistant = AssistantAgent("assistant", llm_config=llm_config)
|
|
213
|
+
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False})
|
|
214
|
+
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
|
|
215
|
+
# This initiates an automated chat between the two agents to solve the task
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
## Example applications
|
|
219
|
+
|
|
220
|
+
We maintain a dedicated repository with a wide range of applications to help you get started with various use cases or check out our collection of jupyter notebooks as a starting point.
|
|
221
|
+
|
|
222
|
+
- [Build with AG2](https://github.com/ag2ai/build-with-ag2)
|
|
223
|
+
- [Jupyter Notebooks](notebook)
|
|
224
|
+
|
|
225
|
+
## Introduction of different agent concepts
|
|
226
|
+
|
|
227
|
+
We have several agent concepts in AG2 to help you build your AI agents. We introduce the most common ones here.
|
|
228
|
+
|
|
229
|
+
- **Conversable Agent**: Agents that are able to send messages, receive messages and generate replies using GenAI models, non-GenAI tools, or human inputs.
|
|
230
|
+
- **Human in the loop**: Add human input to the conversation
|
|
231
|
+
- **Orchestrating multiple agents**: Users can orchestrate multiple agents with built-in conversation patterns such as swarms, group chats, nested chats, sequential chats or customize the orchestration by registering custom reply methods.
|
|
232
|
+
- **Tools**: Programs that can be registered, invoked and executed by agents
|
|
233
|
+
- **Advanced Concepts**: AG2 supports more concepts such as structured outputs, rag, code execution, etc.
|
|
234
|
+
|
|
235
|
+
### Conversable agent
|
|
236
|
+
|
|
237
|
+
The conversable agent is the most used agent and is created for generating conversations among agents.
|
|
238
|
+
It serves as a base class for all agents in AG2.
|
|
239
|
+
|
|
240
|
+
```python
|
|
241
|
+
from autogen import ConversableAgent
|
|
242
|
+
|
|
243
|
+
# Create an AI agent
|
|
244
|
+
assistant = ConversableAgent(
|
|
245
|
+
name="assistant",
|
|
246
|
+
system_message="You are an assistant that responds concisely.",
|
|
247
|
+
llm_config=llm_config
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
# Create another AI agent
|
|
251
|
+
fact_checker = ConversableAgent(
|
|
252
|
+
name="fact_checker",
|
|
253
|
+
system_message="You are a fact-checking assistant.",
|
|
254
|
+
llm_config=llm_config
|
|
255
|
+
)
|
|
256
|
+
|
|
257
|
+
# Start the conversation
|
|
258
|
+
assistant.initiate_chat(
|
|
259
|
+
recipient=fact_checker,
|
|
260
|
+
message="What is AG2?",
|
|
261
|
+
max_turns=2
|
|
262
|
+
)
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
### Human in the loop
|
|
266
|
+
|
|
267
|
+
Sometimes your wished workflow requires human input. Therefore you can enable the human in the loop feature.
|
|
268
|
+
|
|
269
|
+
If you set `human_input_mode` to `ALWAYS` on ConversableAgent you can give human input to the conversation.
|
|
270
|
+
|
|
271
|
+
There are three modes for `human_input_mode`: `ALWAYS`, `NEVER`, `TERMINATE`.
|
|
272
|
+
|
|
273
|
+
We created a class which sets the `human_input_mode` to `ALWAYS` for you. Its called `UserProxyAgent`.
|
|
274
|
+
|
|
275
|
+
```python
|
|
276
|
+
from autogen import ConversableAgent
|
|
277
|
+
|
|
278
|
+
# Create an AI agent
|
|
279
|
+
assistant = ConversableAgent(
|
|
280
|
+
name="assistant",
|
|
281
|
+
system_message="You are a helpful assistant.",
|
|
282
|
+
llm_config=llm_config
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
# Create a human agent with manual input mode
|
|
286
|
+
human = ConversableAgent(
|
|
287
|
+
name="human",
|
|
288
|
+
human_input_mode="ALWAYS"
|
|
289
|
+
)
|
|
290
|
+
# or
|
|
291
|
+
human = UserProxyAgent(name="human", code_execution_config={"work_dir": "coding", "use_docker": False})
|
|
292
|
+
|
|
293
|
+
# Start the chat
|
|
294
|
+
human.initiate_chat(
|
|
295
|
+
recipient=assistant,
|
|
296
|
+
message="Hello! What's 2 + 2?"
|
|
297
|
+
)
|
|
298
|
+
|
|
299
|
+
```
|
|
300
|
+
|
|
301
|
+
### Orchestrating multiple agents
|
|
302
|
+
|
|
303
|
+
Users can define their own orchestration patterns using the flexible programming interface from AG2.
|
|
304
|
+
|
|
305
|
+
Additionally AG2 provides multiple built-in patterns to orchestrate multiple agents, such as `GroupChat` and `Swarm`.
|
|
306
|
+
|
|
307
|
+
Both concepts are used to orchestrate multiple agents to solve a task.
|
|
308
|
+
|
|
309
|
+
The group chat works like a chat where each registered agent can participate in the conversation.
|
|
310
|
+
|
|
311
|
+
```python
|
|
312
|
+
from autogen import ConversableAgent, GroupChat, GroupChatManager
|
|
313
|
+
|
|
314
|
+
# Create AI agents
|
|
315
|
+
teacher = ConversableAgent(name="teacher", system_message="You suggest lesson topics.")
|
|
316
|
+
planner = ConversableAgent(name="planner", system_message="You create lesson plans.")
|
|
317
|
+
reviewer = ConversableAgent(name="reviewer", system_message="You review lesson plans.")
|
|
318
|
+
|
|
319
|
+
# Create GroupChat
|
|
320
|
+
groupchat = GroupChat(agents=[teacher, planner, reviewer], speaker_selection_method="auto")
|
|
321
|
+
|
|
322
|
+
# Create the GroupChatManager, it will manage the conversation and uses an LLM to select the next agent
|
|
323
|
+
manager = GroupChatManager(name="manager", groupchat=groupchat)
|
|
324
|
+
|
|
325
|
+
# Start the conversation
|
|
326
|
+
teacher.initiate_chat(manager, "Create a lesson on photosynthesis.")
|
|
327
|
+
```
|
|
328
|
+
|
|
329
|
+
The swarm requires a more rigid structure and the flow needs to be defined with hand-off, post-tool, and post-work transitions from an agent to another agent.
|
|
330
|
+
|
|
331
|
+
Read more about it in the [documentation](https://docs.ag2.ai/docs/user-guide/advanced-concepts/conversation-patterns-deep-dive)
|
|
332
|
+
|
|
333
|
+
### Tools
|
|
334
|
+
|
|
335
|
+
Agents gain significant utility through tools as they provide access to external data, APIs, and functionality.
|
|
336
|
+
|
|
337
|
+
```python
|
|
338
|
+
from datetime import datetime
|
|
339
|
+
from typing import Annotated
|
|
340
|
+
|
|
341
|
+
from autogen import ConversableAgent, register_function
|
|
342
|
+
|
|
343
|
+
# 1. Our tool, returns the day of the week for a given date
|
|
344
|
+
def get_weekday(date_string: Annotated[str, "Format: YYYY-MM-DD"]) -> str:
|
|
345
|
+
date = datetime.strptime(date_string, "%Y-%m-%d")
|
|
346
|
+
return date.strftime("%A")
|
|
347
|
+
|
|
348
|
+
# 2. Agent for determining whether to run the tool
|
|
349
|
+
date_agent = ConversableAgent(
|
|
350
|
+
name="date_agent",
|
|
351
|
+
system_message="You get the day of the week for a given date.",
|
|
352
|
+
llm_config=llm_config,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
# 3. And an agent for executing the tool
|
|
356
|
+
executor_agent = ConversableAgent(
|
|
357
|
+
name="executor_agent",
|
|
358
|
+
human_input_mode="NEVER",
|
|
359
|
+
)
|
|
360
|
+
|
|
361
|
+
# 4. Registers the tool with the agents, the description will be used by the LLM
|
|
362
|
+
register_function(
|
|
363
|
+
get_weekday,
|
|
364
|
+
caller=date_agent,
|
|
365
|
+
executor=executor_agent,
|
|
366
|
+
description="Get the day of the week for a given date",
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
# 5. Two-way chat ensures the executor agent follows the suggesting agent
|
|
370
|
+
chat_result = executor_agent.initiate_chat(
|
|
371
|
+
recipient=date_agent,
|
|
372
|
+
message="I was born on the 25th of March 1995, what day was it?",
|
|
373
|
+
max_turns=1,
|
|
374
|
+
)
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
### Advanced agentic design patterns
|
|
378
|
+
|
|
379
|
+
AG2 supports more advanced concepts to help you build your AI agent workflows. You can find more information in the documentation.
|
|
380
|
+
|
|
381
|
+
- [Structured Output](https://docs.ag2.ai/docs/user-guide/basic-concepts/structured-outputs)
|
|
382
|
+
- [Ending a conversation](https://docs.ag2.ai/docs/user-guide/basic-concepts/ending-a-chat)
|
|
383
|
+
- [Retrieval Augmented Generation (RAG)](https://docs.ag2.ai/docs/user-guide/advanced-concepts/rag)
|
|
384
|
+
- [Code Execution](https://docs.ag2.ai/docs/user-guide/advanced-concepts/code-execution)
|
|
385
|
+
- [Tools with Secrets](https://docs.ag2.ai/docs/user-guide/advanced-concepts/tools-with-secrets)
|
|
386
|
+
|
|
387
|
+
## Announcements
|
|
388
|
+
|
|
389
|
+
🔥 🎉 **Nov 11, 2024:** We are evolving AutoGen into **AG2**!
|
|
390
|
+
A new organization [AG2AI](https://github.com/ag2ai) is created to host the development of AG2 and related projects with open governance. Check [AG2's new look](https://ag2.ai/).
|
|
391
|
+
|
|
392
|
+
📄 **License:**
|
|
393
|
+
We adopt the Apache 2.0 license from v0.3. This enhances our commitment to open-source collaboration while providing additional protections for contributors and users alike.
|
|
394
|
+
|
|
395
|
+
🎉 May 29, 2024: DeepLearning.ai launched a new short course [AI Agentic Design Patterns with AutoGen](https://www.deeplearning.ai/short-courses/ai-agentic-design-patterns-with-autogen), made in collaboration with Microsoft and Penn State University, and taught by AutoGen creators [Chi Wang](https://github.com/sonichi) and [Qingyun Wu](https://github.com/qingyun-wu).
|
|
396
|
+
|
|
397
|
+
🎉 May 24, 2024: Foundation Capital published an article on [Forbes: The Promise of Multi-Agent AI](https://www.forbes.com/sites/joannechen/2024/05/24/the-promise-of-multi-agent-ai/?sh=2c1e4f454d97) and a video [AI in the Real World Episode 2: Exploring Multi-Agent AI and AutoGen with Chi Wang](https://www.youtube.com/watch?v=RLwyXRVvlNk).
|
|
398
|
+
|
|
399
|
+
🎉 Apr 17, 2024: Andrew Ng cited AutoGen in [The Batch newsletter](https://www.deeplearning.ai/the-batch/issue-245/) and [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent (Mar 26).
|
|
400
|
+
|
|
401
|
+
[More Announcements](announcements.md)
|
|
402
|
+
|
|
403
|
+
## Contributors Wall
|
|
404
|
+
|
|
405
|
+
<a href="https://github.com/ag2ai/ag2/graphs/contributors">
|
|
406
|
+
<img src="https://contrib.rocks/image?repo=ag2ai/ag2&max=204" />
|
|
407
|
+
</a>
|
|
408
|
+
|
|
409
|
+
## Code style and linting
|
|
410
|
+
|
|
411
|
+
This project uses pre-commit hooks to maintain code quality. Before contributing:
|
|
412
|
+
|
|
413
|
+
1. Install pre-commit:
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
pip install pre-commit
|
|
417
|
+
pre-commit install
|
|
418
|
+
```
|
|
419
|
+
|
|
420
|
+
2. The hooks will run automatically on commit, or you can run them manually:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
pre-commit run --all-files
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
## Related papers
|
|
427
|
+
|
|
428
|
+
- [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://arxiv.org/abs/2308.08155)
|
|
429
|
+
|
|
430
|
+
- [EcoOptiGen: Hyperparameter Optimization for Large Language Model Generation Inference](https://arxiv.org/abs/2303.04673)
|
|
431
|
+
|
|
432
|
+
- [MathChat: Converse to Tackle Challenging Math Problems with LLM Agents](https://arxiv.org/abs/2306.01337)
|
|
433
|
+
|
|
434
|
+
- [AgentOptimizer: Offline Training of Language Model Agents with Functions as Learnable Weights](https://arxiv.org/pdf/2402.11359)
|
|
435
|
+
|
|
436
|
+
- [StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows](https://arxiv.org/abs/2403.11322)
|
|
437
|
+
|
|
438
|
+
## Cite the project
|
|
439
|
+
|
|
440
|
+
```
|
|
441
|
+
@software{AG2_2024,
|
|
442
|
+
author = {Chi Wang and Qingyun Wu and the AG2 Community},
|
|
443
|
+
title = {AG2: Open-Source AgentOS for AI Agents},
|
|
444
|
+
year = {2024},
|
|
445
|
+
url = {https://github.com/ag2ai/ag2},
|
|
446
|
+
note = {Available at https://docs.ag2.ai/},
|
|
447
|
+
version = {latest}
|
|
448
|
+
}
|
|
449
|
+
```
|
|
450
|
+
|
|
451
|
+
## License
|
|
452
|
+
|
|
453
|
+
This project is licensed under the [Apache License, Version 2.0 (Apache-2.0)](./LICENSE).
|
|
454
|
+
|
|
455
|
+
This project is a spin-off of [AutoGen](https://github.com/microsoft/autogen) and contains code under two licenses:
|
|
456
|
+
|
|
457
|
+
- The original code from https://github.com/microsoft/autogen is licensed under the MIT License. See the [LICENSE_original_MIT](./license_original/LICENSE_original_MIT) file for details.
|
|
458
|
+
|
|
459
|
+
- Modifications and additions made in this fork are licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for the full license text.
|
|
460
|
+
|
|
461
|
+
We have documented these changes for clarity and to ensure transparency with our user and contributor community. For more details, please see the [NOTICE](./NOTICE.md) file.
|
|
462
|
+
|
|
463
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
ag2-0.7.5.dist-info/LICENSE,sha256=GEFQVNayAR-S_rQD5l8hPdgvgyktVdy4Bx5-v90IfRI,11384
|
|
2
|
+
ag2-0.7.5.dist-info/METADATA,sha256=_yIFHY7yJMQw4MJ-d1S8ei-rxVkd9aSVQgidVAjX-sc,19246
|
|
3
|
+
ag2-0.7.5.dist-info/NOTICE.md,sha256=07iCPQGbth4pQrgkSgZinJGT5nXddkZ6_MGYcBd2oiY,1134
|
|
4
|
+
ag2-0.7.5.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
5
|
+
ag2-0.7.5.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
6
|
+
ag2-0.7.5.dist-info/RECORD,,
|
ag2-0.7.4b2.dist-info/METADATA
DELETED
|
@@ -1,463 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: ag2
|
|
3
|
-
Version: 0.7.4b2
|
|
4
|
-
Summary: Alias package for pyautogen
|
|
5
|
-
Home-page: https://github.com/ag2ai/ag2
|
|
6
|
-
Author: Chi Wang & Qingyun Wu
|
|
7
|
-
Author-email: support@ag2.ai
|
|
8
|
-
License: Apache Software License 2.0
|
|
9
|
-
Platform: UNKNOWN
|
|
10
|
-
Classifier: Programming Language :: Python :: 3
|
|
11
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
12
|
-
Classifier: Operating System :: OS Independent
|
|
13
|
-
Requires-Python: >=3.9,<3.14
|
|
14
|
-
Description-Content-Type: text/markdown
|
|
15
|
-
License-File: LICENSE
|
|
16
|
-
License-File: NOTICE.md
|
|
17
|
-
Requires-Dist: pyautogen==0.7.4b2
|
|
18
|
-
Provides-Extra: anthropic
|
|
19
|
-
Requires-Dist: pyautogen[anthropic]==0.7.4b2; extra == "anthropic"
|
|
20
|
-
Provides-Extra: autobuild
|
|
21
|
-
Requires-Dist: pyautogen[autobuild]==0.7.4b2; extra == "autobuild"
|
|
22
|
-
Provides-Extra: bedrock
|
|
23
|
-
Requires-Dist: pyautogen[bedrock]==0.7.4b2; extra == "bedrock"
|
|
24
|
-
Provides-Extra: blendsearch
|
|
25
|
-
Requires-Dist: pyautogen[blendsearch]==0.7.4b2; extra == "blendsearch"
|
|
26
|
-
Provides-Extra: browser-use
|
|
27
|
-
Requires-Dist: pyautogen[browser-use]==0.7.4b2; extra == "browser-use"
|
|
28
|
-
Provides-Extra: captainagent
|
|
29
|
-
Requires-Dist: pyautogen[captainagent]==0.7.4b2; extra == "captainagent"
|
|
30
|
-
Provides-Extra: cerebras
|
|
31
|
-
Requires-Dist: pyautogen[cerebras]==0.7.4b2; extra == "cerebras"
|
|
32
|
-
Provides-Extra: cohere
|
|
33
|
-
Requires-Dist: pyautogen[cohere]==0.7.4b2; extra == "cohere"
|
|
34
|
-
Provides-Extra: commsagent-discord
|
|
35
|
-
Requires-Dist: pyautogen[commsagent-discord]==0.7.4b2; extra == "commsagent-discord"
|
|
36
|
-
Provides-Extra: commsagent-slack
|
|
37
|
-
Requires-Dist: pyautogen[commsagent-slack]==0.7.4b2; extra == "commsagent-slack"
|
|
38
|
-
Provides-Extra: commsagent-telegram
|
|
39
|
-
Requires-Dist: pyautogen[commsagent-telegram]==0.7.4b2; extra == "commsagent-telegram"
|
|
40
|
-
Provides-Extra: cosmosdb
|
|
41
|
-
Requires-Dist: pyautogen[cosmosdb]==0.7.4b2; extra == "cosmosdb"
|
|
42
|
-
Provides-Extra: crawl4ai
|
|
43
|
-
Requires-Dist: pyautogen[crawl4ai]==0.7.4b2; extra == "crawl4ai"
|
|
44
|
-
Provides-Extra: dev
|
|
45
|
-
Requires-Dist: pyautogen[dev]==0.7.4b2; extra == "dev"
|
|
46
|
-
Provides-Extra: docs
|
|
47
|
-
Requires-Dist: pyautogen[docs]==0.7.4b2; extra == "docs"
|
|
48
|
-
Provides-Extra: flaml
|
|
49
|
-
Requires-Dist: pyautogen[flaml]==0.7.4b2; extra == "flaml"
|
|
50
|
-
Provides-Extra: gemini
|
|
51
|
-
Requires-Dist: pyautogen[gemini]==0.7.4b2; extra == "gemini"
|
|
52
|
-
Provides-Extra: graph
|
|
53
|
-
Requires-Dist: pyautogen[graph]==0.7.4b2; extra == "graph"
|
|
54
|
-
Provides-Extra: graph-rag-falkor-db
|
|
55
|
-
Requires-Dist: pyautogen[graph-rag-falkor-db]==0.7.4b2; extra == "graph-rag-falkor-db"
|
|
56
|
-
Provides-Extra: groq
|
|
57
|
-
Requires-Dist: pyautogen[groq]==0.7.4b2; extra == "groq"
|
|
58
|
-
Provides-Extra: interop
|
|
59
|
-
Requires-Dist: pyautogen[interop]==0.7.4b2; extra == "interop"
|
|
60
|
-
Provides-Extra: interop-crewai
|
|
61
|
-
Requires-Dist: pyautogen[interop-crewai]==0.7.4b2; extra == "interop-crewai"
|
|
62
|
-
Provides-Extra: interop-langchain
|
|
63
|
-
Requires-Dist: pyautogen[interop-langchain]==0.7.4b2; extra == "interop-langchain"
|
|
64
|
-
Provides-Extra: interop-pydantic-ai
|
|
65
|
-
Requires-Dist: pyautogen[interop-pydantic-ai]==0.7.4b2; extra == "interop-pydantic-ai"
|
|
66
|
-
Provides-Extra: jupyter-executor
|
|
67
|
-
Requires-Dist: pyautogen[jupyter-executor]==0.7.4b2; extra == "jupyter-executor"
|
|
68
|
-
Provides-Extra: lint
|
|
69
|
-
Requires-Dist: pyautogen[lint]==0.7.4b2; extra == "lint"
|
|
70
|
-
Provides-Extra: lmm
|
|
71
|
-
Requires-Dist: pyautogen[lmm]==0.7.4b2; extra == "lmm"
|
|
72
|
-
Provides-Extra: long-context
|
|
73
|
-
Requires-Dist: pyautogen[long-context]==0.7.4b2; extra == "long-context"
|
|
74
|
-
Provides-Extra: mathchat
|
|
75
|
-
Requires-Dist: pyautogen[mathchat]==0.7.4b2; extra == "mathchat"
|
|
76
|
-
Provides-Extra: mistral
|
|
77
|
-
Requires-Dist: pyautogen[mistral]==0.7.4b2; extra == "mistral"
|
|
78
|
-
Provides-Extra: neo4j
|
|
79
|
-
Requires-Dist: pyautogen[neo4j]==0.7.4b2; extra == "neo4j"
|
|
80
|
-
Provides-Extra: ollama
|
|
81
|
-
Requires-Dist: pyautogen[ollama]==0.7.4b2; extra == "ollama"
|
|
82
|
-
Provides-Extra: rag
|
|
83
|
-
Requires-Dist: pyautogen[rag]==0.7.4b2; extra == "rag"
|
|
84
|
-
Provides-Extra: redis
|
|
85
|
-
Requires-Dist: pyautogen[redis]==0.7.4b2; extra == "redis"
|
|
86
|
-
Provides-Extra: retrievechat
|
|
87
|
-
Requires-Dist: pyautogen[retrievechat]==0.7.4b2; extra == "retrievechat"
|
|
88
|
-
Provides-Extra: retrievechat-mongodb
|
|
89
|
-
Requires-Dist: pyautogen[retrievechat-mongodb]==0.7.4b2; extra == "retrievechat-mongodb"
|
|
90
|
-
Provides-Extra: retrievechat-pgvector
|
|
91
|
-
Requires-Dist: pyautogen[retrievechat-pgvector]==0.7.4b2; extra == "retrievechat-pgvector"
|
|
92
|
-
Provides-Extra: retrievechat-qdrant
|
|
93
|
-
Requires-Dist: pyautogen[retrievechat-qdrant]==0.7.4b2; extra == "retrievechat-qdrant"
|
|
94
|
-
Provides-Extra: teachable
|
|
95
|
-
Requires-Dist: pyautogen[teachable]==0.7.4b2; extra == "teachable"
|
|
96
|
-
Provides-Extra: test
|
|
97
|
-
Requires-Dist: pyautogen[test]==0.7.4b2; extra == "test"
|
|
98
|
-
Provides-Extra: together
|
|
99
|
-
Requires-Dist: pyautogen[together]==0.7.4b2; extra == "together"
|
|
100
|
-
Provides-Extra: twilio
|
|
101
|
-
Requires-Dist: pyautogen[twilio]==0.7.4b2; extra == "twilio"
|
|
102
|
-
Provides-Extra: types
|
|
103
|
-
Requires-Dist: pyautogen[types]==0.7.4b2; extra == "types"
|
|
104
|
-
Provides-Extra: websockets
|
|
105
|
-
Requires-Dist: pyautogen[websockets]==0.7.4b2; extra == "websockets"
|
|
106
|
-
Provides-Extra: websurfer
|
|
107
|
-
Requires-Dist: pyautogen[websurfer]==0.7.4b2; extra == "websurfer"
|
|
108
|
-
|
|
109
|
-
<a name="readme-top"></a>
|
|
110
|
-
|
|
111
|
-

|
|
112
|
-
[](https://badge.fury.io/py/autogen)
|
|
113
|
-
[](https://github.com/ag2ai/ag2/actions/workflows/python-package.yml)
|
|
114
|
-

|
|
115
|
-
[](https://discord.gg/pAbnFJrkgZ)
|
|
116
|
-
[](https://x.com/ag2oss)
|
|
117
|
-
|
|
118
|
-
<!-- [](https://badge.fury.io/nu/AutoGen.Core) -->
|
|
119
|
-
|
|
120
|
-
# [AG2](https://github.com/ag2ai/ag2)
|
|
121
|
-
|
|
122
|
-
## Key Features
|
|
123
|
-
- 🤖 Multi-Agent Framework - Build and orchestrate AI agent interactions
|
|
124
|
-
- 🔧 Flexible Integration - Support for various LLMs (OpenAI, Anthropic, Gemini, etc.)
|
|
125
|
-
- 🛠 Tool Usage - Agents can use external tools and execute code
|
|
126
|
-
- 👥 Human-in-the-Loop - Seamless human participation when needed
|
|
127
|
-
- 🔄 Rich Orchestration Patterns - Agents can be organized in any form you like
|
|
128
|
-
- 🎯 Future-Oriented - Designed for solving difficult problems and harnessing latest and future technology
|
|
129
|
-
|
|
130
|
-
[📚 Documentation](https://docs.ag2.ai/) | [💡 Examples](https://github.com/ag2ai/build-with-ag2) | [🤝 Contributing](https://docs.ag2.ai/docs/contributor-guide/contributing)
|
|
131
|
-
|
|
132
|
-
[📚 Cite paper](#related-papers).
|
|
133
|
-
|
|
134
|
-
<!-- <p align="center">
|
|
135
|
-
<img src="https://github.com/ag2ai/ag2/blob/main/website/static/img/flaml.svg" width=200>
|
|
136
|
-
<br>
|
|
137
|
-
</p> -->
|
|
138
|
-
|
|
139
|
-
> **🎉 IMPORTANT**
|
|
140
|
-
>
|
|
141
|
-
> 🔥 🎉 **Nov 11, 2024:** We are evolving AutoGen into **AG2**!
|
|
142
|
-
> A new organization [AG2AI](https://github.com/ag2ai) is created to host the development of AG2 and related projects with open governance. Check [AG2's new look](https://ag2.ai/).
|
|
143
|
-
>
|
|
144
|
-
> We invite collaborators from all organizations and individuals to join the development.
|
|
145
|
-
|
|
146
|
-
🔥 🎉 AG2 is available via `pyautogen` (or its alias `autogen` or `ag2`) on PyPI!
|
|
147
|
-
|
|
148
|
-
```
|
|
149
|
-
pip install pyautogen
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
📄 **License:**
|
|
153
|
-
We adopt the Apache 2.0 license from v0.3. This enhances our commitment to open-source collaboration while providing additional protections for contributors and users alike.
|
|
154
|
-
|
|
155
|
-
🎉 May 29, 2024: DeepLearning.ai launched a new short course [AI Agentic Design Patterns with AutoGen](https://www.deeplearning.ai/short-courses/ai-agentic-design-patterns-with-autogen), made in collaboration with Microsoft and Penn State University, and taught by AutoGen creators [Chi Wang](https://github.com/sonichi) and [Qingyun Wu](https://github.com/qingyun-wu).
|
|
156
|
-
|
|
157
|
-
🎉 May 24, 2024: Foundation Capital published an article on [Forbes: The Promise of Multi-Agent AI](https://www.forbes.com/sites/joannechen/2024/05/24/the-promise-of-multi-agent-ai/?sh=2c1e4f454d97) and a video [AI in the Real World Episode 2: Exploring Multi-Agent AI and AutoGen with Chi Wang](https://www.youtube.com/watch?v=RLwyXRVvlNk).
|
|
158
|
-
|
|
159
|
-
🎉 May 13, 2024: [The Economist](https://www.economist.com/science-and-technology/2024/05/13/todays-ai-models-are-impressive-teams-of-them-will-be-formidable) published an article about multi-agent systems (MAS) following a January 2024 interview with [Chi Wang](https://github.com/sonichi).
|
|
160
|
-
|
|
161
|
-
🎉 May 11, 2024: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation](https://openreview.net/pdf?id=uAjxFFing2) received the best paper award at the [ICLR 2024 LLM Agents Workshop](https://llmagents.github.io/).
|
|
162
|
-
|
|
163
|
-
<!-- 🎉 Apr 26, 2024: [AutoGen.NET](https://docs.ag2.ai/ag2-for-net/) is available for .NET developers! -->
|
|
164
|
-
|
|
165
|
-
🎉 Apr 17, 2024: Andrew Ng cited AutoGen in [The Batch newsletter](https://www.deeplearning.ai/the-batch/issue-245/) and [What's next for AI agentic workflows](https://youtu.be/sal78ACtGTc?si=JduUzN_1kDnMq0vF) at Sequoia Capital's AI Ascent (Mar 26).
|
|
166
|
-
|
|
167
|
-
🎉 Mar 3, 2024: What's new in AutoGen? 📰[Blog](https://docs.ag2.ai/blog/2024-03-03-AutoGen-Update); 📺[Youtube](https://www.youtube.com/watch?v=j_mtwQiaLGU).
|
|
168
|
-
|
|
169
|
-
<!-- 🎉 Mar 1, 2024: the first AutoGen multi-agent experiment on the challenging [GAIA](https://huggingface.co/spaces/gaia-benchmark/leaderboard) benchmark achieved the No. 1 accuracy in all the three levels. -->
|
|
170
|
-
|
|
171
|
-
<!-- 🎉 Jan 30, 2024: AutoGen is highlighted by Peter Lee in Microsoft Research Forum [Keynote](https://t.co/nUBSjPDjqD). -->
|
|
172
|
-
|
|
173
|
-
🎉 Dec 31, 2023: [AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework](https://arxiv.org/abs/2308.08155) is selected by [TheSequence: My Five Favorite AI Papers of 2023](https://thesequence.substack.com/p/my-five-favorite-ai-papers-of-2023).
|
|
174
|
-
|
|
175
|
-
<!-- 🔥 Nov 24: pyautogen [v0.2](https://github.com/ag2ai/ag2/releases/tag/v0.2.0) is released with many updates and new features compared to v0.1.1. It switches to using openai-python v1. Please read the [migration guide](https://docs.ag2.ai/docs/installation/Installation). -->
|
|
176
|
-
|
|
177
|
-
<!-- 🔥 Nov 11: OpenAI's Assistants are available in AutoGen and interoperatable with other AutoGen agents! Checkout our [blogpost](https://docs.ag2.ai/blog/2023-11-13-OAI-assistants) for details and examples. -->
|
|
178
|
-
|
|
179
|
-
🎉 Nov 8, 2023: AutoGen is selected into [Open100: Top 100 Open Source achievements](https://www.benchcouncil.org/evaluation/opencs/annual.html) 35 days after spinoff from [FLAML](https://github.com/microsoft/FLAML).
|
|
180
|
-
|
|
181
|
-
<!-- 🎉 Nov 6, 2023: AutoGen is mentioned by Satya Nadella in a [fireside chat](https://youtu.be/0pLBvgYtv6U). -->
|
|
182
|
-
|
|
183
|
-
<!-- 🎉 Nov 1, 2023: AutoGen is the top trending repo on GitHub in October 2023. -->
|
|
184
|
-
|
|
185
|
-
<!-- 🎉 Oct 03, 2023: AutoGen spins off from [FLAML](https://github.com/microsoft/FLAML) on GitHub. -->
|
|
186
|
-
|
|
187
|
-
<!-- 🎉 Aug 16: Paper about AutoGen on [arxiv](https://arxiv.org/abs/2308.08155). -->
|
|
188
|
-
|
|
189
|
-
🎉 Mar 29, 2023: AutoGen is first created in [FLAML](https://github.com/microsoft/FLAML).
|
|
190
|
-
|
|
191
|
-
<!--
|
|
192
|
-
🔥 FLAML is highlighted in OpenAI's [cookbook](https://github.com/openai/openai-cookbook#related-resources-from-around-the-web).
|
|
193
|
-
|
|
194
|
-
🔥 [autogen](https://docs.ag2.ai/) is released with support for ChatGPT and GPT-4, based on [Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference](https://arxiv.org/abs/2303.04673).
|
|
195
|
-
|
|
196
|
-
🔥 FLAML supports Code-First AutoML & Tuning – Private Preview in [Microsoft Fabric Data Science](https://learn.microsoft.com/en-us/fabric/data-science/). -->
|
|
197
|
-
|
|
198
|
-
## What is AG2
|
|
199
|
-
|
|
200
|
-
AG2 (formerly AutoGen) is an open-source AgentOS for building AI agents and facilitating cooperation among multiple agents to solve tasks. AG2 provides fundamental building blocks needed to create, deploy, and manage AI agents that can work together to solve complex problems.
|
|
201
|
-
|
|
202
|
-
### Core Concepts
|
|
203
|
-
- **Agents**: Stateful entities that can send messages, receive messages, and generate replies using underlying capabilities powered by LLMs, non-LLM tools, or human inputs. Depending on the underlying capability, an agent may reason, plan, execute tasks or involve other agents before generating a reply.
|
|
204
|
-
- **Conversations**: Structured communication patterns between agents.
|
|
205
|
-
|
|
206
|
-
**Open Source Statement**: The project welcomes contributions from developers and organizations worldwide. Our goal is to foster a collaborative and inclusive community where diverse perspectives and expertise can drive innovation and enhance the project's capabilities. Whether you are an individual contributor or represent an organization, we invite you to join us in shaping the future of this project. Together, we can build something truly remarkable.
|
|
207
|
-
|
|
208
|
-
The project is currently maintained by a [dynamic group of volunteers](MAINTAINERS.md) from several organizations. Contact project administrators Chi Wang and Qingyun Wu via [support@ag2.ai](mailto:support@ag2.ai) if you are interested in becoming a maintainer.
|
|
209
|
-
|
|
210
|
-

|
|
211
|
-
|
|
212
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
213
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
214
|
-
↑ Back to Top ↑
|
|
215
|
-
</a>
|
|
216
|
-
</p>
|
|
217
|
-
|
|
218
|
-
<!--
|
|
219
|
-
## Roadmaps
|
|
220
|
-
-->
|
|
221
|
-
|
|
222
|
-
## Quickstart
|
|
223
|
-
|
|
224
|
-
The easiest way to start playing is
|
|
225
|
-
|
|
226
|
-
1. Click below to use the GitHub Codespace
|
|
227
|
-
|
|
228
|
-
[](https://codespaces.new/ag2ai/ag2?quickstart=1)
|
|
229
|
-
|
|
230
|
-
2. Copy OAI_CONFIG_LIST_sample to ./notebook folder, name to OAI_CONFIG_LIST, and set the correct configuration.
|
|
231
|
-
3. Start playing with the notebooks!
|
|
232
|
-
|
|
233
|
-
_NOTE_: OAI_CONFIG_LIST_sample lists gpt-4o as the default model. If you use a different model, you may need to revise various system prompts (especially if using weaker models like gpt-4o-mini). Proceed with caution when updating this default and be aware of additional risks related to alignment and safety.
|
|
234
|
-
|
|
235
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
236
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
237
|
-
↑ Back to Top ↑
|
|
238
|
-
</a>
|
|
239
|
-
</p>
|
|
240
|
-
|
|
241
|
-
## [Installation](https://docs.ag2.ai/docs/installation/Installation)
|
|
242
|
-
|
|
243
|
-
### Option 1. Install and Run AG2 in Docker
|
|
244
|
-
|
|
245
|
-
Find detailed instructions for users [here](https://docs.ag2.ai/docs/installation/Docker#step-1-install-docker), and for developers [here](https://docs.ag2.ai/docs/contributor-guide/setup-development-environment).
|
|
246
|
-
|
|
247
|
-
### Option 2. Install AG2 Locally
|
|
248
|
-
|
|
249
|
-
AG2 requires **Python version >= 3.9, < 3.14**. It can be installed from pip:
|
|
250
|
-
|
|
251
|
-
```bash
|
|
252
|
-
pip install ag2
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Minimal dependencies are installed without extra options. You can install extra options based on the feature you need.
|
|
256
|
-
|
|
257
|
-
<!-- For example, use the following to install the dependencies needed by the [`blendsearch`](https://microsoft.github.io/FLAML/docs/Use-Cases/Tune-User-Defined-Function#blendsearch-economical-hyperparameter-optimization-with-blended-search-strategy) option.
|
|
258
|
-
```bash
|
|
259
|
-
pip install "autogen[blendsearch]"
|
|
260
|
-
``` -->
|
|
261
|
-
|
|
262
|
-
Find more options in [Installation](https://docs.ag2.ai/docs/Installation#option-2-install-autogen-locally-using-virtual-environment).
|
|
263
|
-
|
|
264
|
-
<!-- Each of the [`notebook examples`](https://github.com/ag2ai/ag2/tree/main/notebook) may require a specific option to be installed. -->
|
|
265
|
-
|
|
266
|
-
Even if you are installing and running AG2 locally outside of docker, the recommendation and default behavior of agents is to perform [code execution](https://docs.ag2.ai/docs/FAQ#if-you-want-to-run-code-execution-in-docker) in docker. Find more instructions and how to change the default behaviour [here](https://docs.ag2.ai/docs/FAQ#if-you-want-to-run-code-execution-locally).
|
|
267
|
-
|
|
268
|
-
For LLM inference configurations, check the [FAQs](https://docs.ag2.ai/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#llm-configuration).
|
|
269
|
-
|
|
270
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
271
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
272
|
-
↑ Back to Top ↑
|
|
273
|
-
</a>
|
|
274
|
-
</p>
|
|
275
|
-
|
|
276
|
-
## Multi-Agent Conversation Framework
|
|
277
|
-
|
|
278
|
-
AG2 enables the next-gen LLM applications with a generic [multi-agent conversation](https://docs.ag2.ai/docs/Use-Cases/agent_chat) framework. It offers customizable and conversable agents that integrate LLMs, tools, and humans.
|
|
279
|
-
By automating chat among multiple capable agents, one can easily make them collectively perform tasks autonomously or with human feedback, including tasks that require using tools via code.
|
|
280
|
-
|
|
281
|
-
Features of this use case include:
|
|
282
|
-
|
|
283
|
-
- **Multi-agent conversations**: AG2 agents can communicate with each other to solve tasks. This allows for more complex and sophisticated applications than would be possible with a single LLM.
|
|
284
|
-
- **Customization**: AG2 agents can be customized to meet the specific needs of an application. This includes the ability to choose the LLMs to use, the types of human input to allow, and the tools to employ.
|
|
285
|
-
- **Human participation**: AG2 seamlessly allows human participation. This means that humans can provide input and feedback to the agents as needed.
|
|
286
|
-
|
|
287
|
-
For [example](https://github.com/ag2ai/ag2/blob/main/test/twoagent.py),
|
|
288
|
-
|
|
289
|
-
```python
|
|
290
|
-
from autogen import AssistantAgent, UserProxyAgent, config_list_from_json
|
|
291
|
-
# Load LLM inference endpoints from an env variable or a file
|
|
292
|
-
# See https://docs.ag2.ai/docs/user-guide/advanced-concepts/llm-configuration-deep-dive#llm-configuration
|
|
293
|
-
# and OAI_CONFIG_LIST_sample
|
|
294
|
-
config_list = config_list_from_json(env_or_file="OAI_CONFIG_LIST")
|
|
295
|
-
# You can also set config_list directly as a list, for example, config_list = [{'model': 'gpt-4o', 'api_key': '<your OpenAI API key here>'},]
|
|
296
|
-
assistant = AssistantAgent("assistant", llm_config={"config_list": config_list})
|
|
297
|
-
user_proxy = UserProxyAgent("user_proxy", code_execution_config={"work_dir": "coding", "use_docker": False}) # IMPORTANT: set to True to run code in docker, recommended
|
|
298
|
-
user_proxy.initiate_chat(assistant, message="Plot a chart of NVDA and TESLA stock price change YTD.")
|
|
299
|
-
# This initiates an automated chat between the two agents to solve the task
|
|
300
|
-
```
|
|
301
|
-
|
|
302
|
-
This example can be run with
|
|
303
|
-
|
|
304
|
-
```python
|
|
305
|
-
python test/twoagent.py
|
|
306
|
-
```
|
|
307
|
-
|
|
308
|
-
After the repo is cloned.
|
|
309
|
-
The figure below shows an example conversation flow with AG2.
|
|
310
|
-
|
|
311
|
-

|
|
312
|
-
|
|
313
|
-
Alternatively, the [sample code](https://github.com/ag2ai/build-with-ag2/blob/main/samples/simple_chat.py) here allows a user to chat with an AG2 agent in ChatGPT style.
|
|
314
|
-
Please find more [code examples](https://docs.ag2.ai/docs/Examples#automated-multi-agent-chat) for this feature.
|
|
315
|
-
|
|
316
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
317
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
318
|
-
↑ Back to Top ↑
|
|
319
|
-
</a>
|
|
320
|
-
</p>
|
|
321
|
-
|
|
322
|
-
## Enhanced LLM Inferences
|
|
323
|
-
|
|
324
|
-
AG2 also helps maximize the utility out of the expensive LLMs such as gpt-4o. It offers enhanced LLM inference with powerful functionalities like caching, error handling, multi-config inference and templating.
|
|
325
|
-
|
|
326
|
-
<!-- For example, you can optimize generations by LLM with your own tuning data, success metrics, and budgets.
|
|
327
|
-
|
|
328
|
-
```python
|
|
329
|
-
# perform tuning for openai<1
|
|
330
|
-
config, analysis = autogen.Completion.tune(
|
|
331
|
-
data=tune_data,
|
|
332
|
-
metric="success",
|
|
333
|
-
mode="max",
|
|
334
|
-
eval_func=eval_func,
|
|
335
|
-
inference_budget=0.05,
|
|
336
|
-
optimization_budget=3,
|
|
337
|
-
num_samples=-1,
|
|
338
|
-
)
|
|
339
|
-
# perform inference for a test instance
|
|
340
|
-
response = autogen.Completion.create(context=test_instance, **config)
|
|
341
|
-
```
|
|
342
|
-
|
|
343
|
-
Please find more [code examples](https://docs.ag2.ai/docs/Examples#tune-gpt-models) for this feature. -->
|
|
344
|
-
|
|
345
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
346
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
347
|
-
↑ Back to Top ↑
|
|
348
|
-
</a>
|
|
349
|
-
</p>
|
|
350
|
-
|
|
351
|
-
## Documentation
|
|
352
|
-
|
|
353
|
-
You can find detailed documentation about AG2 [here](https://docs.ag2.ai/).
|
|
354
|
-
|
|
355
|
-
In addition, you can find:
|
|
356
|
-
|
|
357
|
-
- [Research](https://docs.ag2.ai/docs/Research), [blogposts](https://docs.ag2.ai/blog) around AG2, and [Transparency FAQs](https://github.com/ag2ai/ag2/blob/main/TRANSPARENCY_FAQS.md)
|
|
358
|
-
|
|
359
|
-
- [Discord](https://discord.gg/pAbnFJrkgZ)
|
|
360
|
-
|
|
361
|
-
- [Contributing guide](https://docs.ag2.ai/docs/contributor-guide/contributing)
|
|
362
|
-
|
|
363
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
364
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
365
|
-
↑ Back to Top ↑
|
|
366
|
-
</a>
|
|
367
|
-
</p>
|
|
368
|
-
|
|
369
|
-
## CookBook
|
|
370
|
-
|
|
371
|
-
Explore detailed implementations with sample code and applications to help you get started with AG2.
|
|
372
|
-
[Cookbook](https://github.com/ag2ai/build-with-ag2)
|
|
373
|
-
|
|
374
|
-
## Related Papers
|
|
375
|
-
|
|
376
|
-
[AutoGen](https://arxiv.org/abs/2308.08155)
|
|
377
|
-
|
|
378
|
-
```
|
|
379
|
-
@inproceedings{wu2023autogen,
|
|
380
|
-
title={AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework},
|
|
381
|
-
author={Qingyun Wu and Gagan Bansal and Jieyu Zhang and Yiran Wu and Beibin Li and Erkang Zhu and Li Jiang and Xiaoyun Zhang and Shaokun Zhang and Jiale Liu and Ahmed Hassan Awadallah and Ryen W White and Doug Burger and Chi Wang},
|
|
382
|
-
year={2023},
|
|
383
|
-
eprint={2308.08155},
|
|
384
|
-
archivePrefix={arXiv},
|
|
385
|
-
primaryClass={cs.AI}
|
|
386
|
-
}
|
|
387
|
-
```
|
|
388
|
-
|
|
389
|
-
[EcoOptiGen](https://arxiv.org/abs/2303.04673)
|
|
390
|
-
|
|
391
|
-
```
|
|
392
|
-
@inproceedings{wang2023EcoOptiGen,
|
|
393
|
-
title={Cost-Effective Hyperparameter Optimization for Large Language Model Generation Inference},
|
|
394
|
-
author={Chi Wang and Susan Xueqing Liu and Ahmed H. Awadallah},
|
|
395
|
-
year={2023},
|
|
396
|
-
booktitle={AutoML'23},
|
|
397
|
-
}
|
|
398
|
-
```
|
|
399
|
-
|
|
400
|
-
[MathChat](https://arxiv.org/abs/2306.01337)
|
|
401
|
-
|
|
402
|
-
```
|
|
403
|
-
@inproceedings{wu2023empirical,
|
|
404
|
-
title={An Empirical Study on Challenging Math Problem Solving with GPT-4},
|
|
405
|
-
author={Yiran Wu and Feiran Jia and Shaokun Zhang and Hangyu Li and Erkang Zhu and Yue Wang and Yin Tat Lee and Richard Peng and Qingyun Wu and Chi Wang},
|
|
406
|
-
year={2023},
|
|
407
|
-
booktitle={ArXiv preprint arXiv:2306.01337},
|
|
408
|
-
}
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
[AgentOptimizer](https://arxiv.org/pdf/2402.11359)
|
|
412
|
-
|
|
413
|
-
```
|
|
414
|
-
@article{zhang2024training,
|
|
415
|
-
title={Training Language Model Agents without Modifying Language Models},
|
|
416
|
-
author={Zhang, Shaokun and Zhang, Jieyu and Liu, Jiale and Song, Linxin and Wang, Chi and Krishna, Ranjay and Wu, Qingyun},
|
|
417
|
-
journal={ICML'24},
|
|
418
|
-
year={2024}
|
|
419
|
-
}
|
|
420
|
-
```
|
|
421
|
-
|
|
422
|
-
[StateFlow](https://arxiv.org/abs/2403.11322)
|
|
423
|
-
|
|
424
|
-
```
|
|
425
|
-
@article{wu2024stateflow,
|
|
426
|
-
title={StateFlow: Enhancing LLM Task-Solving through State-Driven Workflows},
|
|
427
|
-
author={Wu, Yiran and Yue, Tianwei and Zhang, Shaokun and Wang, Chi and Wu, Qingyun},
|
|
428
|
-
journal={arXiv preprint arXiv:2403.11322},
|
|
429
|
-
year={2024}
|
|
430
|
-
}
|
|
431
|
-
```
|
|
432
|
-
|
|
433
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
434
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
435
|
-
↑ Back to Top ↑
|
|
436
|
-
</a>
|
|
437
|
-
</p>
|
|
438
|
-
|
|
439
|
-
## Contributors Wall
|
|
440
|
-
|
|
441
|
-
<a href="https://github.com/ag2ai/ag2/graphs/contributors">
|
|
442
|
-
<img src="https://contrib.rocks/image?repo=ag2ai/ag2&max=204" />
|
|
443
|
-
</a>
|
|
444
|
-
|
|
445
|
-
<p align="right" style="font-size: 14px; color: #555; margin-top: 20px;">
|
|
446
|
-
<a href="#readme-top" style="text-decoration: none; color: blue; font-weight: bold;">
|
|
447
|
-
↑ Back to Top ↑
|
|
448
|
-
</a>
|
|
449
|
-
</p>
|
|
450
|
-
|
|
451
|
-
## License
|
|
452
|
-
|
|
453
|
-
This project is licensed under the [Apache License, Version 2.0 (Apache-2.0)](./LICENSE).
|
|
454
|
-
|
|
455
|
-
This project is a spin-off of [AutoGen](https://github.com/microsoft/autogen) and contains code under two licenses:
|
|
456
|
-
|
|
457
|
-
- The original code from https://github.com/microsoft/autogen is licensed under the MIT License. See the [LICENSE_original_MIT](./license_original/LICENSE_original_MIT) file for details.
|
|
458
|
-
|
|
459
|
-
- Modifications and additions made in this fork are licensed under the Apache License, Version 2.0. See the [LICENSE](./LICENSE) file for the full license text.
|
|
460
|
-
|
|
461
|
-
We have documented these changes for clarity and to ensure transparency with our user and contributor community. For more details, please see the [NOTICE](./NOTICE.md) file.
|
|
462
|
-
|
|
463
|
-
|
ag2-0.7.4b2.dist-info/RECORD
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
ag2-0.7.4b2.dist-info/LICENSE,sha256=GEFQVNayAR-S_rQD5l8hPdgvgyktVdy4Bx5-v90IfRI,11384
|
|
2
|
-
ag2-0.7.4b2.dist-info/METADATA,sha256=tOwx0qmts2xFCWyuxkMhODP5uBH5h5g_oeGHj7uhi4E,23715
|
|
3
|
-
ag2-0.7.4b2.dist-info/NOTICE.md,sha256=07iCPQGbth4pQrgkSgZinJGT5nXddkZ6_MGYcBd2oiY,1134
|
|
4
|
-
ag2-0.7.4b2.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
5
|
-
ag2-0.7.4b2.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
|
|
6
|
-
ag2-0.7.4b2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|