Install & Compatibility
Where this runs
tested against v0.7.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 54MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 4.0s · import 0.000s · 55MB
46MB installed
● package 46MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
WebSearchTool
✓ from autogen_ext.tools.web_search import WebSearchTool
✗ from autogen_ext.web_search import WebSearchTool
This quickstart demonstrates how to integrate the `WebSearchTool` from `autogen-ext` into an AutoGen multi-agent conversation. It requires setting `OPENAI_API_KEY` and `SERPER_API_KEY` (e.g., from Serper.dev) as environment variables or directly in the code.
import os
import autogen
from autogen_extensions.web_search import WebSearchTool
# Configure LLM (replace with your actual configuration)
llm_config = {
"model": "gpt-4o", # or "gpt-4", "gpt-3.5-turbo"
"api_key": os.environ.get("OPENAI_API_KEY", "YOUR_OPENAI_API_KEY"),
}
# Create an AssistantAgent
assistant = autogen.AssistantAgent(
name="assistant",
llm_config=llm_config,
is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
)
# Create a UserProxyAgent
user_proxy = autogen.UserProxyAgent(
name="user_proxy",
is_termination_msg=lambda x: x.get("content", "").rstrip().endswith("TERMINATE"),
human_input_mode="NEVER",
max_consecutive_auto_reply=10,
llm_config=llm_config, # UserProxyAgent can also use LLM config for self-reflection
code_execution_config={"work_dir": "autogen_extension_work_dir"},
)
# Register the WebSearchTool (requires SERPER_API_KEY or similar)
# Get an API key from https://serper.dev or a similar search API provider.
web_search_tool = WebSearchTool(config={"api_key": os.environ.get("SERPER_API_KEY", None)})
user_proxy.register_for_execution(web_search_tool)
assistant.register_for_llm(web_search_tool)
# Start the conversation
print("\n--- Initiating chat with WebSearchTool ---\n")
user_proxy.initiate_chat(
assistant,
message="What's the capital of France and what are its main attractions? Use web search to find out.",
)
print("\n--- Chat finished ---\n")
Debug
Known issues
breaking`autogen-ext` is tightly coupled with specific versions of `autogen`. The current `autogen-ext` (v0.7.5) has a dependency constraint `autogen~=0.2.0` (i.e., `>=0.2.0, <0.3.0`). Using `autogen-ext` with newer versions of `autogen` (e.g., `autogen>=0.3.0` or even later `0.2.x` sub-versions that introduced breaking changes) will likely lead to runtime errors due to API changes in `autogen`.fixPin your `autogen` version to be compatible, e.g., `pip install autogen~=0.2.0`. Always check `autogen-ext`'s `pyproject.toml` or `setup.py` for the exact `autogen` dependency for your `autogen-ext` version.
affects: autogen-ext<=0.7.5` used with `autogen>=0.3.0` (or incompatible `0.2.x` releases).
gotchaTools like `WebSearchTool` often require their own dedicated API keys (e.g., `SERPER_API_KEY` for Serper API), separate from the `OPENAI_API_KEY` used for the LLM itself. Misconfiguring or omitting the tool-specific API key will result in search operations failing silently or with generic errors.fixAlways check tool-specific documentation for required API keys and ensure they are correctly provided, typically through environment variables or directly in the tool's `config` dictionary (e.g., `WebSearchTool(config={"api_key": os.environ.get("SERPER_API_KEY")})`). affects: All versions using tools requiring external service keys.
Upgrade
Version history
0.7.5latest on PyPI · released Sep 30, 2025
Audit
Dependencies
autogenrequiredCore multi-agent framework dependency, tightly coupled.
openairequiredRequired for LLM interactions.
diskcacheoptionalUsed for persistent agent memory.