-
Notifications
You must be signed in to change notification settings - Fork 179
/
Copy pathpyproject.toml
381 lines (330 loc) · 10.3 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[metadata]
license_file = "LICENSE"
description-file = "README.md"
[project]
name = "pyautogen"
description = "A programming framework for agentic AI"
readme = "README.md"
authors = [
{name = "Chi Wang", email = "[email protected]"},
{name = "Qingyun Wu", email = "[email protected]"},
]
keywords = [
"ai",
"agent",
"autogen",
"ag2",
"pyautogen",
"ag2.ai",
"ag2ai",
"agentic"
]
requires-python = ">=3.9,<3.14"
dynamic = ["version"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development",
"Intended Audience :: Developers",
"Intended Audience :: Information Technology",
]
dependencies = [
"openai>=1.58",
"diskcache",
"termcolor",
"flaml",
# numpy is installed by flaml, but we want to pin the version to below 2.x (see https://github.com/microsoft/autogen/issues/1960)
"numpy>=2.1; python_version>='3.13'", # numpy 2.1+ required for Python 3.13
"numpy>=1.24.0,<2.0.0; python_version<'3.13'", # numpy 1.24+ for older Python versions
"python-dotenv",
"tiktoken",
# Disallowing 2.6.0 can be removed when this is fixed https://github.com/pydantic/pydantic/issues/8705
"pydantic>=2.6.1,<3",
"docker",
"packaging",
"websockets>=14,<15",
"asyncer==0.0.8",
"fast_depends>=2.4.12,<3",
]
[project.optional-dependencies]
# public distributions
jupyter-executor = [
"jupyter-kernel-gateway",
"websocket-client",
"requests",
"jupyter-client>=8.6.0",
"ipykernel>=6.29.0",
]
retrievechat = [
"protobuf==4.25.3",
"chromadb==0.5.3",
"sentence_transformers",
"pypdf",
"ipython",
"beautifulsoup4",
"markdownify",
]
retrievechat-pgvector = [
"pyautogen[retrievechat]",
"pgvector>=0.2.5",
"psycopg[binary]>=3.1.18; platform_system=='Windows' or platform_system=='Darwin'",
"psycopg>=3.1.18; platform_system=='Linux'",
]
retrievechat-mongodb = [
"pyautogen[retrievechat]",
"pymongo>=4.0.0",
]
retrievechat-qdrant = [
"pyautogen[retrievechat]",
"qdrant_client",
"fastembed>=0.3.1",
]
graph-rag-falkor-db = [
"graphrag_sdk==0.3.3",
"falkordb>=1.0.10"
]
neo4j = [
"docx2txt==0.8",
"llama-index==0.12.5",
"llama-index-graph-stores-neo4j==0.4.2",
"llama-index-core==0.12.5",
"llama-index-readers-web==0.3.3",
]
# used for agentchat_realtime_swarm notebook and realtime agent twilio demo
twilio = [
"fastapi>=0.115.0,<1",
"uvicorn>=0.30.6,<1",
"twilio>=9.3.2"
]
interop-crewai = [
"crewai[tools]>=0.86,<1; python_version>='3.10' and python_version<'3.13'",
"weaviate-client==4.10.2; python_version>='3.10' and python_version<'3.13'",
# crewai uses litellm, litellm introduced uvloop as deps with version 1.57.5 which does not support win32
"litellm<1.57.5; sys_platform=='win32'",
]
interop-langchain = ["langchain-community>=0.3.12,<1"]
interop-pydantic-ai = ["pydantic-ai==0.0.13"]
interop =[
"pyautogen[interop-crewai, interop-langchain, interop-pydantic-ai]",
]
# pysqlite3-binary used so it doesn't need to compile pysqlite3
autobuild = ["chromadb", "sentence-transformers", "huggingface-hub", "pysqlite3-binary"]
blendsearch = ["flaml[blendsearch]"]
mathchat = ["sympy", "pydantic==1.10.9", "wolframalpha"]
captainagent = ["pyautogen[autobuild]", "pandas"]
teachable = ["chromadb"]
lmm = ["replicate", "pillow"]
graph = ["networkx", "matplotlib"]
gemini = [
"google-generativeai>=0.5,<1",
"google-cloud-aiplatform",
"google-auth",
"pillow",
"pydantic",
"jsonschema",
]
together = ["together>=1.2"]
websurfer = ["beautifulsoup4", "markdownify", "pdfminer.six", "pathvalidate"]
redis = ["redis"]
cosmosdb = ["azure-cosmos>=4.2.0"]
websockets = ["websockets>=14.0,<15"]
long-context = ["llmlingua<0.3"]
anthropic = ["anthropic[vertex]>=0.23.1"]
cerebras = ["cerebras_cloud_sdk>=1.0.0"]
mistral = ["mistralai>=1.0.1"]
groq = ["groq>=0.9.0"]
cohere = ["cohere>=5.5.8"]
ollama = ["ollama>=0.4.5", "fix_busted_json>=0.0.18"]
bedrock = ["boto3>=1.34.149"]
## dev dependencies
# test dependencies
test = [
"ipykernel",
"nbconvert",
"nbformat",
"pre-commit",
"pytest-cov>=5",
"pytest-asyncio",
"pytest>=8,<9",
"pandas",
"fastapi>=0.115.0,<1",
]
docs = [
"pydoc-markdown",
"pyyaml==6.0.2",
"termcolor",
"nbclient",
]
types = [
"mypy==1.9.0",
"pyautogen[test, jupyter-executor, interop]",
]
lint = [
"ruff==0.9.1",
"codespell==2.3.0",
"pyupgrade-directories==0.3.0",
]
dev = [
"pyautogen[lint,test,types,docs]",
"pre-commit==4.0.1",
"detect-secrets==1.5.0",
"uv==0.5.16",
]
[project.urls]
Homepage = "https://ag2.ai/"
Documentation = "https://docs.ag2.ai/docs/Home"
Tracker = "https://github.com/ag2ai/ag2/issues"
Source = "https://github.com/ag2ai/ag2"
Discord = "https://discord.gg/pAbnFJrkgZ"
[tool.hatch.version]
path = "autogen/version.py"
[tool.hatch.build]
skip-excluded-dirs = true
exclude = ["/test", "/notebook"]
[tool.hatch.build.targets.wheel]
packages = ["autogen"]
only-include = ["autogen", "autogen/agentchat/contrib/captainagent/tools"]
[tool.hatch.build.targets.sdist]
exclude = ["test", "notebook"]
[tool.hatch.build.targets.wheel.sources]
"autogen" = "autogen"
"autogen/agentchat/contrib/captainagent/tools" = "autogen/agentchat/contrib/captainagent/tools"
[tool.pytest.ini_options]
addopts = '--cov=. --cov-append --cov-branch --cov-report=xml -m "not conda"'
testpaths = [
"test",
]
markers = [
"conda: test related to conda forge distribution",
"all",
"openai",
"gemini",
"anthropic",
"redis",
"docker",
]
[tool.black]
# https://github.com/psf/black
line-length = 120
exclude = "(.eggs|.git|.hg|.mypy_cache|.venv|_build|buck-out|build|dist)"
[tool.ruff]
fix = true
line-length = 120
target-version = 'py39'
#include = ["autogen", "test", "docs"]
#exclude = []
[tool.ruff.lint]
# Enable Pyflakes `E` and `F` codes by default.
select = [
"E", # pycodestyle errors https://docs.astral.sh/ruff/rules/#error-e
"W", # pycodestyle warnings https://docs.astral.sh/ruff/rules/#warning-w
"C90", # mccabe https://docs.astral.sh/ruff/rules/#mccabe-c90
"N", # pep8-naming https://docs.astral.sh/ruff/rules/#pep8-naming-n
# "D", # pydocstyle https://docs.astral.sh/ruff/rules/#pydocstyle-d
"I", # isort https://docs.astral.sh/ruff/rules/#isort-i
"F", # pyflakes https://docs.astral.sh/ruff/rules/#pyflakes-f
"ASYNC", # flake8-async https://docs.astral.sh/ruff/rules/#flake8-async-async
# "C4", # flake8-comprehensions https://docs.astral.sh/ruff/rules/#flake8-comprehensions-c4
# "B", # flake8-bugbear https://docs.astral.sh/ruff/rules/#flake8-bugbear-b
"Q", # flake8-quotes https://docs.astral.sh/ruff/rules/#flake8-quotes-q
# "T20", # flake8-print https://docs.astral.sh/ruff/rules/#flake8-print-t20
# "SIM", # flake8-simplify https://docs.astral.sh/ruff/rules/#flake8-simplify-sim
# "PT", # flake8-pytest-style https://docs.astral.sh/ruff/rules/#flake8-pytest-style-pt
# "PTH", # flake8-use-pathlib https://docs.astral.sh/ruff/rules/#flake8-use-pathlib-pth
# "TCH", # flake8-type-checking https://docs.astral.sh/ruff/rules/#flake8-type-checking-tch
# "RUF", # Ruff-specific rules https://docs.astral.sh/ruff/rules/#ruff-specific-rules-ruf
# "PERF", # Perflint https://docs.astral.sh/ruff/rules/#perflint-perf
"RUF022", # Sort __all__ https://docs.astral.sh/ruff/rules/unsorted-dunder-all/
]
ignore = ["E501", "F403", "C901",
"E402",
"E721",
"ASYNC109",
"E501", # line too long, handled by formatter later
"D100", "D101", "D102", "D103", "D104",
"C901", # too complex
]
# Exclude a variety of commonly ignored directories.
exclude = [
".eggs",
".git",
".mypy_cache",
".ruff_cache",
"__pypackages__",
"_build",
"build",
"dist",
"docs",
# This file needs to be either upgraded or removed and therefore should be
# ignore from type checking for now
"math_utils\\.py$",
]
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.isort]
case-sensitive = true
[tool.ruff.format]
docstring-code-format = true
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.mypy]
files = [
"autogen/logger",
"autogen/exception_utils.py",
"autogen/coding",
"autogen/oai/openai_utils.py",
"autogen/_pydantic.py",
"autogen/io",
"autogen/tools",
"autogen/interop",
"autogen/agentchat/realtime_agent",
"autogen/messages",
"test/test_pydantic.py",
"test/io",
"test/tools",
"test/interop",
"test/agentchat/realtime_agent",
"test/messages",
"test/conftest.py",
]
exclude = [
"autogen/math_utils\\.py",
"autogen/oai/completion\\.py",
"autogen/agentchat/contrib/compressible_agent\\.py",
"autogen/agentchat/contrib/math_user_proxy_agent.py",
"autogen/oai/openai_utils.py",
]
strict = true
ignore_missing_imports = true
install_types = true
non_interactive = true
plugins = ["pydantic.mypy"]
# remove after all files in the repo are fixed
follow_imports = "silent"
# from https://blog.wolt.com/engineering/2021/09/30/professional-grade-mypy-configuration/
disallow_untyped_defs = true
no_implicit_optional = true
check_untyped_defs = true
warn_return_any = true
show_error_codes = true
warn_unused_ignores = false
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_any_unimported = true