Back to Prompt Library
implementation
Implement OpenAI Agents SDK Workflow
Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.
Linked challenge: Agentic System for Global AI Product Competitive Intelligence
Format
Code-aware
Lines
6
Sections
1
Linked challenge
Agentic System for Global AI Product Competitive Intelligence
Prompt source
Original prompt text with formatting preserved for inspection.
6 lines
1 sections
No variables
1 code block
Implement the core workflow for your competitive intelligence system using the OpenAI Agents SDK. Demonstrate how the 'Data Gatherer' agent uses tool calls (enabled by Claude 4 Sonnet) to fetch information. Show how the 'Market Analyst' receives this data, processes it, and potentially uses Portia AI for deeper insights. Integrate Ludwig to manage the handoff and dependencies between agents. Include relevant Python code snippets for agent initialization and task execution. ```python
from openai import OpenAI client = OpenAI() # Example tool definition for web scraping (you'll replace with actual tool)
def search_web(query: str): # Your web search/scrape logic here return f"Search results for {query}" # Create an Assistant (agent)
assistant = client.beta.assistants.create( name="Data Gatherer", instructions="You are an expert data gatherer for competitive intelligence. Use the provided tools to find relevant information.", model="Claude Sonnet 4", # Replace with your Claude 4 Sonnet integration model ID tools=[{"type": "function", "function": {"name": "search_web", "description": "Performs a web search.", "parameters": {"type": "object", "properties": {"query": {"type": "string", "description": "The search query."}}}}}],
) # Further implementation for threads, messages, and runs...
```Adaptation plan
Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.
Keep stable
Hold the task contract and output shape stable so generated implementations remain comparable.
Tune next
Update libraries, interfaces, and environment assumptions to match the stack you actually run.
Verify after
Test failure handling, edge cases, and any code paths that depend on hidden context or secrets.