Skip to main content
Loading navigation
Back to prompt library

Orchestrate Agent Collaboration

Linked challenge: AI Code Audit & Optimization Agent

Prompt source

implementation1 lines1 sectionsNo variables0 checklist items
Using the OpenAI Agents SDK (specifically `client.beta.threads.runs.create`), orchestrate a multi-turn conversation where your primary 'Code Lead Agent' calls the `analyze_python_code` tool. Based on the tool's output, design the agent's response to either suggest fixes directly or delegate further analysis to a specialized 'Security Reviewer Agent' or 'Performance Optimizer Agent'. Demonstrate how agents share context and refine their findings based on subsequent tool calls or internal reasoning. Ensure proper `tool_output` handling.