diff --git a/.gitattributes b/.gitattributes index 1ef325f1b111266a6b26e0196871bd78baa8c2f3..ff69016e353068e5fe335a79c5c1256b42419ed4 100644 --- a/.gitattributes +++ b/.gitattributes @@ -57,3 +57,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text # Video files - compressed *.mp4 filter=lfs diff=lfs merge=lfs -text *.webm filter=lfs diff=lfs merge=lfs -text +data/2_openai/community_contributions/book_review/book_proposal.pdf filter=lfs diff=lfs merge=lfs -text +data/3_crew/stock_picker/memory/chroma.sqlite3 filter=lfs diff=lfs merge=lfs -text +data/4_langgraph/memory.db-wal filter=lfs diff=lfs merge=lfs -text diff --git a/data/.python-version b/data/.python-version new file mode 100644 index 0000000000000000000000000000000000000000..e4fba2183587225f216eeada4c78dfab6b2e65f5 --- /dev/null +++ b/data/.python-version @@ -0,0 +1 @@ +3.12 diff --git a/data/1_foundations/1_lab1.ipynb b/data/1_foundations/1_lab1.ipynb new file mode 100644 index 0000000000000000000000000000000000000000..0a059b23ad4eebe63d7514591362a1cf666241f4 --- /dev/null +++ b/data/1_foundations/1_lab1.ipynb @@ -0,0 +1,366 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Welcome to the start of your adventure in Agentic AI" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n",
+ " ![]() | \n",
+ " \n",
+ " Are you ready for action??\n", + " Have you completed all the setup steps in the setup folder?\n", + " Have you read the README? Many common questions are answered here! \n", + " Have you checked out the guides in the guides folder? \n", + " Well in that case, you're ready!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " This code is a live resource - keep an eye out for my updates\n", + " I push updates regularly. As people ask questions or have problems, I add more examples and improve explanations. As a result, the code below might not be identical to the videos, as I've added more steps and better comments. Consider this like an interactive book that accompanies the lectures.\n", + " I try to send emails regularly with important updates related to the course. You can find this in the 'Announcements' section of Udemy in the left sidebar. You can also choose to receive my emails via your Notification Settings in Udemy. I'm respectful of your inbox and always try to add value with my emails!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Final reminders\n", + " 1. If you're not confident about Environment Variables or Web Endpoints / APIs, please read Topics 3 and 5 in this technical foundations guide.\n", + " 2. If you want to use AIs other than OpenAI, like Gemini, DeepSeek or Ollama (free), please see the first section in this AI APIs guide. \n", + " 3. If you ever get a Name Error in Python, you can always fix it immediately; see the last section of this Python Foundations guide and follow both tutorials and exercises. \n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution. \n", + " We will cover this at up-coming labs, so don't worry if you're unsure.. just give it a try!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important point - please read\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, after watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Super important - ignore me at your peril!\n", + " The model called llama3.3 is FAR too large for home computers - it's not intended for personal computing and will consume all your resources! Stick with the nicely sized llama3.2 or llama3.2:1b and if you want larger, try llama3.1 or smaller variants of Qwen, Gemma, Phi or DeepSeek. See the the Ollama models page for a full list of models and sizes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " These kinds of patterns - to send a task to multiple models, and evaluate results,\n", + " are common where you need to improve the quality of your LLM response. This approach can be universally applied\n", + " to business projects where accuracy is critical.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Looking up packages\n", + " In this lab, we're going to use the wonderful Gradio package for building quick UIs, \n", + " and we're also going to use the popular PyPDF PDF reader. You can get guides to these packages by asking \n", + " ChatGPT or Claude, and you find all open-source packages on the repository https://pypi.org.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " • First and foremost, deploy this for yourself! It's a real, valuable tool - the future resume..\n", + " • Next, improve the resources - add better context about yourself. If you know RAG, then add a knowledge base about you. \n", + " • Add in more tools! You could have a SQL database with common Q&A that the LLM could read and write from? \n", + " • Bring in the Evaluator from the last lab, and add other Agentic patterns.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " Aside from the obvious (your career alter-ego) this has business applications in any situation where you need an AI assistant with domain expertise and an ability to interact with the real world.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Now try this commercial application: \n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Are you ready for action??\n", + " Have you completed all the setup steps in the setup folder?\n", + " Have you checked out the guides in the guides folder? \n", + " Well in that case, you're ready!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Treat these labs as a resource\n", + " I push updates to the code regularly. When people ask questions or have problems, I incorporate it in the code, adding more examples or improved commentary. As a result, you'll notice that the code below isn't identical to the videos. Everything from the videos is here; but in addition, I've added more steps and better explanations. Consider this like an interactive book that accompanies the lectures.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Are you ready for action??\n", + " Have you completed all the setup steps in the setup folder?\n", + " Have you checked out the guides in the guides folder? \n", + " Well in that case, you're ready!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " This code is a live resource - keep an eye out for my updates\n", + " I push updates regularly. As people ask questions or have problems, I add more examples and improve explanations. As a result, the code below might not be identical to the videos, as I've added more steps and better comments. Consider this like an interactive book that accompanies the lectures.\n", + " I try to send emails regularly with important updates related to the course. You can find this in the 'Announcements' section of Udemy in the left sidebar. You can also choose to receive my emails via your Notification Settings in Udemy. I'm respectful of your inbox and always try to add value with my emails!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important point - please read\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, after watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " These kinds of patterns - to send a task to multiple models, and evaluate results,\n", + " are common where you need to improve the quality of your LLM response. This approach can be universally applied\n", + " to business projects where accuracy is critical.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Super important - ignore me at your peril!\n", + " The model called llama3.3 is FAR too large for home computers - it's not intended for personal computing and will consume all your resources! Stick with the nicely sized llama3.2 or llama3.2:1b and if you want larger, try llama3.1 or smaller variants of Qwen, Gemma, Phi or DeepSeek. See the the Ollama models page for a full list of models and sizes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important point - please read\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, after watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Super important - ignore me at your peril!\n", + " The model called llama3.3 is FAR too large for home computers - it's not intended for personal computing and will consume all your resources! Stick with the nicely sized llama3.2 or llama3.2:1b and if you want larger, try llama3.1 or smaller variants of Qwen, Gemma, Phi or DeepSeek. See the the Ollama models page for a full list of models and sizes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " These kinds of patterns - to send a task to multiple models, and evaluate results,\n", + " are common where you need to improve the quality of your LLM response. This approach can be universally applied\n", + " to business projects where accuracy is critical.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " • First and foremost, deploy this for yourself! It's a real, valuable tool - the future resume..\n", + " • Next, improve the resources - add better context about yourself. If you know RAG, then add a knowledge base about you. \n", + " • Add in more tools! You could have a SQL database with common Q&A that the LLM could read and write from? \n", + " • Bring in the Evaluator from the last lab, and add other Agentic patterns.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " Aside from the obvious (your career alter-ego) this has business applications in any situation where you need an AI assistant with domain expertise and an ability to interact with the real world.\n", + " \n", + " | \n",
+ "
{col} | " + table_html += "
---|
{val} | " + table_html += "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important point - please read\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, after watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Super important - ignore me at your peril!\n", + " The model called llama3.3 is FAR too large for home computers - it's not intended for personal computing and will consume all your resources! Stick with the nicely sized llama3.2 or llama3.2:1b and if you want larger, try llama3.1 or smaller variants of Qwen, Gemma, Phi or DeepSeek. See the the Ollama models page for a full list of models and sizes.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " These kinds of patterns - to send a task to multiple models, and evaluate results,\n", + " and common where you need to improve the quality of your LLM response. This approach can be universally applied\n", + " to business projects where accuracy is critical.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Are you ready for action??\n", + " Have you completed all the setup steps in the setup folder?\n", + " Have you checked out the guides in the guides folder? \n", + " Well in that case, you're ready!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Treat these labs as a resource\n", + " I push updates to the code regularly. When people ask questions or have problems, I incorporate it in the code, adding more examples or improved commentary. As a result, you'll notice that the code below isn't identical to the videos. Everything from the videos is here; but in addition, I've added more steps and better explanations. Consider this like an interactive book that accompanies the lectures.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Are you ready for action??\n", + " Have you completed all the setup steps in the setup folder?\n", + " Have you checked out the guides in the guides folder? \n", + " Well in that case, you're ready!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " This code is a live resource - keep an eye out for my updates\n", + " I push updates regularly. As people ask questions or have problems, I add more examples and improve explanations. As a result, the code below might not be identical to the videos, as I've added more steps and better comments. Consider this like an interactive book that accompanies the lectures.\n", + " I try to send emails regularly with important updates related to the course. You can find this in the 'Announcements' section of Udemy in the left sidebar. You can also choose to receive my emails via your Notification Settings in Udemy. I'm respectful of your inbox and always try to add value with my emails!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Now try this commercial application:\n", + " First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity. \n", + " Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution. \n", + " Finally have 3 third LLM call propose the Agentic AI solution.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Important point - please read\n", + " The way I collaborate with you may be different to other courses you've taken. I prefer not to type code while you watch. Rather, I execute Jupyter Labs, like this, and give you an intuition for what's going on. My suggestion is that you carefully execute this yourself, after watching the lecture. Add print statements to understand what's going on, and then come up with your own variations.If you have time, I'd love it if you submit a PR for changes in the community_contributions folder - instructions in the resources. Also, if you have a Github account, use this to showcase your variations. Not only is this essential practice, but it demonstrates your skills to others, including perhaps future clients or employers...\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Which pattern(s) did this use? Try updating this to add another Agentic design pattern.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " These kinds of patterns - to send a task to multiple models, and evaluate results,\n", + " and common where you need to improve the quality of your LLM response. This approach can be universally applied\n", + " to business projects where accuracy is critical.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Looking up packages\n", + " In this lab, we're going to use the wonderful Gradio package for building quick UIs, \n", + " and we're also going to use the popular PyPDF2 PDF reader. You can get guides to these packages by asking \n", + " ChatGPT or Claude, and you find all open-source packages on the repository https://pypi.org.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " The OpenAI Agents SDK Docs\n", + " The documentation on OpenAI Agents SDK is really clear and simple: https://openai.github.io/openai-agents-python/ and it's well worth a look.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Wait - you didn't get an email??\n", + " With much thanks to student Chris S. for describing his issue and fixes. \n", + " If you don't receive an email after running the prior cell, here are some things to check:\n", + " First, check your Spam folder! Several students have missed that the emails arrived in Spam! Second, print(result) and see if you are receiving errors about SSL. \n", + " If you're receiving SSL errors, then please check out theses networking tips and see the note in the next cell. Also look at the trace in OpenAI, and investigate on the SendGrid website, to hunt for clues. Let me know if I can help!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Can you identify the Agentic design patterns that were used here?\n", + " What is the 1 line that changed this from being an Agentic \"workflow\" to \"agent\" under Anthropic's definition? \n", + " Try adding in more tools and Agents! You could have tools that handle the mail merge to send to a list. \n", + " HARD CHALLENGE: research how you can have SendGrid call a Callback webhook when a user replies to an email,\n", + " Then have the SDR respond to keep the conversation going! This may require some \"vibe coding\" 😂\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " This is immediately applicable to Sales Automation; but more generally this could be applied to end-to-end automation of any business process through conversations and tools. Think of ways you could apply an Agent solution\n", + " like this in your day job.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " • Try different models• Add more input and output guardrails • Use structured outputs for the email generation\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " A Deep Research agent is broadly applicable to any business area, and to your own day-to-day activities. You can make use of this yourself!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Congratulations on your progress, and a request\n", + " You've reached an important moment with the course; you've created a valuable Agent using one of the latest Agent frameworks. You've upskilled, and unlocked new commercial possibilities. Take a moment to celebrate your success!Something I should ask you -- my editor would smack me if I didn't mention this. If you're able to rate the course on Udemy, I'd be seriously grateful: it's the most important way that Udemy decides whether to show the course to others and it makes a massive difference. And another reminder to connect with me on LinkedIn if you wish! If you wanted to post about your progress on the course, please tag me and I'll weigh in to increase your exposure.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " The OpenAI Agents SDK Docs\n", + " The documentation on OpenAI Agents SDK is really clear and simple: https://openai.github.io/openai-agents-python/ and it's well worth a look.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Wait - you didn't get an email??\n", + " With much thanks to student Chris S. for describing his issue and fixes. \n", + " If you don't receive an email after running the prior cell, here are some things to check:\n", + " First, check your Spam folder! Several students have missed that the emails arrived in Spam! Second, print(result) and see if you are receiving errors about SSL. \n", + " If you're receiving SSL errors, then please check out theses networking tips and see the note in the next cell. Also look at the trace in OpenAI, and investigate on the SendGrid website, to hunt for clues. Let me know if I can help!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Can you identify the Agentic design patterns that were used here?\n", + " What is the 1 line that changed this from being an Agentic \"workflow\" to \"agent\" under Anthropic's definition? \n", + " Try adding in more tools and Agents! You could have tools that handle the mail merge to send to a list. \n", + " HARD CHALLENGE: research how you can have SendGrid call a Callback webhook when a user replies to an email,\n", + " Then have the SDR respond to keep the conversation going! This may require some \"vibe coding\" 😂\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " This is immediately applicable to Sales Automation; but more generally this could be applied to end-to-end automation of any business process through conversations and tools. Think of ways you could apply an Agent solution\n", + " like this in your day job.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Wait - you didn't get an email??\n", + " With much thanks to student Chris S. for describing his issue and fixes. \n", + " If you don't receive an email after running the prior cell, here are some things to check:\n", + " First, check your Spam folder! Several students have missed that the emails arrived in Spam! Second, print(result) and see if you are receiving errors about SSL. \n", + " If you're receiving SSL errors, then please check out theses networking tips particularly the uv command in Part 7. Also look at the trace in OpenAI, and investigate on the SendGrid website, to hunt for clues. Let me know if I can help!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Can you identify the Agentic design patterns that were used here?\n", + " What is the 1 line that changed this from being an Agentic \"workflow\" to \"agent\" under Anthropic's definition? \n", + " Try adding in more tools and Agents! You could have tools that handle the mail merge to send to a list. \n", + " HARD CHALLENGE: research how you can have SendGrid call a Callback webhook when a user replies to an email,\n", + " Then have the SDR respond to keep the conversation going! This may require some \"vibe coding\" 😂\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " This is immediately applicable to Sales Automation; but more generally this could be applied to end-to-end automation of any business process through conversations and tools. Think of ways you could apply an Agent solution\n", + " like this in your day job.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Wait - you didn't get an email??\n", + " With much thanks to student Chris S. for describing his issue and fixes. \n", + " If you don't receive an email after running the prior cell, here are some things to check:\n", + " First, check your Spam folder! Several students have missed that the emails arrived in Spam! Second, print(result) and see if you are receiving errors about SSL. \n", + " If you're receiving SSL errors, then please check out theses networking tips particularly the uv command in Part 7. Also look at the trace in OpenAI, and investigate on the SendGrid website, to hunt for clues. Let me know if I can help!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Can you identify the Agentic design patterns that were used here?\n", + " What is the 1 line that changed this from being an Agentic \"workflow\" to \"agent\" under Anthropic's definition? \n", + " Try adding in more tools and Agents! You could have tools that handle the mail merge to send to a list. \n", + " HARD CHALLENGE: research how you can have SendGrid call a Callback webhook when a user replies to an email,\n", + " Then have the SDR respond to keep the conversation going! This may require some \"vibe coding\" 😂\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " This is immediately applicable to Sales Automation; but more generally this could be applied to end-to-end automation of any business process through conversations and tools. Think of ways you could apply an Agent solution\n", + " like this in your day job.\n", + " \n", + " | \n",
+ "
{body}
\" # Body wrapped intags for HTML format\n", + " }\n", + " \n", + " # Send email using Resend API\n", + " response = requests.post(\"https://api.resend.com/emails\", json=payload, headers=headers)\n", + " \n", + " # Check if the request was successful\n", + " if response.status_code == 202:\n", + " return {\"status\": \"success\"}\n", + " else:\n", + " return {\"status\": \"failure\", \"message\": response.text}" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### This has automatically been converted into a tool, with the boilerplate json created" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Let's look at it\n", + "send_email" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### And you can also convert an Agent into a tool" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "tool1 = sales_agent1.as_tool(tool_name=\"sales_agent1\", tool_description=\"Write a cold sales email\")\n", + "tool1" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### So now we can gather all the tools together:\n", + "\n", + "A tool for each of our 3 email-writing agents\n", + "\n", + "And a tool for our function to send emails" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "description = \"Write a cold sales email\"\n", + "\n", + "tool1 = sales_agent1.as_tool(tool_name=\"sales_agent1\", tool_description=description)\n", + "tool2 = sales_agent2.as_tool(tool_name=\"sales_agent2\", tool_description=description)\n", + "tool3 = sales_agent3.as_tool(tool_name=\"sales_agent3\", tool_description=description)\n", + "\n", + "tools = [tool1, tool2, tool3, send_email]\n", + "\n", + "tools" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## And now it's time for our Sales Manager - our planning agent" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "instructions =\"You are a sales manager working for ComplAI. You use the tools given to you to generate cold sales emails. \\\n", + "You never generate sales emails yourself; you always use the tools. \\\n", + "You try all 3 sales_agent tools once before choosing the best one. \\\n", + "You pick the single best email and use the send_email tool to send the best email (and only the best email) to the user.\"\n", + "\n", + "\n", + "sales_manager = Agent(name=\"Sales Manager\", instructions=instructions, tools=tools, model=\"gpt-4o-mini\")\n", + "\n", + "message = \"Send a cold sales email addressed to 'Dear CEO'\"\n", + "\n", + "with trace(\"Sales manager\"):\n", + " result = await Runner.run(sales_manager, message)" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "
\n",
+ " ![]() | \n",
+ " \n",
+ " Wait - you didn't get an email??\n", + " With much thanks to student Chris S. for describing his issue and fixes. \n", + " If you don't receive an email after running the prior cell, here are some things to check:\n", + " First, check your Spam folder! Several students have missed that the emails arrived in Spam! Second, print(result) and see if you are receiving errors about SSL. \n", + " If you're receiving SSL errors, then please check out theses networking tips particularly the uv command in Part 7. Also look at the trace in OpenAI, and investigate on the SendGrid website, to hunt for clues. Let me know if I can help!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercise\n", + " Can you identify the Agentic design patterns that were used here?\n", + " What is the 1 line that changed this from being an Agentic \"workflow\" to \"agent\" under Anthropic's definition? \n", + " Try adding in more tools and Agents! You could have tools that handle the mail merge to send to a list. \n", + " HARD CHALLENGE: research how you can have SendGrid call a Callback webhook when a user replies to an email,\n", + " Then have the SDR respond to keep the conversation going! This may require some \"vibe coding\" 😂\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Commercial implications\n", + " This is immediately applicable to Sales Automation; but more generally this could be applied to end-to-end automation of any business process through conversations and tools. Think of ways you could apply an Agent solution\n", + " like this in your day job.\n", + " \n", + " | \n",
+ "
') + html_report = '
' + html_report + '
' + + html_content = f""" + + + + + +\n",
+ " ![]() | \n",
+ " \n",
+ " Congratulations on making the first version of Sidekick!\n", + " This is a pretty epic moment in the course. You've made the start of something very powerful. And you've upskilled on an impressive Agent framework in LangGraph. Maybe like me you're being converted from a LangGraph skeptic to a LangGraph fan..My editor would kill me if I didn't mention again: if you're able to rate the course on Udemy, I'd be so very grateful: it's the main way that Udemy decides whether to show the course to others and it makes a massive difference. And another reminder that I love connecting on LinkedIn if you haven't yet! If you wanted to post about your progress on the course, please tag me and I'll weigh in to increase your exposure.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " But wait - a not-so-small problem for Windows PC people\n", + " I have unpleasant news. There's a problem running MCP Servers on Windows PCs; Mac and Linux is fine. This is a known issue as of May 4th, 2025. I asked o3 with Deep Research to try to find workarounds; it confirmed the issue and confirmed the workaround.\n", + " The workaround is a bit of a bore. It is to take advantage of \"WSL\", the Microsoft approach for running Linux on your PC. You'll need to carry out more setup instructions! But it's quick, and several students have confirmed that this works perfectly for them, then this lab and the Week 6 MCP labs work. Plus, WSL is actually a great way to build software on your Windows PC. You can also skip this final cell, but you will need to come back to this when we start Week 6. \n", + " The WSL Setup instructions are in the Setup folder, in the file called SETUP-WSL.md here. I do hope this only holds you up briefly - you should be back up and running quickly. Oh the joys of working with bleeding-edge technology! \n", + " With many thanks to student Kaushik R. for raising that this is needed here as well as week 6. Thanks Kaushik!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " To my Windows PC people - an important announcement\n", + " I have unpleasant news. There's a problem running MCP Servers on Windows PCs; Mac and Linux is fine. This is a known issue as of May 4th, 2025. I asked o3 with Deep Research to try to find workarounds; it confirmed the issue and confirmed the workaround.\n", + " The workaround is a bit of a bore. It is to take advantage of \"WSL\", the Microsoft approach for running Linux on your PC. You'll need to carry out more setup instructions! But it's quick, and several students have confirmed that this works perfectly for them, then the Week 6 MCP labs work. Plus, WSL is actually a great way to build software on your Windows PC. \n", + " The WSL Setup instructions are in the Setup folder, in the file called SETUP-WSL.md here. I do hope this only holds you up briefly - you should be back up and running quickly. Oh the joys of working with bleeding-edge technology! \n", + " With many thanks to students Markus, Abhi, Hui-Ling, and several others, for helping me work on it and confirming the fix.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercises\n", + " Make your own MCP Server! Make a simple function to return the current Date, and expose it as a tool so that an Agent can tell you today's date.Harder optional exercise: then make an MCP Client, and use a native OpenAI call (without the Agents SDK) to use your tool via your client.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " PLEASE READ!!-\n", + " This service for financial market data has both a FREE plan and a PAID plan, and we can use either depending on your appetite.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Exercises\n", + " Explore MCP server marketplaces and integrate your own, using all 3 approaches.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Autonomous Traders\n", + " An equity trading simulation to illustrate autonomous agents powered by tools and resources from MCP servers.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " One more time --\n", + " Please do not use this for actual trading decisions!!\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Autonomous Traders\n", + " An equity trading simulation to illustrate autonomous agents powered by tools and resources from MCP servers.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " Adding more and more MCP Servers\n", + " Over time, I plan to keep adding MCP Servers agents and functionality - and you should too! For now I've added Push Notification since it's been a recurring theme through the course.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " One last reminder to monitor your APIs\n", + " This will run on a loop, every hour, or however you specified. You should watch your API usage, and stop this running when you've had enough!\n", + " I find myself watching this happily for hours - and I hope you will too! A huge project that showcases the power of Autonomous Agents.\n", + " \n", + " | \n",
+ "
\n",
+ " ![]() | \n",
+ " \n",
+ " THANK YOU SO SO MUCH!\n", + " You've reached the conclusion! I'm so grateful that you stuck at it all the way to the end. My editor would smack me if I didn't mention one more time: if you're able to rate the course on Udemy, I'd be super thankful: it's the most important way that Udemy decides whether to show the course to others and it makes a massive difference.Please do stay in touch and let me know how you get on, and share your journey in this extraordinary field in these extraordinary times. If you've made it this far and somehow resisted connecting with me on LinkedIn - here I am one more time! If you wanted to post about your accomplishment on the course, please tag me and I'll weigh in to increase your exposure. Congratulations! \n", + " \n", + " | \n",
+ "