diff --git a/Challenge6/insurance_recomendation.ipynb b/Challenge6/insurance_recomendation.ipynb index c3fb16c..662eb33 100644 --- a/Challenge6/insurance_recomendation.ipynb +++ b/Challenge6/insurance_recomendation.ipynb @@ -313,7 +313,7 @@ "source": [ "## Step 5: Create and Execute Recommendation Agent\n", "\n", - "Now we define an intelligent agent powered by Semantic Kernel leveraging the Azure OpenAI Chat service to handle the recommendation process. The agent is configured with detailed instructions and a conversation history that includes the instruciton query:\n", + "Now we define an intelligent agent powered by Semantic Kernel leveraging the Azure OpenAI Chat service to handle the recommendation process. The agent is configured with detailed instructions and a conversation history that includes the instruction query:\n", "\"Please retrieve loan application and paystub information for 'Jane Elizabeth Smith' and recommend relevant insurance products.\"\n", "\n", "Instead of using a sequential planner to decompose the task into ordered steps, the agent dynamically synthesizes responses by invoking the appropriate registered functions based on the provided context. When invoked asynchronously, the agent processes the conversation and returns a personalized insurance recommendation crafted with a friendly and professional tone." @@ -321,18 +321,34 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": {}, "outputs": [ { - "ename": "NameError", - "evalue": "name 'datetime' is not defined", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[8], line 2\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Get current date\u001b[39;00m\n\u001b[0;32m----> 2\u001b[0m current_date \u001b[38;5;241m=\u001b[39m \u001b[43mdatetime\u001b[49m\u001b[38;5;241m.\u001b[39mnow()\u001b[38;5;241m.\u001b[39mstrftime(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mY-\u001b[39m\u001b[38;5;124m%\u001b[39m\u001b[38;5;124mm-\u001b[39m\u001b[38;5;132;01m%d\u001b[39;00m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m 4\u001b[0m \u001b[38;5;66;03m# Define agent with name and instructions\u001b[39;00m\n\u001b[1;32m 5\u001b[0m AGENT_NAME \u001b[38;5;241m=\u001b[39m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124minsurance_advisor\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;66;03m# Changed to use underscores instead of spaces to match pattern\u001b[39;00m\n", - "\u001b[0;31mNameError\u001b[0m: name 'datetime' is not defined" + "name": "stdout", + "output_type": "stream", + "text": [ + "Invoking insurance advisor agent...\n", + "# Agent - insurance_advisor: 'From the retrieved loan application and paystub information of Jane Elizabeth Smith, I found that she is applying for an Auto Loan of $40,000. Given her age of 34 and the loan purpose (vehicle purchase), I've identified relevant insurance products.\n", + "\n", + "Here is the crafted recommendation message:\n", + "\n", + "\n", + "Hi Jane,\n", + "\n", + "Thanks for reaching out to us regarding your Auto Loan application! Based on your loan details and financial profile, we have some excellent insurance recommendations to help protect you and your new vehicle:\n", + "\n", + "1. **Contoso AutoGuard Elite**: Comprehensive coverage designed to protect your investment in case of damage, theft, or accidents.\n", + "2. **Contoso ValueGap Plus**: Gap insurance that covers the difference between your car's value and the remaining loan balance in case of total loss.\n", + "3. **Contoso ExtendedCare Premium**: Extended warranty coverage for unexpected repairs and maintenance, keeping you worry-free on the road.\n", + "\n", + "These insurance options are tailored to safeguard your auto loan and offer peace of mind throughout your ownership journey. Let us know if you'd like more details about any of these policies or assistance with enrollment!\n", + "\n", + "Best regards, \n", + "The Contoso Insurance Team \n", + "\n", + "\n", + "If you would like me to elaborate on any specific insurance benefits or need further advice, feel free to ask!'\n" ] } ], @@ -376,25 +392,25 @@ }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "text/markdown": [ "\n", - "Hello Jane,\n", + "Hi Jane,\n", "\n", - "Congratulations on your loan application for your vehicle purchase! To ensure you're fully protected and have peace of mind, we've tailored a set of insurance recommendations that align perfectly with your $40,000 Auto Loan.\n", + "Thanks for reaching out to us regarding your Auto Loan application! Based on your loan details and financial profile, we have some excellent insurance recommendations to help protect you and your new vehicle:\n", "\n", - "1. **Contoso AutoGuard Elite**: Comprehensive coverage designed to protect you and your vehicle against accidents and unforeseen events.\n", - "2. **Contoso ValueGap Plus**: Helps cover the difference between the vehicle value and the remaining loan balance if your car is totaled or stolen.\n", - "3. **Contoso ExtendedCare Premium**: Offers extended warranty coverage, ensuring greater reliability for your new vehicle.\n", + "1. **Contoso AutoGuard Elite**: Comprehensive coverage designed to protect your investment in case of damage, theft, or accidents.\n", + "2. **Contoso ValueGap Plus**: Gap insurance that covers the difference between your car's value and the remaining loan balance in case of total loss.\n", + "3. **Contoso ExtendedCare Premium**: Extended warranty coverage for unexpected repairs and maintenance, keeping you worry-free on the road.\n", "\n", - "These plans are crafted to provide you the best protection and financial security as you enjoy your new vehicle. Let us know if you'd like more details or assistance in selecting the right coverage!\n", + "These insurance options are tailored to safeguard your auto loan and offer peace of mind throughout your ownership journey. Let us know if you'd like more details about any of these policies or assistance with enrollment!\n", "\n", - "We're here to help,\n", - "The Contoso Insurance Team\n" + "Best regards, \n", + "The Contoso Insurance Team \n" ], "text/plain": [ ""