Agent Integration Guides
Python
Connect AutoGen to Anoman AI
Set the base URL on AutoGen's OpenAI client config to add guardrails to every agent conversation — including multi-agent workflows and group chats.
Prerequisites
- An Anoman AI account with an active API key
- Python 3.9+
- AutoGen installed
Step 1: Install AutoGen
pip install pyautogenStep 2: Configure Anoman as the LLM
Pass an llm_config dict with Anoman's base URL. AutoGen uses this config for all agent completions.
import autogen
config_list = [
{
"model": "gpt-4o-mini",
"api_key": "anm-sk-your-key-here",
"base_url": "https://api.anoman.io/v1",
}
]
llm_config = {
"config_list": config_list,
"temperature": 0.7,
}Step 3: Define agents with Anoman config
assistant = autogen.AssistantAgent(
name="assistant",
llm_config=llm_config,
)
user_proxy = autogen.UserProxyAgent(
name="user_proxy",
human_input_mode="NEVER",
max_consecutive_auto_reply=3,
code_execution_config={"work_dir": "workspace"},
)
user_proxy.initiate_chat(
assistant,
message="Analyse the attached CSV and summarise the key findings.",
)Group chat with Anoman
Multi-agent group chats work identically — every LLM call in the conversation routes through Anoman.
researcher = autogen.AssistantAgent("researcher", llm_config=llm_config)
writer = autogen.AssistantAgent("writer", llm_config=llm_config)
critic = autogen.AssistantAgent("critic", llm_config=llm_config)
groupchat = autogen.GroupChat(
agents=[user_proxy, researcher, writer, critic],
messages=[],
max_round=6,
)
manager = autogen.GroupChatManager(groupchat=groupchat, llm_config=llm_config)
user_proxy.initiate_chat(manager, message="Write a research report on AI safety.")Guardrail transparency headers
X-Anoman-Guardrail-Injection: pass score=0.08
X-Anoman-Guardrail-Pii: pass
X-Anoman-Guardrail-Content: pass
X-Anoman-Cache: noneNeed help with your integration?
Join the Founding 50 for early access and direct support from the Anoman team.
Join Founding 50