Initial Agent Definition with Tools

planningChallenge

Prompt Content

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)
```

Try this prompt

Open the workspace to execute this prompt with free credits, or use your own API keys for unlimited usage.

Usage Tips

Copy the prompt and paste it into your preferred AI tool (Claude, ChatGPT, Gemini)

Customize placeholder values with your specific requirements and context

For best results, provide clear examples and test different variations