"# Load environment variables in a file called .env\n",
"\n",
@ -155,7 +163,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"id": "019974d9-f3ad-4a8a-b5f9-0a3719aea2d3",
"metadata": {},
"outputs": [],
@ -176,10 +184,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"id": "a58394bf-1e45-46af-9bfd-01e24da6f49a",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Hello! Welcome! I'm glad to hear from you. How can I assist you today?\n"
]
}
],
"source": [
"# To give you a preview -- calling OpenAI with these messages is this easy. Any problems, head over to the Troubleshooting notebook.\n",
"\n",
@ -198,7 +214,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "c5e793b2-6775-426a-a139-4848291d0463",
"metadata": {},
"outputs": [],
@ -228,10 +244,65 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "2ef960cf-6dc2-4cda-afb3-b38be12f4c97",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Home - Edward Donner\n",
"Home\n",
"Connect Four\n",
"Outsmart\n",
"An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n",
"About\n",
"Posts\n",
"Well, hi there.\n",
"I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n",
"very\n",
"amateur) and losing myself in\n",
"Hacker News\n",
", nodding my head sagely to things I only half understand.\n",
"I’m the co-founder and CTO of\n",
"Nebula.io\n",
". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n",
"acquired in 2021\n",
".\n",
"We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n",
"patented\n",
"our matching model, and our award-winning platform has happy customers and tons of press coverage.\n",
"Connect\n",
"with me for more!\n",
"January 23, 2025\n",
"LLM Workshop – Hands-on with Agents – resources\n",
"December 21, 2024\n",
"Welcome, SuperDataScientists!\n",
"November 13, 2024\n",
"Mastering AI and LLM Engineering – Resources\n",
"October 16, 2024\n",
"From Software Engineer to AI Data Scientist – resources\n",
"Navigation\n",
"Home\n",
"Connect Four\n",
"Outsmart\n",
"An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n",
"About\n",
"Posts\n",
"Get in touch\n",
"ed [at] edwarddonner [dot] com\n",
"www.edwarddonner.com\n",
"Follow me\n",
"LinkedIn\n",
"Twitter\n",
"Facebook\n",
"Subscribe to newsletter\n",
"Type your email…\n",
"Subscribe\n"
]
}
],
"source": [
"# Let's try one out. Change the website and add print statements to follow along.\n",
"\n",
@ -260,7 +331,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 7,
"id": "abdb8417-c5dc-44bc-9bee-2e059d162699",
"metadata": {},
"outputs": [],
@ -274,7 +345,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 8,
"id": "f0275b1b-7cfe-4f9d-abfa-7650d378da0c",
"metadata": {},
"outputs": [],
@ -292,10 +363,67 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 9,
"id": "26448ec4-5c00-4204-baec-7df91d11ff2e",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"You are looking at a website titled Home - Edward Donner\n",
"The contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\n",
"\n",
"Home\n",
"Connect Four\n",
"Outsmart\n",
"An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n",
"About\n",
"Posts\n",
"Well, hi there.\n",
"I’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\n",
"very\n",
"amateur) and losing myself in\n",
"Hacker News\n",
", nodding my head sagely to things I only half understand.\n",
"I’m the co-founder and CTO of\n",
"Nebula.io\n",
". We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\n",
"acquired in 2021\n",
".\n",
"We work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\n",
"patented\n",
"our matching model, and our award-winning platform has happy customers and tons of press coverage.\n",
"Connect\n",
"with me for more!\n",
"January 23, 2025\n",
"LLM Workshop – Hands-on with Agents – resources\n",
"December 21, 2024\n",
"Welcome, SuperDataScientists!\n",
"November 13, 2024\n",
"Mastering AI and LLM Engineering – Resources\n",
"October 16, 2024\n",
"From Software Engineer to AI Data Scientist – resources\n",
"Navigation\n",
"Home\n",
"Connect Four\n",
"Outsmart\n",
"An arena that pits LLMs against each other in a battle of diplomacy and deviousness\n",
"About\n",
"Posts\n",
"Get in touch\n",
"ed [at] edwarddonner [dot] com\n",
"www.edwarddonner.com\n",
"Follow me\n",
"LinkedIn\n",
"Twitter\n",
"Facebook\n",
"Subscribe to newsletter\n",
"Type your email…\n",
"Subscribe\n"
]
}
],
"source": [
"print(user_prompt_for(ed))"
]
@ -321,7 +449,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 10,
"id": "f25dcd35-0cd0-4235-9f64-ac37ed9eaaa5",
"metadata": {},
"outputs": [],
@ -334,10 +462,18 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 11,
"id": "21ed95c5-7001-47de-a36d-1d6673b403ce",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Oh, we’re diving into some tough math here! Well, let me put my genius hat on—2 + 2 equals 4. Shocking, I know!\n"
]
}
],
"source": [
"# To give you a preview -- calling OpenAI with system and user messages:\n",
"\n",
@ -355,7 +491,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 12,
"id": "0134dfa4-8299-48b5-b444-f2a8c3403c88",
"metadata": {},
"outputs": [],
@ -371,10 +507,24 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 13,
"id": "36478464-39ee-485c-9f3f-6a4e458dbc9c",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"[{'role': 'system',\n",
" 'content': 'You are an assistant that analyzes the contents of a website and provides a short summary, ignoring text that might be navigation related. Respond in markdown.'},\n",
" {'role': 'user',\n",
" 'content': 'You are looking at a website titled Home - Edward Donner\\nThe contents of this website is as follows; please provide a short summary of this website in markdown. If it includes news or announcements, then summarize these too.\\n\\nHome\\nConnect Four\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nWell, hi there.\\nI’m Ed. I like writing code and experimenting with LLMs, and hopefully you’re here because you do too. I also enjoy DJing (but I’m badly out of practice), amateur electronic music production (\\nvery\\namateur) and losing myself in\\nHacker News\\n, nodding my head sagely to things I only half understand.\\nI’m the co-founder and CTO of\\nNebula.io\\n. We’re applying AI to a field where it can make a massive, positive impact: helping people discover their potential and pursue their reason for being. Recruiters use our product today to source, understand, engage and manage talent. I’m previously the founder and CEO of AI startup untapt,\\nacquired in 2021\\n.\\nWe work with groundbreaking, proprietary LLMs verticalized for talent, we’ve\\npatented\\nour matching model, and our award-winning platform has happy customers and tons of press coverage.\\nConnect\\nwith me for more!\\nJanuary 23, 2025\\nLLM Workshop – Hands-on with Agents – resources\\nDecember 21, 2024\\nWelcome, SuperDataScientists!\\nNovember 13, 2024\\nMastering AI and LLM Engineering – Resources\\nOctober 16, 2024\\nFrom Software Engineer to AI Data Scientist – resources\\nNavigation\\nHome\\nConnect Four\\nOutsmart\\nAn arena that pits LLMs against each other in a battle of diplomacy and deviousness\\nAbout\\nPosts\\nGet in touch\\ned [at] edwarddonner [dot] com\\nwww.edwarddonner.com\\nFollow me\\nLinkedIn\\nTwitter\\nFacebook\\nSubscribe to newsletter\\nType your email…\\nSubscribe'}]"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Try this out, and then try for a few more websites\n",
"\n",
@ -391,7 +541,7 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 14,
"id": "905b9919-aba7-45b5-ae65-81b3d1d78e34",
"metadata": {},
"outputs": [],
@ -409,17 +559,28 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 15,
"id": "05e38d41-dfa4-4b20-9c96-c46ea75d9fb5",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/plain": [
"'# Summary of Edward Donner\\'s Website\\n\\nEdward Donner\\'s personal website serves as a platform for sharing his interests and expertise in artificial intelligence, particularly in the field of large language models (LLMs). He introduces himself as a coder and experimenter in this domain, while also mentioning his hobbies, including DJing and electronic music production. \\n\\n## Professional Background\\n- Co-founder and CTO of **Nebula.io**, focusing on leveraging AI to enhance talent discovery and engagement.\\n- Former founder and CEO of AI startup **untapt**, which was acquired in 2021.\\n- He highlights his work with proprietary LLMs and mentions a patented matching model used in his current endeavors.\\n\\n## Recent Posts and Announcements\\n- **January 23, 2025**: Shared resources related to a workshop on LLMs and agents.\\n- **December 21, 2024**: A warm welcome to a new audience, referred to as \"SuperDataScientists.\"\\n- **November 13, 2024**: Resources for mastering AI and LLM engineering were made available.\\n- **October 16, 2024**: He provided resources for software engineers transitioning to AI data scientists.\\n\\nThe site invites visitors to connect with Edward and explore his work further.'"
]
},
"execution_count": 15,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"summarize(\"https://edwarddonner.com\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 16,
"id": "3d926d59-450e-4609-92ba-2d6f244f1342",
"metadata": {},
"outputs": [],
@ -433,10 +594,34 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 17,
"id": "3018853a-445f-41ff-9560-d925d1774b2f",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"# Summary of Edward Donner's Website\n",
"\n",
"Edward Donner’s website serves as a personal and professional portfolio, showcasing his interests and expertise in coding, large language models (LLMs), and AI technologies. The website highlights his role as co-founder and CTO of Nebula.io, a company focused on leveraging AI to enhance talent discovery and management. He also shares his background as the founder of the AI startup untapt, which was acquired in 2021.\n",
"- **December 21, 2024**: Welcome note for SuperDataScientists.\n",
"- **November 13, 2024**: Mastering AI and LLM Engineering – resources shared.\n",
"- **October 16, 2024**: Resources for transitioning from Software Engineer to AI Data Scientist.\n",
"\n",
"In addition to his professional pursuits, Ed enjoys DJing and electronic music production, though he humorously notes his lack of practice. He welcomes connections from like-minded individuals interested in technology and AI."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display_summary(\"https://edwarddonner.com\")"
]
@ -459,20 +644,70 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 18,
"id": "45d83403-a24c-44b5-84ac-961449b4008f",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"# CNN Summary\n",
"\n",
"CNN is a major news outlet providing comprehensive coverage of breaking news, politics, world events, entertainment, and more. The website features categories including **US News, World, Politics, Business, Health, Entertainment, Sports, Science**, and **Climate**.\n",
"\n",
"### Latest News Highlights:\n",
"- Rory McIlroy won the Masters in a dramatic one-hole playoff.\n",
"- A suspect has been arrested for an arson attempt at Pennsylvania's Governor Shapiro's house.\n",
"- A tragically high-profile shooting incident in Wisconsin allegedly involved a 17-year-old implicated in a plot against Trump.\n",
"- A judge has ruled that a legal permanent US resident can be deported.\n",
"- In global matters, Israeli strikes have led to significant damage and humanitarian crises in Gaza.\n",
"\n",
"### Political Insights:\n",
"- Trump's administration announced temporary tariff exemptions affecting electronic imports from China, which has sparked political discourse.\n",
"- Elizabeth Warren has voiced concerns over potential insider trading amidst Trump's actions.\n",
"\n",
"### International Developments:\n",
"- Ongoing updates on the Ukraine-Russia War reveal significant escalations.\n",
"- Brazil's former president, Jair Bolsonaro, has been hospitalized due to complications from an old injury.\n",
"\n",
"### Additional Sections:\n",
"The site also features **a range of opinion pieces, essays, and analysis**, as well as sections dedicated to health, technology, travel, and entertainment, which include trends, analysis on cultural events, and festival highlights such as Coachella.\n",
"\n",
"CNN continues to emphasize the importance of audience engagement through interactive elements like newsletters and feedback opportunities. The platform provides a crucial space for staying informed about both domestic and international developments."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display_summary(\"https://cnn.com\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 22,
"id": "75e9fd40-b354-4341-991e-863ef2e59db7",
"metadata": {},
"outputs": [],
"outputs": [
{
"data": {
"text/markdown": [
"# Website Summary: Just a moment...\n",
"\n",
"The website appears to be a temporary loading page indicating that users need to enable JavaScript and cookies in their browser to access the content. There are no specific news or announcements provided on this page, as it primarily serves as an intermediary message before allowing further access to the intended site."
],
"text/plain": [
"<IPython.core.display.Markdown object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"display_summary(\"https://anthropic.com\")"
]
@ -511,30 +746,40 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 27,
"id": "00743dac-0e70-45b7-879a-d7293a6f68a6",
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"As of my last update in October 2023, I don't have real-time data access to provide the current GDP of India. However, India's GDP has been fluctuating due to various factors such as economic growth rates, inflation, and global market conditions. For the latest and most accurate GDP figures, I recommend checking reliable financial news sources, government publications, or databases such as the World Bank or International Monetary Fund (IMF). These sources will provide you with the most current statistics.\n"
]
}
],
"source": [
"# Step 1: Create your prompts\n",
"\n",
"system_prompt = \"something here\"\n",
"user_prompt = \"\"\"\n",
" Lots of text\n",
" Can be pasted here\n",
"system_prompt = \"You are an expert of financial advisor\"\n",
"user_prompt = \"\"\" What is current gdp of india\n",