Back to Prompt Library
planning

Initial Agent Definition with Tools

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

Linked challenge: Build a Proactive Executive Assistant Agent with OpenAI Agents SDK

Format
Code-aware
Lines
31
Sections
4
Linked challenge
Build a Proactive Executive Assistant Agent with OpenAI Agents SDK

Prompt source

Original prompt text with formatting preserved for inspection.

31 lines
4 sections
No variables
1 code block
Using the OpenAI Agents SDK, define an initial `Assistant` with a `GPT-4o` model. Create a `tool` definition for scheduling calendar events (e.g., `schedule_calendar_event(title: str, start_time: str, end_time: str, attendees: list[str])`) and for sending short emails (e.g., `send_short_email(recipient: str, subject: str, body: str)`). Your agent should be instructed to act as a proactive executive assistant.

```python
from openai import OpenAI

client = OpenAI()

assistant = client.beta.assistants.create(
    name='Executive Assistant',
    instructions='You are a proactive executive assistant. Your goal is to manage the user\'s schedule, communications, and information flow efficiently. Always confirm actions before executing, unless explicitly told otherwise.',
    model='gpt-4o',
    tools=[
        {
            'type': 'function',
            'function': {
                'name': 'schedule_calendar_event',
                'description': 'Schedules a new event on the user\'s calendar.',
                'parameters': {
                    'type': 'object',
                    'properties': {
                        'title': {'type': 'string', 'description': 'Title of the event'},
                        'start_time': {'type': 'string', 'format': 'date-time', 'description': 'Start time in ISO 8601 format'},
                        'end_time': {'type': 'string', 'format': 'date-time', 'description': 'End time in ISO 8601 format'},
                        'attendees': {'type': 'array', 'items': {'type': 'string'}, 'description': 'List of email addresses of attendees'}
                    },
                    'required': ['title', 'start_time', 'end_time', 'attendees']
                }
            }
        },
        # Add send_short_email tool definition here
    ]
)
print(assistant)
```

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.