CoolFace
Apppublic

VTdevelops/career_conversation

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
1_lab1.ipynb641 linesDownload Raw Back to root
1{2 "cells": [3  {4   "cell_type": "markdown",5   "metadata": {},6   "source": [7    "# Welcome to the start of your adventure in Agentic AI"8   ]9  },10  {11   "cell_type": "markdown",12   "metadata": {},13   "source": [14    "<table style=\"margin: 0; text-align: left; width:100%\">\n",15    "    <tr>\n",16    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",17    "            <img src=\"../assets/stop.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",18    "        </td>\n",19    "        <td>\n",20    "            <h2 style=\"color:#ff7800;\">Are you ready for action??</h2>\n",21    "            <span style=\"color:#ff7800;\">Have you completed all the setup steps in the <a href=\"../setup/\">setup</a> folder?<br/>\n",22    "            Have you checked out the guides in the <a href=\"../guides/01_intro.ipynb\">guides</a> folder?<br/>\n",23    "            Well in that case, you're ready!!\n",24    "            </span>\n",25    "        </td>\n",26    "    </tr>\n",27    "</table>"28   ]29  },30  {31   "cell_type": "markdown",32   "metadata": {},33   "source": [34    "<table style=\"margin: 0; text-align: left; width:100%\">\n",35    "    <tr>\n",36    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",37    "            <img src=\"../assets/tools.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",38    "        </td>\n",39    "        <td>\n",40    "            <h2 style=\"color:#00bfff;\">This code is a live resource - keep an eye out for my updates</h2>\n",41    "            <span style=\"color:#00bfff;\">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.<br/><br/>\n",42    "            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",43    "            </span>\n",44    "        </td>\n",45    "    </tr>\n",46    "</table>"47   ]48  },49  {50   "cell_type": "markdown",51   "metadata": {},52   "source": [53    "### And please do remember to contact me if I can help\n",54    "\n",55    "And I love to connect: https://www.linkedin.com/in/eddonner/\n",56    "\n",57    "\n",58    "### New to Notebooks like this one? Head over to the guides folder!\n",59    "\n",60    "Just to check you've already added the Python and Jupyter extensions to Cursor, if not already installed:\n",61    "- Open extensions (View >> extensions)\n",62    "- Search for python, and when the results show, click on the ms-python one, and Install it if not already installed\n",63    "- Search for jupyter, and when the results show, click on the Microsoft one, and Install it if not already installed  \n",64    "Then View >> Explorer to bring back the File Explorer.\n",65    "\n",66    "And then:\n",67    "1. Click where it says \"Select Kernel\" near the top right, and select the option called `.venv (Python 3.12.9)` or similar, which should be the first choice or the most prominent choice. You may need to choose \"Python Environments\" first.\n",68    "2. Click in each \"cell\" below, starting with the cell immediately below this text, and press Shift+Enter to run\n",69    "3. Enjoy!\n",70    "\n",71    "After you click \"Select Kernel\", if there is no option like `.venv (Python 3.12.9)` then please do the following:  \n",72    "1. On Mac: From the Cursor menu, choose Settings >> VS Code Settings (NOTE: be sure to select `VSCode Settings` not `Cursor Settings`);  \n",73    "On Windows PC: From the File menu, choose Preferences >> VS Code Settings(NOTE: be sure to select `VSCode Settings` not `Cursor Settings`)  \n",74    "2. In the Settings search bar, type \"venv\"  \n",75    "3. In the field \"Path to folder with a list of Virtual Environments\" put the path to the project root, like C:\\Users\\username\\projects\\agents (on a Windows PC) or /Users/username/projects/agents (on Mac or Linux).  \n",76    "And then try again.\n",77    "\n",78    "Having problems with missing Python versions in that list? Have you ever used Anaconda before? It might be interferring. Quit Cursor, bring up a new command line, and make sure that your Anaconda environment is deactivated:    \n",79    "`conda deactivate`  \n",80    "And if you still have any problems with conda and python versions, it's possible that you will need to run this too:  \n",81    "`conda config --set auto_activate_base false`  \n",82    "and then from within the Agents directory, you should be able to run `uv python list` and see the Python 3.12 version."83   ]84  },85  {86   "cell_type": "code",87   "execution_count": 1,88   "metadata": {},89   "outputs": [],90   "source": [91    "# First let's do an import\n",92    "from dotenv import load_dotenv\n"93   ]94  },95  {96   "cell_type": "code",97   "execution_count": 2,98   "metadata": {},99   "outputs": [100    {101     "data": {102      "text/plain": [103       "True"104      ]105     },106     "execution_count": 2,107     "metadata": {},108     "output_type": "execute_result"109    }110   ],111   "source": [112    "# Next it's time to load the API keys into environment variables\n",113    "\n",114    "load_dotenv(override=True)"115   ]116  },117  {118   "cell_type": "code",119   "execution_count": 3,120   "metadata": {},121   "outputs": [122    {123     "name": "stdout",124     "output_type": "stream",125     "text": [126      "OpenAI API Key exists and begins sk-proj-\n"127     ]128    }129   ],130   "source": [131    "# Check the keys\n",132    "\n",133    "import os\n",134    "openai_api_key = os.getenv('OPENAI_API_KEY')\n",135    "\n",136    "if openai_api_key:\n",137    "    print(f\"OpenAI API Key exists and begins {openai_api_key[:8]}\")\n",138    "else:\n",139    "    print(\"OpenAI API Key not set - please head to the troubleshooting guide in the setup folder\")\n",140    "    \n"141   ]142  },143  {144   "cell_type": "code",145   "execution_count": 4,146   "metadata": {},147   "outputs": [],148   "source": [149    "# And now - the all important import statement\n",150    "# If you get an import error - head over to troubleshooting guide\n",151    "\n",152    "from openai import OpenAI"153   ]154  },155  {156   "cell_type": "code",157   "execution_count": 5,158   "metadata": {},159   "outputs": [],160   "source": [161    "# And now we'll create an instance of the OpenAI class\n",162    "# If you're not sure what it means to create an instance of a class - head over to the guides folder!\n",163    "# If you get a NameError - head over to the guides folder to learn about NameErrors\n",164    "\n",165    "openai = OpenAI()"166   ]167  },168  {169   "cell_type": "code",170   "execution_count": 6,171   "metadata": {},172   "outputs": [],173   "source": [174    "# Create a list of messages in the familiar OpenAI format\n",175    "\n",176    "messages = [{\"role\": \"user\", \"content\": \"What is 2+2?\"}]"177   ]178  },179  {180   "cell_type": "code",181   "execution_count": 7,182   "metadata": {},183   "outputs": [184    {185     "name": "stdout",186     "output_type": "stream",187     "text": [188      "2 + 2 equals 4.\n"189     ]190    }191   ],192   "source": [193    "# And now call it! Any problems, head to the troubleshooting guide\n",194    "# This uses GPT 4.1 nano, the incredibly cheap model\n",195    "\n",196    "response = openai.chat.completions.create(\n",197    "    model=\"gpt-4.1-nano\",\n",198    "    messages=messages\n",199    ")\n",200    "\n",201    "print(response.choices[0].message.content)\n"202   ]203  },204  {205   "cell_type": "code",206   "execution_count": 8,207   "metadata": {},208   "outputs": [],209   "source": [210    "# And now - let's ask for a question:\n",211    "\n",212    "question = \"Please propose a hard, challenging question to assess someone's IQ. Respond only with the question.\"\n",213    "messages = [{\"role\": \"user\", \"content\": question}]\n"214   ]215  },216  {217   "cell_type": "code",218   "execution_count": 9,219   "metadata": {},220   "outputs": [221    {222     "name": "stdout",223     "output_type": "stream",224     "text": [225      "If five machines take five minutes to make five widgets, how long would 100 machines take to make 100 widgets?\n"226     ]227    }228   ],229   "source": [230    "# ask it - this uses GPT 4.1 mini, still cheap but more powerful than nano\n",231    "\n",232    "response = openai.chat.completions.create(\n",233    "    model=\"gpt-4.1-mini\",\n",234    "    messages=messages\n",235    ")\n",236    "\n",237    "question = response.choices[0].message.content\n",238    "\n",239    "print(question)\n"240   ]241  },242  {243   "cell_type": "code",244   "execution_count": 10,245   "metadata": {},246   "outputs": [],247   "source": [248    "# form a new messages list\n",249    "messages = [{\"role\": \"user\", \"content\": question}]\n"250   ]251  },252  {253   "cell_type": "code",254   "execution_count": 11,255   "metadata": {},256   "outputs": [257    {258     "name": "stdout",259     "output_type": "stream",260     "text": [261      "Let's analyze the problem step-by-step:\n",262      "\n",263      "- **Given:** Five machines take five minutes to make five widgets.\n",264      "  \n",265      "This means:\n",266      "\n",267      "- Each machine makes 1 widget in 5 minutes (because 5 machines → 5 widgets in 5 minutes, so 1 machine → 1 widget in 5 minutes).\n",268      "\n",269      "Now, we're asked:\n",270      "\n",271      "- How long would 100 machines take to make 100 widgets?\n",272      "\n",273      "Since each machine produces 1 widget in 5 minutes:\n",274      "\n",275      "- 100 machines will produce 100 widgets in the same 5 minutes (each machine makes 1 widget independently in 5 minutes).\n",276      "\n",277      "**Answer:** 5 minutes\n"278     ]279    }280   ],281   "source": [282    "# Ask it again\n",283    "\n",284    "response = openai.chat.completions.create(\n",285    "    model=\"gpt-4.1-mini\",\n",286    "    messages=messages\n",287    ")\n",288    "\n",289    "answer = response.choices[0].message.content\n",290    "print(answer)\n"291   ]292  },293  {294   "cell_type": "code",295   "execution_count": 12,296   "metadata": {},297   "outputs": [298    {299     "data": {300      "text/markdown": [301       "Let's analyze the problem step-by-step:\n",302       "\n",303       "- **Given:** Five machines take five minutes to make five widgets.\n",304       "  \n",305       "This means:\n",306       "\n",307       "- Each machine makes 1 widget in 5 minutes (because 5 machines → 5 widgets in 5 minutes, so 1 machine → 1 widget in 5 minutes).\n",308       "\n",309       "Now, we're asked:\n",310       "\n",311       "- How long would 100 machines take to make 100 widgets?\n",312       "\n",313       "Since each machine produces 1 widget in 5 minutes:\n",314       "\n",315       "- 100 machines will produce 100 widgets in the same 5 minutes (each machine makes 1 widget independently in 5 minutes).\n",316       "\n",317       "**Answer:** 5 minutes"318      ],319      "text/plain": [320       "<IPython.core.display.Markdown object>"321      ]322     },323     "metadata": {},324     "output_type": "display_data"325    }326   ],327   "source": [328    "from IPython.display import Markdown, display\n",329    "\n",330    "display(Markdown(answer))\n",331    "\n"332   ]333  },334  {335   "cell_type": "markdown",336   "metadata": {},337   "source": [338    "# Congratulations!\n",339    "\n",340    "That was a small, simple step in the direction of Agentic AI, with your new environment!\n",341    "\n",342    "Next time things get more interesting..."343   ]344  },345  {346   "cell_type": "markdown",347   "metadata": {},348   "source": [349    "<table style=\"margin: 0; text-align: left; width:100%\">\n",350    "    <tr>\n",351    "        <td style=\"width: 150px; height: 150px; vertical-align: middle;\">\n",352    "            <img src=\"../assets/exercise.png\" width=\"150\" height=\"150\" style=\"display: block;\" />\n",353    "        </td>\n",354    "        <td>\n",355    "            <h2 style=\"color:#ff7800;\">Exercise</h2>\n",356    "            <span style=\"color:#ff7800;\">Now try this commercial application:<br/>\n",357    "            First ask the LLM to pick a business area that might be worth exploring for an Agentic AI opportunity.<br/>\n",358    "            Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution.<br/>\n",359    "            Finally have 3 third LLM call propose the Agentic AI solution.\n",360    "            </span>\n",361    "        </td>\n",362    "    </tr>\n",363    "</table>"364   ]365  },366  {367   "cell_type": "code",368   "execution_count": 14,369   "metadata": {},370   "outputs": [371    {372     "data": {373      "text/markdown": [374       "One promising business area for an Agentic AI opportunity is **Supply Chain and Logistics Management**.\n",375       "\n",376       "### Why Supply Chain and Logistics?\n",377       "\n",378       "1. **Complex Decision-Making Environments**  \n",379       "   Supply chains involve multifaceted, dynamic systems with numerous interacting components: procurement, inventory management, transportation, demand forecasting, and distribution. An agentic AI can autonomously monitor, analyze, and optimize these interdependent parts in real-time.\n",380       "\n",381       "2. **High Potential for Automation & Optimization**  \n",382       "   Traditional supply chain processes are often fragmented and rely heavily on human intervention and legacy systems. An agentic AI could continuously learn from data, anticipate bottlenecks, re-route shipments, negotiate with suppliers, and adjust inventory levels without constant human oversight.\n",383       "\n",384       "3. **Significant Impact on Costs and Efficiency**  \n",385       "   Efficient supply chains reduce operational costs, lead times, and waste, positively impacting a company’s bottom line and sustainability efforts. An agentic AI system could deliver measurable and scalable returns.\n",386       "\n",387       "4. **Growing Demand and Complexity**  \n",388       "   Globalization, e-commerce growth, and recent supply chain disruptions have emphasized the need for smarter, more resilient logistics solutions.\n",389       "\n",390       "### Example Applications\n",391       "\n",392       "- Autonomous procurement agents that source components from the best suppliers while balancing cost, quality, and delivery speed.\n",393       "- Real-time logistics optimization agents that adjust shipping routes based on traffic, weather, and capacity constraints.\n",394       "- Inventory management agents that forecast demand and automatically place replenishment orders to minimize stockouts and overstock.\n",395       "\n",396       "### Why Agentic AI Specifically?\n",397       "\n",398       "Unlike narrow AI tools that perform isolated tasks, agentic AI systems can make autonomous decisions, coordinate across stages, and adapt dynamically to evolving conditions and objectives — critical capabilities for managing the complexity and uncertainty inherent in supply chains.\n",399       "\n",400       "---\n",401       "\n",402       "If you want, I can help brainstorm specific product ideas, target industries, or technical approaches in this area!"403      ],404      "text/plain": [405       "<IPython.core.display.Markdown object>"406      ]407     },408     "metadata": {},409     "output_type": "display_data"410    }411   ],412   "source": [413    "# First create the messages:\n",414    "\n",415    "messages = [{\"role\": \"user\", \"content\": \"Pick a business area that might be worth exploring for an Agentic AI opportunity\"}]\n",416    "\n",417    "# Then make the first call:\n",418    "\n",419    "response = openai.chat.completions.create(\n",420    "    model=\"gpt-4.1-mini\",\n",421    "    messages=messages\n",422    ")\n",423    "\n",424    "# Then read the business idea:\n",425    "\n",426    "business_idea = response.choices[0].message.content\n",427    "\n",428    "\n",429    "from IPython.display import Markdown, display\n",430    "\n",431    "display(Markdown(business_idea))\n",432    "# And repeat!\n"433   ]434  },435  {436   "cell_type": "markdown",437   "metadata": {},438   "source": []439  },440  {441   "cell_type": "code",442   "execution_count": 15,443   "metadata": {},444   "outputs": [445    {446     "data": {447      "text/markdown": [448       "A significant pain point in the **Supply Chain and Logistics Management** industry that is ripe for an agentic AI solution is **demand variability and forecasting inaccuracies**.\n",449       "\n",450       "### Pain Point: Demand Variability and Forecasting Inaccuracies\n",451       "\n",452       "**Challenge Overview**  \n",453       "Businesses often struggle with accurately predicting demand due to a variety of factors including rapidly changing consumer preferences, market trends, seasonal fluctuations, and unexpected events (e.g., natural disasters, political instability, or pandemics). Inaccurate forecasts can lead to significant issues such as:\n",454       "\n",455       "- **Stockouts**: When demand exceeds supply, leading to lost sales and dissatisfied customers.\n",456       "- **Overstock**: Excess inventory that ties up capital and increases storage costs.\n",457       "- **Inefficient resource allocation**: Resources may be improperly assigned based on flawed predictions, affecting the entire supply chain.\n",458       "\n",459       "These challenges illustrate a crucial need for a solution that can better understand and react to demand dynamics.\n",460       "\n",461       "### Agentic AI Solution: Adaptive Demand Forecasting Agents\n",462       "\n",463       "1. **Real-Time Learning and Adaptation**  \n",464       "   An agentic AI system could continuously analyze vast amounts of data from various sources—historical sales data, market trends, social media sentiment, and external events—to improve forecast accuracy. Unlike traditional models, which typically operate on static data sets, this solution would adapt in real-time, recalibrating forecasts based on new information as it becomes available.\n",465       "\n",466       "2. **Multi-Source Data Integration**  \n",467       "   The AI can leverage machine learning to integrate and analyze disparate data sources, allowing it to identify patterns in consumer behavior and external factors that may influence demand. This holistic view can provide more nuanced forecasts, reducing the margins of error typically seen in traditional forecasting models.\n",468       "\n",469       "3. **Scenario Simulation and Optimization**  \n",470       "   Agentic AI could simulate various demand scenarios (best case, worst case, and most likely case) based on real-time data, enabling supply chain managers to plan contingently. For example, it could suggest optimal inventory levels and procurement strategies based on predicted demand spikes or drops.\n",471       "\n",472       "4. **Autonomous Adjustment of Supply Chain Parameters**  \n",473       "   Utilizing predictive analytics, the AI could autonomously adjust supply chain settings, such as order quantities and reorder points, based on forecast changes without waiting for human intervention. This agility could significantly enhance supply chain responsiveness, thereby aligning operations more closely with consumer demand.\n",474       "\n",475       "5. **Collaboration and Coordination**  \n",476       "   The agentic AI could facilitate collaboration between various stakeholders by providing them with shared, up-to-date demand insights and recommendations, ensuring that all parties are informed and aligned with supply chain decision-making.\n",477       "\n",478       "### Conclusion\n",479       "\n",480       "By addressing the pain of demand variability and forecasting inaccuracies with an agentic AI system, businesses can reduce stockouts and overstock, leading to optimized inventory levels, improved customer satisfaction, and reduced costs. The ability of an agentic AI to autonomously adapt to changing conditions makes it a powerful ally in the increasingly complex world of supply chain and logistics management. This opens the door for more resilient and efficient supply chains capable of navigating today's rapidly changing market landscapes. \n",481       "\n",482       "If you would like to dive deeper into this idea or explore additional solutions, let me know!"483      ],484      "text/plain": [485       "<IPython.core.display.Markdown object>"486      ]487     },488     "metadata": {},489     "output_type": "display_data"490    }491   ],492   "source": [493    "# Second exercice: Then ask the LLM to present a pain-point in that industry - something challenging that might be ripe for an Agentic solution.\n",494    "\n",495    "# First create the messages:\n",496    "\n",497    "prompt = f\"Please present a pain-point in that industry, something challenging that might be ripe for an Agentic solution for it in that industry: {business_idea}\"\n",498    "messages = [{\"role\": \"user\", \"content\": prompt}]\n",499    "\n",500    "# Then make the first call:\n",501    "\n",502    "response = openai.chat.completions.create(\n",503    "    model=\"gpt-4o-mini\",\n",504    "    messages=messages\n",505    ")\n",506    "\n",507    "# Then read the business idea:\n",508    "\n",509    "painpoint = response.choices[0].message.content\n",510    " \n",511    "# print(painpoint) \n",512    "display(Markdown(painpoint))"513   ]514  },515  {516   "cell_type": "code",517   "execution_count": 16,518   "metadata": {},519   "outputs": [520    {521     "data": {522      "text/markdown": [523       "## Proposal for Agentic AI Solution: Adaptive Demand Forecasting Agents\n",524       "\n",525       "### Executive Summary\n",526       "\n",527       "In the dynamic landscape of Supply Chain and Logistics Management, accurate demand forecasting is critical to operational efficiency and customer satisfaction. Demand variability and forecasting inaccuracies pose significant challenges, resulting in stockouts, overstocks, and inefficient resource allocation. The proposed Adaptive Demand Forecasting Agents, powered by agentic AI, aim to revolutionize the current forecasting approach, combining real-time adaptability, multi-source data integration, autonomous adjustment capabilities, and enhanced collaboration mechanisms. This proposal will detail how implementing these agents can mitigate the aforementioned pain points, ultimately improving supply chain resilience and operational efficiency.\n",528       "\n",529       "### Objectives\n",530       "\n",531       "- **Enhance Forecast Accuracy**: Use adaptive algorithms that respond in real-time to changing data and demand dynamics.\n",532       "- **Optimize Inventory Management**: Reduce instances of stockouts and overstocks, aligning inventory levels closely with actual consumer demand.\n",533       "- **Improve Resource Allocation**: Ensure resources are allocated efficiently based on accurate, data-driven insights.\n",534       "- **Facilitate Stakeholder Collaboration**: Create a shared knowledge base that promotes seamless communication among supply chain partners.\n",535       "\n",536       "### Solution Components\n",537       "\n",538       "#### 1. Real-Time Learning and Adaptation\n",539       "- **Continuous Data Analysis**: Implement machine learning algorithms that learn from historical sales data and continuously adjust as new data comes in.\n",540       "- **Feedback Loops**: Incorporate real-time feedback from stock levels, consumer behavior, and market events to refine predictions.\n",541       "\n",542       "#### 2. Multi-Source Data Integration\n",543       "- **Holistic Data Framework**: Collect and analyze data from internal (sales, inventory) and external (market trends, social media, economic indicators) sources to create a comprehensive demand picture.\n",544       "- **Advanced Analytics**: Utilize Natural Language Processing to assess consumer sentiment and market trends from unstructured data sources such as social media.\n",545       "\n",546       "#### 3. Scenario Simulation and Optimization\n",547       "- **What-If Analyses**: Develop a scenario simulation tool that allows supply chain managers to explore different demand scenarios.\n",548       "- **Optimized Recommendations**: Provide actionable insights that suggest optimal inventory levels and procurement strategies based on simulations.\n",549       "\n",550       "#### 4. Autonomous Adjustment of Supply Chain Parameters\n",551       "- **Predictive Adjustments**: Enable the AI system to autonomously adjust inventory thresholds and reorder parameters based on real-time forecasts without human intervention.\n",552       "- **Proactive Responses**: Facilitate proactive measures to address potential demand surges or declines, ensuring an agile supply chain.\n",553       "\n",554       "#### 5. Collaboration and Coordination\n",555       "- **Shared Insights Platform**: Create a dashboard for stakeholders that presents real-time demand insights and recommendations, fostering collaboration.\n",556       "- **Aligned Decision-Making**: Ensure that teams across sales, inventory management, and logistics are aligned, enabling them to respond swiftly to changes.\n",557       "\n",558       "### Implementation Roadmap\n",559       "\n",560       "1. **Phase 1: Data Infrastructure Establishment**\n",561       "   - Develop the necessary data architecture to collect, store, and process diverse data sources.\n",562       "\n",563       "2. **Phase 2: Model Development and Training**\n",564       "   - Create and train machine learning models tailored to specific demand forecasting use cases.\n",565       "\n",566       "3. **Phase 3: Pilot Testing**\n",567       "   - Conduct pilot tests with selected departments or products to validate the accuracy of forecasts and gather feedback.\n",568       "\n",569       "4. **Phase 4: Full Rollout**\n",570       "   - Implement the solution across the organization, along with training sessions for users on the new system.\n",571       "\n",572       "5. **Phase 5: Continuous Improvement**\n",573       "   - Establish ongoing evaluation and iterative improvement processes to adapt the solution based on evolving needs and data availability.\n",574       "\n",575       "### Expected Outcomes\n",576       "\n",577       "- **Improved Forecast Accuracy**: Achieve a measurable increase in forecast precision, leading to reduced stockouts and overstocks.\n",578       "- **Cost Savings**: Lower inventory carrying costs and enhanced capital utilization through optimized stock levels.\n",579       "- **Increased Customer Satisfaction**: Reduce instances of stockouts and fulfillment delays, enhancing the customer experience.\n",580       "- **Strengthened Competitive Advantage**: Equip the organization with agile supply chain capabilities that respond adeptly to market shifts.\n",581       "\n",582       "### Conclusion\n",583       "\n",584       "The implementation of Adaptive Demand Forecasting Agents powered by agentic AI represents a transformative approach to addressing the challenges of demand variability and forecasting inaccuracies in supply chain and logistics management. By leveraging advanced analytics and real-time adaptability, businesses can optimize their operations, reduce costs, and enhance customer satisfaction. We invite stakeholders to collaborate on this initiative to pave the way for a more innovative and robust supply chain landscape.\n",585       "\n",586       "If you wish to explore further details, feedback mechanisms, or address specific concerns, feel free to reach out!"587      ],588      "text/plain": [589       "<IPython.core.display.Markdown object>"590      ]591     },592     "metadata": {},593     "output_type": "display_data"594    }595   ],596   "source": [597    "# third exercice: Finally have 3 third LLM call propose the Agentic AI solution.\n",598    "\n",599    "# First create the messages:\n",600    "\n",601    "promptEx3 = f\"Please come up with a proposal for the Agentic AI solution to address this business painpoint:  {painpoint}\"\n",602    "messages = [{\"role\": \"user\", \"content\": promptEx3}]\n",603    "\n",604    "# Then make the first call:\n",605    "\n",606    "response = openai.chat.completions.create(\n",607    "    model=\"gpt-4o-mini\",\n",608    "    messages=messages\n",609    ")\n",610    "\n",611    "# Then read the business idea:\n",612    "\n",613    "ex3_answer=response.choices[0].message.content\n",614    "# print(painpoint) \n",615    "display(Markdown(ex3_answer))"616   ]617  }618 ],619 "metadata": {620  "kernelspec": {621   "display_name": ".venv",622   "language": "python",623   "name": "python3"624  },625  "language_info": {626   "codemirror_mode": {627    "name": "ipython",628    "version": 3629   },630   "file_extension": ".py",631   "mimetype": "text/x-python",632   "name": "python",633   "nbconvert_exporter": "python",634   "pygments_lexer": "ipython3",635   "version": "3.12.7"636  }637 },638 "nbformat": 4,639 "nbformat_minor": 2640}641