Skip to content
Draft
Show file tree
Hide file tree
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
93 changes: 80 additions & 13 deletions 1_foundations/1_lab1.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@
"\n",
"import os\n",
"openai_api_key = os.getenv('OPENAI_API_KEY')\n",
"openai_base_url = os.getenv('OPENAI_BASE_URL') # access firm provided API\n",
"openai_model = \"gpt-5-nano-2025-08-07\" # access firm provided mdoel endpoint\n",
"\n",
"if openai_api_key:\n",
" print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n",
Expand Down Expand Up @@ -181,7 +183,7 @@
"# If you get a NameError - head over to the guides folder (guide 6)to learn about NameErrors - always instantly fixable\n",
"# If you're not using OpenAI, you just need to slightly modify this - precise instructions are in the AI APIs guide (guide 9)\n",
"\n",
"openai = OpenAI()"
"openai = OpenAI(api_key=openai_api_key, base_url=openai_base_url)\n"
]
},
{
Expand All @@ -207,7 +209,7 @@
"# If you get a NameError, head to the guides folder (guide 6) to learn about NameErrors - always instantly fixable\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=\"gpt-4.1-nano\",\n",
" model=openai_model,\n",
" messages=messages\n",
")\n",
"\n",
Expand Down Expand Up @@ -322,30 +324,90 @@
"metadata": {},
"outputs": [],
"source": [
"# First create the messages:\n",
"# Q1: \n",
"question = \"You are a senior venture capitalist with experience around the world on what markets are present, what are the trends, where are the fast growing opportunities. Pick a business area which is unexplored from an agentic AI oppurtunity perspective. Think from first principles and provide data based rationales.\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"messages = [{\"role\": \"user\", \"content\": \"Something here\"}]\n",
"response = openai.chat.completions.create(\n",
" model=openai_model,\n",
" messages=messages\n",
")\n",
"\n",
"# Then make the first call:\n",
"business_idea = response.choices[0].message.content\n",
"\n",
"response =\n",
"print(business_idea)\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"# Q2\n",
"\n",
"# Then read the business idea:\n",
"question = f\"\"\"\n",
"present a pain-point in the following business area/idea - something challenging that might be ripe for an Agentic solution\n",
"\n",
"business_idea = response.\n",
"{business_idea}\n",
"\"\"\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"# And repeat! In the next message, include the business idea within the message"
"response = openai.chat.completions.create(\n",
" model=openai_model,\n",
" messages=messages\n",
")\n",
"\n",
"opportunities = response.choices[0].message.content\n",
"\n",
"print(opportunities)\n"
]
},
{
"cell_type": "markdown",
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"\n",
"\n",
"# Q2\n",
"\n",
"question = f\"\"\"\n",
"propose the Agentic AI solution for following business idea considering it's pain points\n",
"---\n",
"Business idea:\n",
"{business_idea}\n",
"\n",
"---\n",
"Pain points:\n",
"{opportunities}\n",
"\"\"\"\n",
"messages = [{\"role\": \"user\", \"content\": question}]\n",
"\n",
"response = openai.chat.completions.create(\n",
" model=openai_model,\n",
" messages=messages\n",
")\n",
"\n",
"solution = response.choices[0].message.content\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"source": []
"outputs": [],
"source": [
"from IPython.display import Markdown, display\n",
"\n",
"display(Markdown(solution))\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"display_name": "Python 3.12.10 ('.venv': venv)",
"language": "python",
"name": "python3"
},
Expand All @@ -359,7 +421,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
"version": "3.12.10"
},
"vscode": {
"interpreter": {
"hash": "fb00a60d65a3c46c8a5f9d7b24f2a346cd4f17f0d7f92ab129f47d7a251c252d"
}
}
},
"nbformat": 4,
Expand Down
Loading