Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 133 additions & 0 deletions 1_foundations/community_contributions/kavyahj04/week01/day1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "6a773ad4",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "ae62ae1b",
"metadata": {},
"source": [
"<table style=\"margin: 0; text-align: left; width:100%\">\n",
" <tr>\n",
" <td>\n",
" <h2 style=\"color:#ff7800;\">Exercise</h2>\n",
" <span style=\"color:#ff7800;\">Now try this commercial application:<br/>\n",
" First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity.<br/>\n",
" Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution.<br/>\n",
" Finally have 3 third LLM call propose the Agentic AI solution. <br/>\n",
" We will cover this at up-coming labs, so don't worry if you're unsure.. just give it a try!\n",
" </span>\n",
" </td>\n",
" </tr>\n",
"</table>"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "309971e8",
"metadata": {},
"outputs": [],
"source": [
"import os\n",
"from dotenv import load_dotenv\n",
"from openai import OpenAI\n",
"from IPython.display import display, Markdown"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "06b2d898",
"metadata": {},
"outputs": [],
"source": [
"load_dotenv(override=True)\n",
"api_key = os.getenv(\"OPENAI_API_KEY\")\n",
"\n",
"if api_key:\n",
" print(f\"Open AI API Key found and key starts with - {api_key[0:9]}\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2b474363",
"metadata": {},
"outputs": [],
"source": [
"openai = OpenAI()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c5145587",
"metadata": {},
"outputs": [],
"source": [
"# First create the messages:\n",
"message = \"You are a helpful assistant who pick a business area that might be worth exploring for an Agentic AI opportunity.\"\n",
"messages = [{\"role\": \"user\", \"content\": \"Something here\"}]\n",
"\n",
"# Then make the first call:\n",
"\n",
"response = openai.chat.completions.create(model=\"gpt-5.4-mini\", messages=messages)\n",
"\n",
"# Then read the business idea:\n",
"\n",
"business_area = response.choices[0].message.content\n",
"\n",
"# And repeat! In the next message, include the business area within the message"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "cf562b90",
"metadata": {},
"outputs": [],
"source": [
"messages = [{\"role\": \"user\", \"content\": f\"Here is the business area: {business_area} present a pain point in this industry.\"}]\n",
"\n",
"response = openai.chat.completions.create(model=\"gpt-5.4-mini\", messages=messages)\n",
"\n",
"pain_point = response.choices[0].message.content\n",
"\n",
"# And repeat! In the next message, include the business area within the message\n",
"messages = [{\"role\": \"user\", \"content\": f\"Here is the business area: {business_area} present a pain point in this industry{pain_point}, propose the Agentic AI solution.While proposing follow this structure. 1. Business Area 2. Pain Point 3. Agentic AI solution\"}]\n",
"\n",
"response = openai.chat.completions.create(model=\"gpt-5.4-mini\", messages=messages)\n",
"\n",
"agentic_solution = response.choices[0].message.content\n",
"\n",
"display(Markdown(agentic_solution))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.12"
}
},
"nbformat": 4,
"nbformat_minor": 5
}