Browse Source

Add files via upload

pull/83/head
Sanath Pabba 4 months ago committed by GitHub
parent
commit
1cfbde3e9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 99
      week1/community-contributions/day1_email_reviewer.ipynb

99
week1/community-contributions/day1_email_reviewer.ipynb

@ -72,7 +72,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"id": "4e2a9393-7767-488e-a8bf-27c12dca35bd",
"metadata": {},
"outputs": [],
@ -111,7 +111,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"id": "7b87cadb-d513-4303-baee-a37b6f938e4d",
"metadata": {},
"outputs": [
@ -143,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3",
"metadata": {},
"outputs": [],
@ -164,7 +164,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"id": "a58394bf-1e45-46af-9bfd-01e24da6f49a",
"metadata": {},
"outputs": [
@ -172,7 +172,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Hello! Welcome! I'm glad to see your first message here. How can I assist you today?\n"
"Hello! I’m glad to hear from you! How can I assist you today?\n"
]
}
],
@ -194,7 +194,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"id": "c5e793b2-6775-426a-a139-4848291d0463",
"metadata": {},
"outputs": [],
@ -224,7 +224,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97",
"metadata": {},
"outputs": [
@ -309,7 +309,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"id": "abdb8417-c5dc-44bc-9bee-2e059d162699",
"metadata": {},
"outputs": [],
@ -323,7 +323,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 9,
"id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c",
"metadata": {},
"outputs": [],
@ -341,7 +341,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 10,
"id": "26448ec4-5c00-4204-baec-7df91d11ff2e",
"metadata": {},
"outputs": [
@ -425,7 +425,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5",
"metadata": {},
"outputs": [],
@ -438,7 +438,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"id": "21ed95c5-7001-47de-a36d-1d6673b403ce",
"metadata": {},
"outputs": [
@ -446,7 +446,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Oh, are we doing basic math today? 2 + 2 equals 4. You’ve 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))"
]
},
{
"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. I’ve noticed that you haven’t been hitting the targets, and it’s something we need to address seriously.\n",
"\n",
"I know you’re capable of much more, and I want to see you succeed. That said, it’s crucial that you meet your sales targets this quarter. If there isn’t a significant improvement, we may have to consider other options, including letting you go, which I truly hope we can avoid.\n",
"\n",
"If there’s anything holding you back or if you need additional support, let me know. I’m here to help, but ultimately, it’s up to you to turn things around.\n",
"\n",
"Let’s 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. I’ve noticed that you haven’t been hitting the targets, and it’s something we need to address seriously.\n",
"\n",
"I know you’re capable of much more, and I want to see you succeed. That said, it’s crucial that you meet your sales targets this quarter. If there isn’t a significant improvement, we may have to consider other options, including letting you go, which I truly hope we can avoid.\n",
"\n",
"If there’s anything holding you back or if you need additional support, let me know. I’m here to help, but ultimately, it’s up to you to turn things around.\n",
"\n",
"Let’s 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",
"id": "36ed9f14-b349-40e9-a42c-b367e77f8bda",

Loading…
Cancel
Save