Add files via upload

This commit is contained in:
Sanath Pabba
2025-01-06 23:05:35 -05:00
committed by GitHub
parent d8b4c7d203
commit 1cfbde3e9f

View File

@@ -72,7 +72,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 1, "execution_count": 2,
"id": "4e2a9393-7767-488e-a8bf-27c12dca35bd", "id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -111,7 +111,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": 3,
"id": "7b87cadb-d513-4303-baee-a37b6f938e4d", "id": "7b87cadb-d513-4303-baee-a37b6f938e4d",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -143,7 +143,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 3, "execution_count": 4,
"id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3", "id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -164,7 +164,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 4, "execution_count": 5,
"id": "a58394bf-1e45-46af-9bfd-01e24da6f49a", "id": "a58394bf-1e45-46af-9bfd-01e24da6f49a",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -172,7 +172,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Hello! Welcome! I'm glad to see your first message here. How can I assist you today?\n" "Hello! Im glad to hear from you! How can I assist you today?\n"
] ]
} }
], ],
@@ -194,7 +194,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 5, "execution_count": 6,
"id": "c5e793b2-6775-426a-a139-4848291d0463", "id": "c5e793b2-6775-426a-a139-4848291d0463",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -224,7 +224,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 6, "execution_count": 7,
"id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97", "id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -309,7 +309,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 8,
"id": "abdb8417-c5dc-44bc-9bee-2e059d162699", "id": "abdb8417-c5dc-44bc-9bee-2e059d162699",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -323,7 +323,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 9,
"id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c", "id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -341,7 +341,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 9, "execution_count": 10,
"id": "26448ec4-5c00-4204-baec-7df91d11ff2e", "id": "26448ec4-5c00-4204-baec-7df91d11ff2e",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -425,7 +425,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 10, "execution_count": 11,
"id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5", "id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@@ -438,7 +438,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 11, "execution_count": 12,
"id": "21ed95c5-7001-47de-a36d-1d6673b403ce", "id": "21ed95c5-7001-47de-a36d-1d6673b403ce",
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
@@ -446,7 +446,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Oh, are we doing basic math today? 2 + 2 equals 4. Youve got this!\n" "Oh, we're starting with the basics, huh? Well, 2 + 2 equals 4. Shocking, I know!\n"
] ]
} }
], ],
@@ -856,6 +856,79 @@
"display(Markdown(response.choices[0].message.content))" "display(Markdown(response.choices[0].message.content))"
] ]
}, },
{
"cell_type": "code",
"execution_count": 14,
"id": "d4d641a5-0103-44a5-b5c2-70e80976d1f1",
"metadata": {},
"outputs": [
{
"data": {
"text/markdown": [
"**Subject:** Addressing Sales Performance Concerns\n",
"\n",
"Dear Akhil,\n",
"\n",
"I wanted to touch base with you about your sales performance over the last two quarters. Ive noticed that you havent been hitting the targets, and its something we need to address seriously.\n",
"\n",
"I know youre capable of much more, and I want to see you succeed. That said, its crucial that you meet your sales targets this quarter. If there isnt a significant improvement, we may have to consider other options, including letting you go, which I truly hope we can avoid.\n",
"\n",
"If theres anything holding you back or if you need additional support, let me know. Im here to help, but ultimately, its up to you to turn things around.\n",
"\n",
"Lets make this quarter count! Let me know if you want to discuss this further or need help strategizing.\n",
"\n",
"Best regards, \n",
"Sanath Pabba\n",
"\n",
"**Tone:** Serious yet supportive"
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"# Step 1: Create your prompts\n",
"\n",
"system_prompt = \"You are an AI assistant email reviewer. All you need is to identify the meaning of the context in the text given and provide the subject line and email. and in the end of text, please provide the tone info.\"\n",
"user_prompt = \"\"\"\n",
"Dear Akhil,\n",
"\n",
"I wanted to touch base with you about your sales performance over the last two quarters. Ive noticed that you havent been hitting the targets, and its something we need to address seriously.\n",
"\n",
"I know youre capable of much more, and I want to see you succeed. That said, its crucial that you meet your sales targets this quarter. If there isnt a significant improvement, we may have to consider other options, including letting you go, which I truly hope we can avoid.\n",
"\n",
"If theres anything holding you back or if you need additional support, let me know. Im here to help, but ultimately, its up to you to turn things around.\n",
"\n",
"Lets make this quarter count! Let me know if you want to discuss this further or need help strategizing.\n",
"\n",
"Best regards,\n",
"Sanath Pabba\n",
"\"\"\"\n",
"\n",
"# Step 2: Make the messages list\n",
"\n",
"messages = [\n",
" {\"role\":\"system\", \"content\": system_prompt},\n",
" {\"role\":\"user\", \"content\": user_prompt}\n",
" \n",
"] # fill this in\n",
"\n",
"# Step 3: Call OpenAI\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4o-mini\",\n",
" messages=messages\n",
")\n",
"\n",
"# Step 4: print the result\n",
"\n",
"display(Markdown(response.choices[0].message.content))"
]
},
{ {
"cell_type": "markdown", "cell_type": "markdown",
"id": "36ed9f14-b349-40e9-a42c-b367e77f8bda", "id": "36ed9f14-b349-40e9-a42c-b367e77f8bda",