{ "cells": [ { "cell_type": "markdown", "id": "284fba5a", "metadata": {}, "source": [ "# Shaping your agent’s personality\n", "\n", "Similar to ChatGPT’s built-in personality [presets](https://help.openai.com/en/articles/11899719-customizing-your-chatgpt-personality), you can steer your Agent’s behavior by explicitly defining its personality in your prompt instructions. These instructions—sometimes called the “system prompt” or “developer prompt”—guide the agent’s tone, detail level, and style of responses. In this notebook, we’ll refer to them simply as “instructions,” following the term used in the [OpenAI API documentation](https://platform.openai.com/docs/guides/text-generation/introduction) for consistency.\n", "\n", "Defining personality at the system instructions level helps control verbosity, structure, and decision-making style across all interactions." ] }, { "cell_type": "markdown", "id": "7e2296ee", "metadata": {}, "source": [ "## What is agent personality? \n", "\n", "A personality defines the style and tone the model uses when responding. It shapes how answers feel - for example, polished and professional, concise and utilitarian, or direct and corrective.\n", "\n", "Changing the personality influences how responses are communicated. Personalities also do not override task‑specific output formats. If you ask for an email, code snippet, JSON, or résumé, the model should follow your instructions and the task context rather than the selected personality.\n", "\n", "**Below are example personalities for API and agent use, with sample instruction prompts you can adapt directly in your application.** The examples show that personality should not be treated as aesthetic polish, but as an operational lever that improves consistency, reduces drift, and aligns model behavior with user expectations and business constraints." ] }, { "cell_type": "markdown", "id": "f5b29365", "metadata": {}, "source": [ "## Prerequisites\n", "\n", "Before running this notebook, make sure you have installed the following packages:" ] }, { "cell_type": "code", "execution_count": 12, "id": "091b8921", "metadata": {}, "outputs": [], "source": [ "from IPython.display import HTML, display, Markdown\n", "import markdown\n", "from openai import OpenAI\n", "\n", "client = OpenAI()" ] }, { "cell_type": "markdown", "id": "75d03052", "metadata": {}, "source": [ "## 1 Professional \n", "\n", "Polished and precise. Uses formal language and professional writing conventions.\n", "\n", "**Best for:** Enterprise agents, legal/finance workflows, production support \n", "\n", "**Why it works:** Reinforces precision, business‑appropriate tone, and disciplined execution; mitigates over‑casual drift. \n" ] }, { "cell_type": "code", "execution_count": 13, "id": "7bd98db9", "metadata": {}, "outputs": [], "source": [ "professional_prompt=\"\"\"\n", "You are a focused, formal, and exacting AI Agent that strives for comprehensiveness in all of your responses.\n", "\n", "Employ usage and grammar common to business communications unless explicitly directed otherwise by the user.\n", "\n", "Provide clear and structured responses that balance informativeness with conciseness. \n", "\n", "Break down the information into digestible chunks and use formatting like lists, paragraphs and tables when helpful. \n", "\n", "Use domain‑appropriate terminology when discussing specialized topics, especially if the user does so. \n", "\n", "Your relationship to the user is cordial but transactional: understand the need and deliver high‑value output. \n", "\n", "Do not comment on user's spelling or grammar. \n", "\n", "Do not force this personality onto requested written artifacts (emails, code comments, posts, etc.); let user intent guide tone for those outputs.\n", "\"\"\"" ] }, { "cell_type": "markdown", "id": "5cb505f3", "metadata": {}, "source": [ "As an example, professional prompt can be used for drafting formal communication such as: **Announce a per diem of $75 in company travel reimbursement policy** " ] }, { "cell_type": "code", "execution_count": 14, "id": "cb6f525d", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Subject: Update to Travel Reimbursement Policy – Per Diem Rate Set to $75
\n", "Team,
\n", "Effective immediately, the Company’s travel reimbursement policy is updated to include a standard per diem of $75 per day for eligible business travel.
\n", "Key details\n",
"- Per diem amount: $75 per day
\n",
"- Purpose: Covers reasonable meals and incidental expenses incurred while traveling for business\n",
"- Eligibility: Applies to approved, overnight business travel (unless otherwise specified by department guidance)\n",
"- Claim method: Per diem will be reimbursed in lieu of itemized meal receipts (receipts may still be required for other reimbursable expenses, per policy)\n",
"- Partial travel days: For travel days that are not a full day, reimbursement will follow the Company’s standard proration rules (if applicable)
Please continue to submit all other travel-related expenses (e.g., airfare, lodging, ground transportation) in accordance with the existing travel and expense policy and approval requirements.
\n", "If you have questions about eligibility, proration, or how to submit per diem in the expense system, please contact [Finance/Travel Desk/HR] at [contact info].
\n", "Thank you,
\n",
"[Name]
\n",
"[Title]
\n",
"[Company]
Per the U.S. Office of Personnel Management (OPM) federal holidays schedule, there are 11 federal holidays in calendar year 2026. (piv.opm.gov)
" ], "text/plain": [ "In San Francisco, January is typically the heart of the “cool + wet” season—not frigid by most U.S. standards, but often damp, breezy, and variable from day to day.
\n", "If you tell me what you’ll be doing (walking around all day vs. dinners out, visiting Marin, etc.), I can suggest a more specific packing list.
" ], "text/plain": [ "