@devries-cameron20 / composio-1 / commits / 1ea8ad9b3
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

docs: migrate AutoGen provider examples to ag2's LLMConfig API (#3833)

## Summary The AutoGen provider examples still used the legacy `llm_config={"config_list": [...]}` dict form, which ag2 0.14 (the distribution `composio-autogen` depends on since #3729) only keeps for backport compatibility and marks deprecated in `LLMConfig.ensure_config`. The install command also pulled `autogen-agentchat` (Microsoft's next-gen AutoGen package), which the provider never imports, while the `ag2` distribution the examples actually import from was only installed transitively. Fixes #3831 ## Changes - `docs/content/docs/providers/autogen.mdx`: example migrated to `LLMConfig({...})`, install line changed to `composio composio_autogen ag2`, added `ag2` keyword and a one-line note that the provider runs on the ag2 distribution - `python/providers/autogen/README.md`: same quickstart and install fixes - `python/providers/autogen/autogen_demo.py`: same `LLMConfig` migration `initiate_chat` is left as is: it isn't deprecated in ag2 0.14, and it's the flow `register_tools` (caller/executor) is verified against. ## Type of change - [ ] Bug fix - [ ] New feature - [ ] Refactor/Chore - [x] Documentation - [ ] Breaking change ## How Has This Been Tested? - Verified in a fresh venv with the local `composio` + `composio-autogen` packages and `ag2==0.14.0`: the updated example constructs both agents, wraps a Composio tool via `AutogenProvider`, registers it with `register_tools`, and executes it through the executor's function map - `uv run nox -s chk` (ruff + mypy): green - `ruff format --check providers/autogen/`: clean - Docs: `bun run build` and `bun run lint:links` from `docs/`: green ## Screenshots (if applicable) ## Checklist - [x] I have read the Code of Conduct and this PR adheres to it - [x] I ran linters/tests locally and they passed - [x] I updated documentation as needed - [ ] I added tests or explain why not applicable - [x] I added a changeset if this change affects published packages ## Additional context No changeset added: docs and Python-only change, no published TypeScript package affected. No tests added: example/docs change with no runtime code paths; the updated example was exercised manually against ag2 0.14 as described above. --------- Co-authored-by: Alberto Schiabel <jkomyno@users.noreply.github.com> Co-authored-by: jkomyno <alberto@composio.dev>

Aditya Painuli committed Jul 14, 2026 at 16:30 UTC 1ea8ad9b3ff05cb545212d9f62de7d5114cfb16b
3 files changed +29 -13
docs/content/docs/providers/autogen.mdx
+12 -4
@@ -1,16 +1,18 @@
1 ---
2 title: AutoGen
3 description: Build an agent with AutoGen and enable it to use 1000+ tools with Composio.
4 -keywords: [autogen, microsoft autogen]
4 +keywords: [autogen, microsoft autogen, ag2]
5 ---
6
7 The AutoGen provider turns Composio tools into AutoGen [`FunctionTool`](https://microsoft.github.io/autogen/) objects and registers them with your agents. You connect an account, fetch the tools, register them with a caller and executor agent, and AutoGen handles the conversation and tool calls.
8
9 +The provider runs on the [`ag2`](https://github.com/ag2ai/ag2) distribution, the community-maintained continuation of AutoGen 0.2, so it works for AG2 projects out of the box.
10 +
11 <Steps>
12 <Step>
13 **Install**
14
13 -<PackageInstall ecosystem="python" packages="composio composio_autogen autogen-agentchat" />
15 +<PackageInstall ecosystem="python" packages="composio composio_autogen 'ag2[openai]'" />
16 </Step>
17
18 <Step>
@@ -30,7 +32,9 @@ OPENAI_API_KEY=xxxxxxxxx
32 **Create session and run**
33
34 ```python
33 -from autogen import AssistantAgent, UserProxyAgent
35 +import os
36 +
37 +from autogen import AssistantAgent, LLMConfig, UserProxyAgent
38 from composio import Composio
39 from composio_autogen import AutogenProvider
40
@@ -43,7 +47,11 @@ tools = session.tools()
47 chatbot = AssistantAgent(
48 "chatbot",
49 system_message="Reply TERMINATE when the task is done or when user's content is empty",
46 - llm_config={"config_list": [{"model": "gpt-5.2"}]},
50 + llm_config=LLMConfig({
51 + "api_type": "openai",
52 + "model": "gpt-5.2",
53 + "api_key": os.environ["OPENAI_API_KEY"],
54 + }),
55 )
56
57 user_proxy = UserProxyAgent(
python/providers/autogen/README.md
+9 -3
@@ -5,7 +5,7 @@ Adapts Composio tools to AutoGen `FunctionTool` objects and registers them with
5 ## Installation
6
7 ```bash
8 -pip install composio composio-autogen autogen-agentchat
8 +pip install composio composio-autogen 'ag2[openai]'
9 ```
10
11 Set `COMPOSIO_API_KEY` (from the [dashboard](https://dashboard.composio.dev/settings)) and `OPENAI_API_KEY` in your environment.
@@ -13,7 +13,9 @@ Set `COMPOSIO_API_KEY` (from the [dashboard](https://dashboard.composio.dev/sett
13 ## Quickstart
14
15 ```python
16 -from autogen import AssistantAgent, UserProxyAgent
16 +import os
17 +
18 +from autogen import AssistantAgent, LLMConfig, UserProxyAgent
19 from composio import Composio
20 from composio_autogen import AutogenProvider
21
@@ -26,7 +28,11 @@ tools = session.tools()
28 chatbot = AssistantAgent(
29 "chatbot",
30 system_message="Reply TERMINATE when the task is done or when user's content is empty",
29 - llm_config={"config_list": [{"model": "gpt-5.2"}]},
31 + llm_config=LLMConfig({
32 + "api_type": "openai",
33 + "model": "gpt-5.2",
34 + "api_key": os.environ["OPENAI_API_KEY"],
35 + }),
36 )
37
38 user_proxy = UserProxyAgent(
python/providers/autogen/autogen_demo.py
+8 -6
@@ -1,7 +1,7 @@
1 import os
2
3 import dotenv
4 -from autogen import AssistantAgent, UserProxyAgent
4 +from autogen import AssistantAgent, LLMConfig, UserProxyAgent
5 from composio_autogen import AutogenProvider
6
7 from composio import Composio
@@ -20,11 +20,13 @@ def main():
20 chatbot = AssistantAgent(
21 "chatbot",
22 system_message="Reply TERMINATE when the task is done or when user's content is empty",
23 - llm_config={
24 - "config_list": [
25 - {"model": "gpt-5", "api_key": os.environ["OPENAI_API_KEY"]},
26 - ]
27 - },
23 + llm_config=LLMConfig(
24 + {
25 + "api_type": "openai",
26 + "model": "gpt-5",
27 + "api_key": os.environ["OPENAI_API_KEY"],
28 + }
29 + ),
30 )
31
32 # Create a user proxy agent