Back to Prompt Library
planning

Initialize OpenAI Agent with o3 and Basic Tools

Inspect the original prompt language first, then copy or adapt it once you know how it fits your workflow.

Linked challenge: Policy Impact Analysis Agent

Format
Code-aware
Lines
6
Sections
1
Linked challenge
Policy Impact Analysis Agent

Prompt source

Original prompt text with formatting preserved for inspection.

6 lines
1 sections
No variables
1 code block
Start by setting up your OpenAI client and an agent. Configure it to use the o3 model. Define a basic 'read_document' tool that can simulate reading legislative texts. ```python
from openai import OpenAI client = OpenAI(api_key="YOUR_OPENAI_API_KEY") # Define a simple tool (function)
def read_document(document_content: str) -> str: return f"Successfully read document with content snippet: {document_content[:50]}..." # Create an OpenAI Assistant (Agent)
assistant = client.beta.assistants.create( name="Policy Analyst Agent", instructions="You are an expert policy analyst. Use your tools to analyze legislation and provide insights.", model="o3", # Using the o3 model tools=[ {"type": "function", "function": {"name": "read_document", "description": "Reads the content of a document", "parameters": {"type": "object", "properties": {"document_content": {"type": "string"}}}}}, ]
)
```

Adaptation plan

Keep the source stable, then change the prompt in a predictable order so the next run is easier to evaluate.

Keep stable

Preserve the role framing, objective, and reporting structure so comparison runs stay coherent.

Tune next

Swap in your own domain constraints, anomaly thresholds, and examples before you branch variants.

Verify after

Check whether the prompt asks for the right evidence, confidence signal, and escalation path.