⚡ AutoGen Integration

How to Publish Podcasts with AutoGen Podcast Hosting API

AutoGen's conversational agent framework lets you build multi-turn podcast production workflows. A UserProxyAgent can handle file uploads while an AssistantAgent orchestrates the full publishing pipeline through PodClaw's API.

Prerequisites

You will need the following before starting:

pip install pyautogen requests

Quick Start

The pattern for AutoGen is to define plain Python functions for each PodClaw operation, then declare them in the llm_config functions list so the AssistantAgent knows they exist. The UserProxyAgent's function_map routes calls to the actual implementations.

python — autogen_podclaw.py
import requests import autogen PODCLAW_API_KEY = "pc_your_api_key_here" # Define PodClaw tool functions def create_show(title: str, description: str, category: str = "Technology") -> dict: """Create a new podcast show on PodClaw.""" response = requests.post( "https://podclaw.io/api/shows", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={"title": title, "description": description, "category": category} ) return response.json() def publish_episode(show_id: str, title: str, audio_url: str, description: str = "") -> dict: """Publish an episode to Apple Podcasts, Spotify, and 20+ platforms.""" response = requests.post( f"https://podclaw.io/api/shows/{show_id}/episodes", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"}, json={ "title": title, "description": description, "audio_url": audio_url, "status": "published" } ) return response.json() def get_show_analytics(show_id: str) -> dict: """Get download analytics for a podcast show.""" response = requests.get( f"https://podclaw.io/api/shows/{show_id}/analytics", headers={"Authorization": f"Bearer {PODCLAW_API_KEY}"} ) return response.json() # AutoGen config config_list = [{"model": "gpt-4o", "api_key": "your-openai-key"}] llm_config = { "config_list": config_list, "functions": [ { "name": "create_show", "description": "Create a new podcast show on PodClaw", "parameters": { "type": "object", "properties": { "title": {"type": "string"}, "description": {"type": "string"}, "category": {"type": "string", "default": "Technology"} }, "required": ["title", "description"] } }, { "name": "publish_episode", "description": "Publish a podcast episode to Apple Podcasts, Spotify, and 20+ platforms", "parameters": { "type": "object", "properties": { "show_id": {"type": "string"}, "title": {"type": "string"}, "audio_url": {"type": "string"}, "description": {"type": "string"} }, "required": ["show_id", "title", "audio_url"] } } ] } # Create agents assistant = autogen.AssistantAgent( name="PodcastAssistant", llm_config=llm_config, system_message="You are a podcast production assistant. Use the PodClaw API tools to create shows and publish episodes." ) user_proxy = autogen.UserProxyAgent( name="UserProxy", human_input_mode="NEVER", max_consecutive_auto_reply=10, function_map={ "create_show": create_show, "publish_episode": publish_episode, "get_show_analytics": get_show_analytics } ) # Start the conversation user_proxy.initiate_chat( assistant, message="Create a podcast show called 'Startup Stories' about founder interviews. Then publish the first episode titled 'Building in Public' using audio from https://example.com/ep1.mp3" )

Closing the analytics loop

One of the most powerful patterns with AutoGen and PodClaw is using the analytics endpoint to give your agents feedback on what content resonates with listeners. After publishing, the AssistantAgent can be prompted to check download stats and use that data to inform future episode topics.

AutoGen 0.4 note: The example above uses the AutoGen 0.2 API (pyautogen). If you are using the new AutoGen 0.4 AgentChat API, register your PodClaw functions using the FunctionTool class and pass them to the agent's tools list. The PodClaw API calls remain identical.

Frequently Asked Questions

Does PodClaw work with AutoGen?

Yes. PodClaw works with AutoGen by registering publish and create functions as AutoGen tool calls in the llm_config. The AssistantAgent decides when to call PodClaw based on the conversation context, while the UserProxyAgent executes the actual HTTP requests through its function_map.

Can AutoGen agents upload audio files to PodClaw?

Yes. AutoGen agents can upload audio files to PodClaw using the /api/episodes upload endpoint with multipart/form-data, or pass a publicly accessible audio URL directly in the episode JSON payload. For most automation workflows, the URL approach is simpler: generate audio with a TTS API, upload to S3 or Cloudflare R2, and pass the URL to PodClaw.

Is PodClaw compatible with AutoGen 0.4+?

Yes. PodClaw works with both AutoGen 0.2 (pyautogen) and the new AutoGen 0.4 AgentChat API. Since PodClaw is a REST API, any version of AutoGen that supports function or tool calling can integrate with it. The HTTP requests to PodClaw are identical regardless of which AutoGen version you use.

Start automating podcast publishing with AutoGen

Get your free PodClaw API key and have your AutoGen agents publishing in minutes.

Get Started Free →