← Back to Cookbook
parallel subtask agentic workflow
Details
File: mistral/agents/non_framework/agentic_workflows/parallel_subtask_agentic_workflow.ipynb
Type: Jupyter Notebook
Use Cases: Agents, Workflow
Content
Notebook content (JSON format):
{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "MfgV3YQgQ868" }, "source": [ "# Parallel Subtask Agent Workflow\n", "\n", "<a href=\"https://colab.research.google.com/github/mistralai/cookbook/blob/main/mistral/agents/non_framework/agentic_workflows/parallel_subtask_agentic_workflow.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>\n", "\n", "## Introduction\n", "\n", "This notebook demonstrates how to create a generic agent workflow that automatically breaks complex tasks into multiple subtasks.\n", "\n", "These subtasks are completed using parallel MistralAI LLM calls, enhanced with real-time information from Tavily API.\n", "\n", "The results are then synthesized into a comprehensive response.\n", "\n", "## Workflow Overview\n", "\n", "1. An orchestrator LLM analyzes the main task and breaks it into distinct, parallel subtasks\n", "2. Each subtask is assigned to a worker LLM with specialized instructions\n", "3. Workers execute in parallel, using Tavily API for up-to-date information as needed\n", "4. Results are synthesized into a unified response\n", "\n", "**NOTE**: We will use MistralAI’s LLM for subtask handling and response synthesis, and the Tavily API to retrieve up-to-date real." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Solution Architecture\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": { "id": "dvwX5wn2RICf" }, "source": [ "### Installation" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "U1t35izPN3Kt", "outputId": "9e461195-0727-41a2-c4be-c57c85b2cc44" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Requirement already satisfied: mistralai in /usr/local/lib/python3.11/dist-packages (1.5.0)\n", "Collecting mistralai\n", " Using cached mistralai-1.7.0-py3-none-any.whl.metadata (30 kB)\n", "Requirement already satisfied: eval-type-backport>=0.2.0 in /usr/local/lib/python3.11/dist-packages (from mistralai) (0.2.2)\n", "Requirement already satisfied: httpx>=0.28.1 in /usr/local/lib/python3.11/dist-packages (from mistralai) (0.28.1)\n", "Requirement already satisfied: pydantic>=2.10.3 in /usr/local/lib/python3.11/dist-packages (from mistralai) (2.11.3)\n", "Requirement already satisfied: python-dateutil>=2.8.2 in /usr/local/lib/python3.11/dist-packages (from mistralai) (2.8.2)\n", "Requirement already satisfied: typing-inspection>=0.4.0 in /usr/local/lib/python3.11/dist-packages (from mistralai) (0.4.0)\n", "Requirement already satisfied: anyio in /usr/local/lib/python3.11/dist-packages (from httpx>=0.28.1->mistralai) (4.9.0)\n", "Requirement already satisfied: certifi in /usr/local/lib/python3.11/dist-packages (from httpx>=0.28.1->mistralai) (2025.1.31)\n", "Requirement already satisfied: httpcore==1.* in /usr/local/lib/python3.11/dist-packages (from httpx>=0.28.1->mistralai) (1.0.8)\n", "Requirement already satisfied: idna in /usr/local/lib/python3.11/dist-packages (from httpx>=0.28.1->mistralai) (3.10)\n", "Requirement already satisfied: h11<0.15,>=0.13 in /usr/local/lib/python3.11/dist-packages (from httpcore==1.*->httpx>=0.28.1->mistralai) (0.14.0)\n", "Requirement already satisfied: annotated-types>=0.6.0 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.3->mistralai) (0.7.0)\n", "Requirement already satisfied: pydantic-core==2.33.1 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.3->mistralai) (2.33.1)\n", "Requirement already satisfied: typing-extensions>=4.12.2 in /usr/local/lib/python3.11/dist-packages (from pydantic>=2.10.3->mistralai) (4.13.2)\n", "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.11/dist-packages (from python-dateutil>=2.8.2->mistralai) (1.17.0)\n", "Requirement already satisfied: sniffio>=1.1 in /usr/local/lib/python3.11/dist-packages (from anyio->httpx>=0.28.1->mistralai) (1.3.1)\n", "Using cached mistralai-1.7.0-py3-none-any.whl (301 kB)\n", "Installing collected packages: mistralai\n", " Attempting uninstall: mistralai\n", " Found existing installation: mistralai 1.5.0\n", " Uninstalling mistralai-1.5.0:\n", " Successfully uninstalled mistralai-1.5.0\n", "Successfully installed mistralai-1.7.0\n" ] } ], "source": [ "!pip install -U mistralai" ] }, { "cell_type": "markdown", "metadata": { "id": "AJXkR7HXRK7f" }, "source": [ "### Imports" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "OkWZQHxTN9ba" }, "outputs": [], "source": [ "import os\n", "import json\n", "import asyncio\n", "import requests\n", "from typing import Any, Optional, Dict, List, Union\n", "from pydantic import Field, BaseModel, ValidationError\n", "from mistralai import Mistral\n", "from IPython.display import display, Markdown\n", "\n", "import nest_asyncio\n", "nest_asyncio.apply()" ] }, { "cell_type": "markdown", "metadata": { "id": "4ubMiQxxRNLg" }, "source": [ "### Set your API keys\n", "\n", "Here we set the API keys for `MistralAI` and `Tavily`. You can obtain the keys from the following links:\n", "\n", "1. MistralAI: https://console.mistral.ai/api-keys\n", "2. Tavily: https://app.tavily.com/home" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "vSw-cY8BOAmz" }, "outputs": [], "source": [ "MISTRAL_API_KEY = os.environ.get(\"MISTRAL_API_KEY\", \"<YOUR MISTRAL API KEY>\") # Get it from https://console.mistral.ai/api-keys\n", "TAVILY_API_KEY = os.environ.get(\"TAVILY_API_KEY\", \"<YOUR TAVILY API KEY>\") # Get it from https://app.tavily.com/home" ] }, { "cell_type": "markdown", "metadata": { "id": "WjtU8cq-RSd9" }, "source": [ "### Initialize Mistral client" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "vA57bhVfRUgi" }, "outputs": [], "source": [ "mistral_client = Mistral(api_key=MISTRAL_API_KEY)\n", "MISTRAL_MODEL = \"mistral-small-latest\" # Can be configured based on needs" ] }, { "cell_type": "markdown", "metadata": { "id": "G0Fka4m7RVjl" }, "source": [ "### Tavily API configuration" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "HepzvXGRON3d" }, "outputs": [], "source": [ "TAVILY_API_URL = \"https://api.tavily.com/search\"\n", "TAVILY_HEADERS = {\n", " \"Authorization\": f\"Bearer {TAVILY_API_KEY}\",\n", " \"Content-Type\": \"application/json\"\n", "}" ] }, { "cell_type": "markdown", "metadata": { "id": "VYpiHf3KRZcC" }, "source": [ "### Pydantic Models for Structured Data\n", "\n", "Pydantic models provide data validation and serialization, ensuring the data we receive from LLMs matches our expected structure. This helps maintain consistency between the orchestrator and worker components.\n", "\n", "**SubTask:** Individual subtask definition - defines a discrete unit of work with its type, description, and optional search query.\n", "\n", "**TaskList:** Output structure from the orchestrator - contains analysis and a list of defined subtasks to be executed in parallel." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "-KeTTFN4Oaa5" }, "outputs": [], "source": [ "class SubTask(BaseModel):\n", " \"\"\"Individual subtask definition\"\"\"\n", " task_id: str\n", " type: str\n", " description: str\n", " search_query: Optional[str] # Query for Tavily search for the subtask\n", "\n", "class TaskList(BaseModel):\n", " \"\"\"Structure for orchestrator output\"\"\"\n", " analysis: str\n", " subtasks: List[SubTask]" ] }, { "cell_type": "markdown", "metadata": { "id": "jcZqZmRpRcuu" }, "source": [ "### API Utility Functions\n", "\n", "API Utility functions handle communication with external APIs and process the responses, providing clean interfaces for the rest of the workflow.\n", "\n", "**fetch_information:** Retrieves relevant information from Tavily API based on a query and returns structured results.\n", "\n", "**run_mistral_llm:** Executes a standard call to Mistral AI with given prompts, returning the generated content.\n", "\n", "**parse_structured_output:** Uses Mistral's structured output capability to generate and parse responses according to Pydantic models." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "U6uv_hJhObH8" }, "outputs": [], "source": [ "def fetch_information(query: str, max_results: int = 3):\n", " \"\"\"Retrieve information from Tavily API\"\"\"\n", " payload = {\n", " \"query\": query,\n", " \"search_depth\": \"advanced\",\n", " \"include_answer\": True,\n", " \"max_results\": max_results\n", " }\n", "\n", " try:\n", " response = requests.post(TAVILY_API_URL, json=payload, headers=TAVILY_HEADERS)\n", " response.raise_for_status()\n", " return response.json()\n", " except requests.exceptions.RequestException as e:\n", " print(f\"Error fetching data from Tavily: {e}\")\n", " return {\"error\": str(e), \"results\": []}\n", "\n", "def run_mistral_llm(prompt: str, system_prompt: Optional[str] = None):\n", " \"\"\"Run Mistral LLM with given prompts\"\"\"\n", " messages = []\n", " if system_prompt:\n", " messages.append({\"role\": \"system\", \"content\": system_prompt})\n", "\n", " messages.append({\"role\": \"user\", \"content\": prompt})\n", "\n", " response = mistral_client.chat.complete(\n", " model=MISTRAL_MODEL,\n", " messages=messages,\n", " temperature=0.7,\n", " max_tokens=4000\n", " )\n", "\n", " return response.choices[0].message.content\n", "\n", "def parse_structured_output(prompt: str, response_format: BaseModel, system_prompt: Optional[str] = None):\n", " \"\"\"Get structured output from Mistral LLM based on a Pydantic model\"\"\"\n", " messages = []\n", " if system_prompt:\n", " messages.append({\"role\": \"system\", \"content\": system_prompt})\n", "\n", " messages.append({\"role\": \"user\", \"content\": prompt})\n", "\n", " response = mistral_client.chat.parse(\n", " model=MISTRAL_MODEL,\n", " messages=messages,\n", " response_format=response_format,\n", " temperature=0.2\n", " )\n", "\n", " return json.loads(response.choices[0].message.content)" ] }, { "cell_type": "markdown", "metadata": { "id": "ueyfF3u-RfvJ" }, "source": [ "### Async Worker Functions\n", "\n", "These functions enable parallel execution of subtasks, allowing the workflow to process multiple components simultaneously for greater efficiency.\n", "\n", "**run_task_async:** Executes a single subtask asynchronously, enhancing it with relevant information from Tavily when needed.\n", "\n", "**execute_tasks_in_parallel:** Manages the parallel execution of all subtasks, ensuring they run concurrently and their results are properly collected." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "piOeM8ckOfBG" }, "outputs": [], "source": [ "async def run_task_async(task: SubTask, original_task: str):\n", " \"\"\"Execute a single subtask asynchronously with Tavily enhancement\"\"\"\n", "\n", " # Prepare context with Tavily information if a search query is provided\n", " context = \"\"\n", " if task.search_query:\n", " print(f\"Fetching information for: {task.search_query}\")\n", " search_results = fetch_information(task.search_query)\n", "\n", " # Format search results into context\n", " if \"results\" in search_results and search_results[\"results\"]:\n", " context = \"### Relevant Information:\\n\"\n", " for result in search_results[\"results\"]:\n", " context += f\"- {result.get('content', '')}\\n\"\n", "\n", " if \"answer\" in search_results and search_results[\"answer\"]:\n", " context += f\"\\n### Summary: {search_results['answer']}\\n\"\n", "\n", " # Worker prompt with task information and context\n", " worker_prompt = f\"\"\"\n", " Complete the following subtask based on the given information:\n", "\n", " Original Task: {original_task}\n", "\n", " Subtask Type: {task.type}\n", " Subtask Description: {task.description}\n", "\n", " {context}\n", "\n", " Please provide a detailed response for this specific subtask only.\n", " \"\"\"\n", "\n", " # Use asyncio to run in a thread pool to prevent blocking\n", " return await asyncio.to_thread(\n", " run_mistral_llm,\n", " prompt=worker_prompt,\n", " system_prompt=\"You are a specialized agent focused on solving a specific aspect of a larger task.\"\n", " )\n", "\n", "async def execute_tasks_in_parallel(subtasks: List[SubTask], original_task: str):\n", " \"\"\"Execute all subtasks in parallel\"\"\"\n", " tasks = []\n", " for subtask in subtasks:\n", " tasks.append(run_task_async(subtask, original_task))\n", "\n", " return await asyncio.gather(*tasks)" ] }, { "cell_type": "markdown", "metadata": { "id": "7UWdikBhRjo_" }, "source": [ "## Main Workflow Function\n", "\n", "The primary orchestration function that coordinates the entire parallel subtask process from initial request to final synthesized response.\n", "\n", "**parallel_subtask_workflow:** Manages the complete workflow by orchestrating task decomposition, parallel execution of subtasks, and final synthesis of results into a comprehensive response.\n", "\n", "Steps:\n", "\n", "1. **Task Analysis:** The orchestrator analyzes the user's query and breaks it into distinct subtasks\n", "\n", "2. **Subtask Definition:** Each subtask is defined with a unique ID, type, description, and search query\n", "\n", "3. **Parallel Execution:** Subtasks are executed concurrently by worker agents\n", "Information Enhancement: Workers retrieve relevant information from Tavily when needed\n", "\n", "4. **Result Collection:** Outputs from all workers are gathered\n", "\n", "5. **Synthesis:** Individual results are combined into a comprehensive final response\n", "\n", "6. **Final Response:** Complete workflow results are returned, including both individual analyses and the synthesized answer" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Tp4O4u6VOjfB" }, "outputs": [], "source": [ "async def workflow(user_task: str):\n", " \"\"\"Main workflow function to process a task through the parallel subtask agent workflow\"\"\"\n", "\n", " print(\"=== USER TASK ===\\n\")\n", " print(user_task)\n", "\n", " # Step 1: Orchestrator breaks down the task into subtasks\n", " orchestrator_prompt = f\"\"\"\n", " Analyze this task and break it down into 3-5 distinct, specialized subtasks that could be executed in parallel:\n", "\n", " Task: {user_task}\n", "\n", " For each subtask:\n", " 1. Assign a unique task_id\n", " 2. Define a specific type that describes the subtask's focus\n", " 3. Write a clear description explaining what needs to be done\n", " 4. Provide a search query if the subtask requires additional information\n", "\n", " First, provide a brief analysis of your understanding of the task.\n", " Then, define the subtasks that would collectively solve this problem effectively.\n", "\n", " Remember to make the subtasks complementary, not redundant, focusing on different aspects of the problem.\n", " \"\"\"\n", "\n", " orchestrator_system_prompt = \"\"\"\n", " You are a task orchestrator that specializes in breaking down complex problems into smaller,\n", " well-defined subtasks that can be solved independently and in parallel. Think carefully about\n", " the most logical way to decompose the given task.\n", " \"\"\"\n", "\n", " print(\"\\nOrchestrating task decomposition...\")\n", " # Get structured output from orchestrator\n", " task_breakdown = parse_structured_output(\n", " prompt=orchestrator_prompt,\n", " response_format=TaskList,\n", " system_prompt=orchestrator_system_prompt\n", " )\n", "\n", " # Display orchestrator output\n", " print(\"\\n=== ORCHESTRATOR OUTPUT ===\")\n", " print(f\"\\nANALYSIS:\\n{task_breakdown['analysis']}\")\n", " print(\"\\nSUBTASKS:\")\n", " for task in task_breakdown[\"subtasks\"]:\n", " print(f\"- {task['task_id']}: {task['type']} - {task['description'][:100]}...\")\n", "\n", " # Step 2: Execute subtasks in parallel\n", " print(\"\\nExecuting subtasks in parallel...\")\n", " subtask_results = await execute_tasks_in_parallel(\n", " [SubTask(**task) for task in task_breakdown[\"subtasks\"]],\n", " user_task\n", " )\n", "\n", " # Display worker results\n", " for i, (task, result) in enumerate(zip(task_breakdown[\"subtasks\"], subtask_results)):\n", " print(f\"\\n=== WORKER RESULT ({task['type']}) ===\")\n", " print(f\"{result[:200]}...\\n\")\n", "\n", " # Step 3: Synthesize final response\n", " print(\"\\nSynthesizing final response...\")\n", "\n", " # Format worker responses for synthesizer\n", " worker_responses = \"\"\n", " for task, response in zip(task_breakdown[\"subtasks\"], subtask_results):\n", " worker_responses += f\"\\n=== SUBTASK: {task['type']} ===\\n{response}\\n\"\n", "\n", " synthesizer_prompt = f\"\"\"\n", " Given the following task: {user_task}\n", "\n", " And these responses from different specialized agents focusing on different aspects of the task:\n", "\n", " {worker_responses}\n", "\n", " Please synthesize a comprehensive, coherent response that addresses the original task.\n", " Integrate insights from all specialized agents while avoiding redundancy.\n", " Ensure your response is balanced, considering all the different perspectives provided.\n", " \"\"\"\n", "\n", " final_response = run_mistral_llm(\n", " prompt=synthesizer_prompt,\n", " system_prompt=\"You are a synthesis agent that combines specialized analyses into comprehensive responses.\"\n", " )\n", "\n", " return {\n", " \"orchestrator_analysis\": task_breakdown[\"analysis\"],\n", " \"subtasks\": task_breakdown[\"subtasks\"],\n", " \"subtask_results\": subtask_results,\n", " \"final_response\": final_response\n", " }" ] }, { "cell_type": "markdown", "metadata": { "id": "y3bnm5KSRrb7" }, "source": [ "### Run workflow with an example task\n", "\n", "Here we run the worklow with a sample example task comparing mobile phones recommendation" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "WOSO-AgRQKgi" }, "outputs": [], "source": [ "task = \"Compare the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and recommend which one I should purchase.\"" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/" }, "id": "2pux24-5OvUQ", "outputId": "4d38cab7-b9f4-42de-e07a-dc9fcfbaa80d" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "=== USER TASK ===\n", "\n", "Compare the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and recommend which one I should purchase.\n", "\n", "Orchestrating task decomposition...\n", "\n", "=== ORCHESTRATOR OUTPUT ===\n", "\n", "ANALYSIS:\n", "To effectively compare the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and recommend the best purchase, we need to break down the task into specialized subtasks that cover different aspects of the comparison. These aspects include performance, camera quality, user reviews, and pricing. Each subtask will focus on gathering and analyzing specific information to provide a comprehensive comparison.\n", "\n", "SUBTASKS:\n", "- TASK001: Performance Analysis - Compare the performance specifications of the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, ...\n", "- TASK002: Camera Quality Assessment - Evaluate the camera specifications and capabilities of the iPhone 16 Pro, iPhone 15 Pro, and Google ...\n", "- TASK003: User Reviews and Ratings - Gather and analyze user reviews and ratings for the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9...\n", "- TASK004: Pricing and Value Analysis - Compare the pricing of the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and assess the valu...\n", "\n", "Executing subtasks in parallel...\n", "Fetching information for: iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro performance comparison\n", "Fetching information for: iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro camera comparison\n", "Fetching information for: iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro user reviews\n", "Fetching information for: iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro pricing comparison\n", "\n", "=== WORKER RESULT (Performance Analysis) ===\n", "### Performance Analysis of iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "#### Processor\n", "- **iPhone 16 Pro**: Powered by the Apple A18 Pro chipset, which offers up to 15% faster CPU performanc...\n", "\n", "\n", "=== WORKER RESULT (Camera Quality Assessment) ===\n", "### Camera Quality Assessment for iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "#### iPhone 16 Pro\n", "- **Main Camera:** 48MP stacked sensor\n", "- **Ultrawide Camera:** 48MP\n", "- **Telephoto Camera:** 1...\n", "\n", "\n", "=== WORKER RESULT (User Reviews and Ratings) ===\n", "To gather and analyze user reviews and ratings for the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, I will focus on reputable sources such as tech review websites, consumer review platforms, ...\n", "\n", "\n", "=== WORKER RESULT (Pricing and Value Analysis) ===\n", "### Pricing and Value Analysis\n", "\n", "#### Pricing Comparison\n", "\n", "1. **Base Model (128GB):**\n", " - **iPhone 16 Pro:** $999\n", " - **iPhone 15 Pro:** $999\n", " - **Google Pixel 9 Pro:** $999\n", "\n", "2. **256GB Model:**\n", " ...\n", "\n", "\n", "Synthesizing final response...\n" ] } ], "source": [ "result = asyncio.run(workflow(task))" ] }, { "cell_type": "markdown", "metadata": { "id": "BeZn1N6lYWhj" }, "source": [ "### Final Response" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 930 }, "id": "B3yk2owrOxuC", "outputId": "e5fd8f7b-23af-44e6-9a64-25d563bca458" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "=== FINAL SYNTHESIZED RESPONSE ===\n" ] }, { "data": { "text/markdown": [ "### Comprehensive Comparison and Recommendation: iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "When comparing the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, several key factors stand out, including performance, camera quality, user reviews, and pricing. Here's a synthesized analysis to help you make an informed decision:\n", "\n", "#### Performance\n", "- **Processor**: The iPhone 16 Pro, powered by the Apple A18 Pro chipset, offers the best performance with up to 15% faster CPU and 20% faster graphics compared to the iPhone 15 Pro's A17 Pro chipset. The Google Pixel 9 Pro's Tensor G4 processor underperforms in benchmarks, making it the least powerful option.\n", "- **RAM**: Both iPhone models come with 8GB of RAM, while the Pixel 9 Pro is expected to have around 8GB or 12GB. This ensures smooth multitasking across all devices.\n", "- **Battery Life**: The iPhone 16 Pro benefits from improved battery efficiency and heat management, likely providing better battery life compared to the iPhone 15 Pro and potentially the Pixel 9 Pro, despite the Pixel's larger battery capacity.\n", "\n", "#### Camera Quality\n", "- **iPhone 16 Pro**: Excels in low-light performance, telephoto clarity, and offers advanced video capabilities like ProRes and Cinematic modes. It supports RAW photography and extensive manual controls.\n", "- **iPhone 15 Pro**: Good camera performance but lacks the advanced telephoto capabilities and low-light prowess of the iPhone 16 Pro.\n", "- **Google Pixel 9 Pro**: Competitive camera specs but generally doesn't match the iPhone 16 Pro in practical image quality, particularly in low-light conditions and telephoto performance.\n", "\n", "#### User Reviews and Ratings\n", "- **iPhone 16 Pro**: Highly rated for performance, camera quality, and battery life. Users appreciate the seamless integration of hardware and software.\n", "- **iPhone 15 Pro**: Well-received for performance and camera improvements, but some users find the incremental upgrades less compelling.\n", "- **Google Pixel 9 Pro**: Praised for camera and display quality but criticized for processor performance. Users appreciate the software experience but note it lags behind the iPhone 16 Pro in performance.\n", "\n", "#### Pricing and Value\n", "- **Base Model (128GB)**: All three models are priced at $999.\n", "- **256GB Model**: The iPhone models are priced at $1,099, while the Pixel 9 Pro is $1,199.\n", "- **512GB and 1TB Models**: The iPhone 16 Pro offers more storage options at competitive prices.\n", "- **Display**: The Pixel 9 Pro has a slightly better display with higher brightness, but the iPhone 16 Pro offers better color accuracy and minimum brightness.\n", "- **Software and Features**: The iPhone 16 Pro offers free Apple Intelligence features, while the Pixel 9 Pro comes with one year of Gemini Advanced (free for the first year, then $20/month).\n", "\n", "#### Recommendation\n", "- **For Performance and Overall User Experience**: The **iPhone 16 Pro** is the clear winner. It offers superior CPU and graphics performance, better battery management, and excellent camera capabilities. User reviews and ratings consistently praise its performance, camera quality, and battery life.\n", "- **For Budget-Conscious Users**: The **iPhone 15 Pro** is a solid option if you don't need the latest features of the iPhone 16 Pro. It offers good performance and camera quality at a potentially more affordable price point.\n", "- **For Camera and Display Enthusiasts**: The **Google Pixel 9 Pro** is a strong contender if you prioritize display brightness and camera specs. However, be aware of its underperforming processor and potential long-term costs for software features.\n", "\n", "In conclusion, if you prioritize performance, camera quality, and overall user experience, the **iPhone 16 Pro** is the best choice. If you are looking for a more budget-friendly option with still excellent performance, consider the **iPhone 15 Pro**. For those who value display and camera specs above all else, the **Google Pixel 9 Pro** might be the way to go, but be prepared for potential performance trade-offs." ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print(\"\\n=== FINAL SYNTHESIZED RESPONSE ===\")\n", "\n", "display(Markdown(result[\"final_response\"]))" ] }, { "cell_type": "markdown", "metadata": { "id": "_bC3omXZYbKf" }, "source": [ "### Examining Orchestrator Analysis, Subtask information and responses\n", "\n", "We can examine the Orchestrator Analysis, subtasks created, the corresponding search queries, and the individual responses." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 133 }, "id": "xXZEVYF7PHub", "outputId": "c6c7255b-5489-4f1d-812e-40371a88ac56" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "=== Orchestrator Analysis ===\n", "\n" ] }, { "data": { "text/markdown": [ "To effectively compare the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and recommend the best purchase, we need to break down the task into specialized subtasks that cover different aspects of the comparison. These aspects include performance, camera quality, user reviews, and pricing. Each subtask will focus on gathering and analyzing specific information to provide a comprehensive comparison." ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print(\"\\n=== Orchestrator Analysis ===\\n\")\n", "\n", "display(Markdown(result['orchestrator_analysis']))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 401 }, "id": "QJlYDFFdP389", "outputId": "c1f5b142-2951-44cd-f3be-4ea67bdcb285" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "=== SUBTASKS CREATED ===\n", "\n" ] }, { "data": { "text/markdown": [ "- TASK001: \n", " - Task type: Performance Analysis \n", " - Task Description: - Compare the performance specifications of the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, \n", " - search_query - iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro performance comparison" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- TASK002: \n", " - Task type: Camera Quality Assessment \n", " - Task Description: - Evaluate the camera specifications and capabilities of the iPhone 16 Pro, iPhone 15 Pro, and Google \n", " - search_query - iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro camera comparison" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- TASK003: \n", " - Task type: User Reviews and Ratings \n", " - Task Description: - Gather and analyze user reviews and ratings for the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 \n", " - search_query - iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro user reviews" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "- TASK004: \n", " - Task type: Pricing and Value Analysis \n", " - Task Description: - Compare the pricing of the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, and assess the valu \n", " - search_query - iPhone 16 Pro vs iPhone 15 Pro vs Google Pixel 9 Pro pricing comparison" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print(\"\\n=== SUBTASKS CREATED ===\\n\")\n", "\n", "for subtask in result['subtasks']:\n", " display(Markdown(f\"- {subtask['task_id']}: \\n - Task type: {subtask['type']} \\n - Task Description: - {subtask['description'][:100]} \\n - search_query - {subtask['search_query']}\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 1000 }, "id": "ZmnUBRcnP6qp", "outputId": "93de7c3b-bc7b-4d40-cf4f-327941ad0dd3" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "=== SUBTASKS RESULTS ===\n", "\n" ] }, { "data": { "text/markdown": [ "# Task_1 Result: \n", " ### Performance Analysis of iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "#### Processor\n", "- **iPhone 16 Pro**: Powered by the Apple A18 Pro chipset, which offers up to 15% faster CPU performance and 20% faster graphics performance compared to the A17 Pro chipset found in the iPhone 15 Pro. The A18 Pro also features improved heat dissipation, making it less prone to overheating during intensive tasks.\n", "- **iPhone 15 Pro**: Equipped with the Apple A17 Pro chipset, which is already a powerful processor but lags behind the A18 Pro in terms of CPU and graphics performance.\n", "- **Google Pixel 9 Pro**: Uses the Tensor G4 processor, which has underperformed in benchmark tests compared to its predecessors and competitors. It performs closer to midrange phones and barely outpaces its predecessor, the Tensor G3.\n", "\n", "#### RAM\n", "- **iPhone 16 Pro**: Typically comes with 8GB of RAM, which is sufficient for smooth multitasking and handling demanding applications.\n", "- **iPhone 15 Pro**: Also features 8GB of RAM, providing similar multitasking capabilities.\n", "- **Google Pixel 9 Pro**: Specifications for RAM are not explicitly mentioned in the provided information, but it is generally expected to have comparable RAM to its competitors, likely around 8GB or 12GB.\n", "\n", "#### Battery Life\n", "- **iPhone 16 Pro**: The A18 Pro chipset is designed with improved battery efficiency, which, combined with better heat management, should result in better battery life compared to the iPhone 15 Pro.\n", "- **iPhone 15 Pro**: The A17 Pro chipset is efficient, but the iPhone 16 Pro's improvements in battery management and heat dissipation give it an edge.\n", "- **Google Pixel 9 Pro**: Battery life specifics are not detailed, but the Tensor G4's performance issues might indicate less efficient battery management compared to the iPhone 16 Pro.\n", "\n", "### Summary\n", "- **iPhone 16 Pro**: Offers the best performance with its A18 Pro chipset, providing faster CPU and graphics performance, improved heat dissipation, and better battery efficiency.\n", "- **iPhone 15 Pro**: A strong performer with the A17 Pro chipset, but slightly behind the iPhone 16 Pro in terms of raw performance and battery efficiency.\n", "- **Google Pixel 9 Pro**: The Tensor G4 processor underperforms in benchmarks, making it the least powerful option among the three in terms of raw performance. Battery life specifics are unclear, but the processor's inefficiencies may impact overall battery performance.\n", "\n", "For users prioritizing performance, the iPhone 16 Pro is the clear winner due to its superior CPU and graphics performance, as well as better battery management. \n" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "# Task_2 Result: \n", " ### Camera Quality Assessment for iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "#### iPhone 16 Pro\n", "- **Main Camera:** 48MP stacked sensor\n", "- **Ultrawide Camera:** 48MP\n", "- **Telephoto Camera:** 12MP with 5x optical zoom (tetraprism telephoto)\n", "- **Special Features:**\n", " - **Low-Light Performance:** Superior in low-light conditions, capturing more detail and clarity.\n", " - **Telephoto Performance:** Despite having a 12MP telephoto lens, it outperforms higher megapixel competitors in capturing texture and fine details.\n", " - **Cinematic Video Modes:** Advanced video capabilities, including ProRes and Cinematic modes.\n", " - **RAW Photography:** Supports RAW photography for more flexibility in post-processing.\n", " - **Manual Adjustments:** Offers extensive manual controls for both photo and video.\n", "\n", "#### iPhone 15 Pro\n", "- **Main Camera:** 48MP stacked sensor\n", "- **Ultrawide Camera:** 12MP\n", "- **Telephoto Camera:** 12MP with 3x optical zoom\n", "- **Special Features:**\n", " - **Low-Light Performance:** Good, but not as advanced as the iPhone 16 Pro.\n", " - **Telephoto Performance:** Lacks the 5x optical zoom found in the iPhone 16 Pro, which might be a limitation for some users.\n", " - **Cinematic Video Modes:** Supports cinematic video modes but may not be as advanced as the iPhone 16 Pro.\n", " - **RAW Photography:** Supports RAW photography.\n", " - **Manual Adjustments:** Offers manual controls, though potentially less extensive than the iPhone 16 Pro.\n", "\n", "#### Google Pixel 9 Pro\n", "- **Main Camera:** 50MP\n", "- **Ultrawide Camera:** 48MP\n", "- **Telephoto Camera:** 48MP with 5x optical zoom\n", "- **Special Features:**\n", " - **Low-Light Performance:** Competitive but generally not as strong as the iPhone 16 Pro.\n", " - **Telephoto Performance:** Higher megapixel count but softer and smoother texture in images, lacking the clarity of the iPhone 16 Pro.\n", " - **Cinematic Video Modes:** Offers cinematic video modes but may not match the iPhone 16 Pro in terms of flexibility and quality.\n", " - **RAW Photography:** Supports RAW photography.\n", " - **Manual Adjustments:** Provides manual controls, but the overall camera system may not be as refined as Apple's.\n", "\n", "### Comparison Summary\n", "- **Megapixels:** The Pixel 9 Pro has higher megapixel counts across all lenses, but this does not necessarily translate to better image quality.\n", "- **Telephoto Performance:** The iPhone 16 Pro's telephoto lens, despite being 12MP, outperforms the Pixel 9 Pro's 48MP telephoto in terms of clarity and detail.\n", "- **Low-Light Performance:** The iPhone 16 Pro excels in low-light conditions, providing more detail and clarity.\n", "- **Special Features:** Both the iPhone 16 Pro and Pixel 9 Pro offer advanced features like RAW photography and cinematic video modes, but the iPhone 16 Pro's implementation may be more refined.\n", "\n", "### Recommendation\n", "For superior telephoto performance, low-light capabilities, and overall image clarity, the **iPhone 16 Pro** is the best choice. While the Pixel 9 Pro has impressive specs on paper, the iPhone 16 Pro delivers better practical image quality. The iPhone 15 Pro is a solid option but lacks the advanced telephoto capabilities of the iPhone 16 Pro. \n" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "# Task_3 Result: \n", " To gather and analyze user reviews and ratings for the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, I will focus on reputable sources such as tech review websites, consumer review platforms, and app store ratings. Here’s a detailed breakdown of the process and findings:\n", "\n", "### Sources for User Reviews and Ratings\n", "\n", "1. **Tech Review Websites**:\n", " - **TechRadar**: Known for in-depth reviews and user feedback.\n", " - **CNET**: Provides comprehensive reviews and user ratings.\n", " - **GSMArena**: Offers detailed specifications and user reviews.\n", " - **AnandTech**: Focuses on technical performance and user experiences.\n", "\n", "2. **Consumer Review Platforms**:\n", " - **Amazon**: User reviews and ratings from a wide range of customers.\n", " - **Best Buy**: Customer reviews and ratings with detailed feedback.\n", " - **Flipkart**: User reviews and ratings, especially relevant for international markets.\n", "\n", "3. **App Store Ratings**:\n", " - **Apple App Store**: Ratings and reviews for iPhone models.\n", " - **Google Play Store**: Ratings and reviews for Google Pixel models.\n", "\n", "### Analysis of User Reviews and Ratings\n", "\n", "#### iPhone 16 Pro\n", "- **TechRadar**: Users praise the iPhone 16 Pro for its exceptional performance, camera quality, and battery life. The A18 Pro chipset is frequently mentioned as a standout feature. However, some users note that the price is high.\n", "- **CNET**: Users highlight the excellent display and camera capabilities. Battery life is also a positive point, with many users reporting all-day usage without needing a charge.\n", "- **Amazon**: Users appreciate the build quality and software integration. Some users mention minor software bugs but overall satisfaction is high.\n", "- **Apple App Store**: High ratings with users praising the seamless integration of hardware and software, as well as the camera performance.\n", "\n", "#### iPhone 15 Pro\n", "- **TechRadar**: Users commend the iPhone 15 Pro for its performance and camera improvements over previous models. Battery life is also noted as a strong point.\n", "- **GSMArena**: Users appreciate the display quality and overall performance. Some users mention that the camera is slightly better than the previous model but not a significant upgrade.\n", "- **Best Buy**: Users highlight the build quality and software experience. Some users note that the price is a bit high for the incremental improvements.\n", "- **Apple App Store**: High ratings with users praising the camera and performance improvements.\n", "\n", "#### Google Pixel 9 Pro\n", "- **AnandTech**: Users appreciate the display quality and camera performance. However, some users note that the Tensor G4 processor is not as powerful as expected.\n", "- **CNET**: Users highlight the excellent camera capabilities and display quality. Battery life is also a positive point, but some users mention that the performance is not on par with the iPhone 16 Pro.\n", "- **Amazon**: Users appreciate the software experience and camera quality. Some users note that the processor performance is disappointing compared to the iPhone 16 Pro.\n", "- **Google Play Store**: Mixed ratings with users praising the camera and display but criticizing the processor performance.\n", "\n", "### Summary of User Reviews and Ratings\n", "\n", "- **iPhone 16 Pro**: Highly rated for performance, camera quality, and battery life. Users appreciate the seamless integration of hardware and software.\n", "- **iPhone 15 Pro**: Positive reviews for performance and camera improvements. Users note that the incremental upgrades are worth the price for some but not for others.\n", "- **Google Pixel 9 Pro**: Praised for camera and display quality but criticized for processor performance. Users appreciate the software experience but note that it lags behind the iPhone 16 Pro in performance.\n", "\n", "### Conclusion\n", "\n", "Based on user reviews and ratings, the iPhone 16 Pro stands out for its exceptional performance, camera quality, and battery life. The iPhone 15 Pro is also well-received but offers more incremental improvements. The Google Pixel 9 Pro is praised for its camera and display but falls short in processor performance compared to the iPhone models. For users prioritizing performance and overall user experience, the iPhone 16 Pro is the recommended choice. \n" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/markdown": [ "# Task_4 Result: \n", " ### Pricing and Value Analysis\n", "\n", "#### Pricing Comparison\n", "\n", "1. **Base Model (128GB):**\n", " - **iPhone 16 Pro:** $999\n", " - **iPhone 15 Pro:** $999\n", " - **Google Pixel 9 Pro:** $999\n", "\n", "2. **256GB Model:**\n", " - **iPhone 16 Pro:** $1,099 ($100 premium over the base model)\n", " - **iPhone 15 Pro:** $1,099 ($100 premium over the base model)\n", " - **Google Pixel 9 Pro:** $1,199 ($200 premium over the base model)\n", "\n", "3. **512GB Model:**\n", " - **iPhone 16 Pro:** $1,299\n", " - **Google Pixel 9 Pro:** $1,219\n", "\n", "4. **1TB Model:**\n", " - **iPhone 16 Pro:** $1,499\n", " - **Google Pixel 9 Pro:** $1,449\n", "\n", "#### Value for Money Analysis\n", "\n", "1. **Display Performance:**\n", " - The **Google Pixel 9 Pro** has a slightly better display with a higher maximum brightness (2007 nits vs. 1039 nits) and a slightly better color temperature (6665 vs. 6722). However, the iPhone 16 Pro has a better minimum brightness (0.97 vs. 2) and slightly better color accuracy (Delta E rgbcmy: 1.84 vs. 1.40).\n", " - Both phones offer excellent display performance, but the Pixel 9 Pro edges out the iPhone 16 Pro in terms of brightness.\n", "\n", "2. **Performance and Software:**\n", " - The **iPhone 16 Pro** is powered by the Apple A18 Pro chip, which is known for its exceptional performance and efficiency. The Google Pixel 9 Pro uses the Google Tensor G4, which is also powerful but may not match the A18 Pro in raw performance.\n", " - The iPhone 16 Pro offers Apple Intelligence features for free, while the Pixel 9 Pro comes with one year of Gemini Advanced for free, after which it costs $20 per month. This could be a significant cost consideration over time.\n", "\n", "3. **Battery and Dimensions:**\n", " - The **Google Pixel 9 Pro** has a larger battery (4,700 mAh vs. 3,582 mAh), which could translate to better battery life. However, the iPhone 16 Pro is slightly lighter and more compact.\n", " - The Pixel 9 Pro's larger battery capacity is a significant advantage for users who prioritize battery life.\n", "\n", "4. **Cameras:**\n", " - Both phones offer high-quality camera systems, but the Pixel 9 Pro has a slight edge with a 50MP main camera and 5x optical zoom. The iPhone 16 Pro has a 48MP main camera and 3x optical zoom.\n", " - The choice between the two camera systems may depend on personal preferences and specific use cases.\n", "\n", "5. **Storage and RAM:**\n", " - The **Google Pixel 9 Pro** offers 16GB of RAM in the base model, compared to 8GB in the iPhone 16 Pro. This could be beneficial for multitasking and running demanding applications.\n", " - However, the iPhone 16 Pro starts with 256GB of storage in the base model, compared to 128GB in the Pixel 9 Pro. This could be a consideration for users who need more storage space.\n", "\n", "#### Recommendation\n", "\n", "- **If you prioritize display brightness, battery life, and camera performance,** the **Google Pixel 9 Pro** offers better value for money, especially if you can take advantage of the free year of Gemini Advanced.\n", "- **If you prioritize performance, software integration, and storage space,** the **iPhone 16 Pro** provides a more compelling value proposition, particularly with its free Apple Intelligence features and more storage in the base model.\n", "- **The iPhone 15 Pro**, while not detailed in the performance and software section, offers the same starting price and storage options as the iPhone 16 Pro, making it a potentially more budget-friendly option if the additional features of the iPhone 16 Pro are not necessary.\n", "\n", "In summary, both the iPhone 16 Pro and Google Pixel 9 Pro offer competitive pricing and features, but the best choice depends on your specific needs and preferences. \n" ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print(\"\\n=== SUBTASKS RESULTS ===\\n\")\n", "\n", "for i, subtask_result in enumerate(result['subtask_results']):\n", "\n", " display(Markdown(f\"# Task_{i+1} Result: \\n {subtask_result} \\n\"))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "colab": { "base_uri": "https://localhost:8080/", "height": 930 }, "id": "R7Kva1U6P-Qj", "outputId": "93989566-6b99-47c5-f138-b99891055c3c" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "\n", "=== FINAL SYNTHESIZED RESPONSE ===\n" ] }, { "data": { "text/markdown": [ "### Comprehensive Comparison and Recommendation: iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro\n", "\n", "When comparing the iPhone 16 Pro, iPhone 15 Pro, and Google Pixel 9 Pro, several key factors stand out, including performance, camera quality, user reviews, and pricing. Here's a synthesized analysis to help you make an informed decision:\n", "\n", "#### Performance\n", "- **Processor**: The iPhone 16 Pro, powered by the Apple A18 Pro chipset, offers the best performance with up to 15% faster CPU and 20% faster graphics compared to the iPhone 15 Pro's A17 Pro chipset. The Google Pixel 9 Pro's Tensor G4 processor underperforms in benchmarks, making it the least powerful option.\n", "- **RAM**: Both iPhone models come with 8GB of RAM, while the Pixel 9 Pro is expected to have around 8GB or 12GB. This ensures smooth multitasking across all devices.\n", "- **Battery Life**: The iPhone 16 Pro benefits from improved battery efficiency and heat management, likely providing better battery life compared to the iPhone 15 Pro and potentially the Pixel 9 Pro, despite the Pixel's larger battery capacity.\n", "\n", "#### Camera Quality\n", "- **iPhone 16 Pro**: Excels in low-light performance, telephoto clarity, and offers advanced video capabilities like ProRes and Cinematic modes. It supports RAW photography and extensive manual controls.\n", "- **iPhone 15 Pro**: Good camera performance but lacks the advanced telephoto capabilities and low-light prowess of the iPhone 16 Pro.\n", "- **Google Pixel 9 Pro**: Competitive camera specs but generally doesn't match the iPhone 16 Pro in practical image quality, particularly in low-light conditions and telephoto performance.\n", "\n", "#### User Reviews and Ratings\n", "- **iPhone 16 Pro**: Highly rated for performance, camera quality, and battery life. Users appreciate the seamless integration of hardware and software.\n", "- **iPhone 15 Pro**: Well-received for performance and camera improvements, but some users find the incremental upgrades less compelling.\n", "- **Google Pixel 9 Pro**: Praised for camera and display quality but criticized for processor performance. Users appreciate the software experience but note it lags behind the iPhone 16 Pro in performance.\n", "\n", "#### Pricing and Value\n", "- **Base Model (128GB)**: All three models are priced at $999.\n", "- **256GB Model**: The iPhone models are priced at $1,099, while the Pixel 9 Pro is $1,199.\n", "- **512GB and 1TB Models**: The iPhone 16 Pro offers more storage options at competitive prices.\n", "- **Display**: The Pixel 9 Pro has a slightly better display with higher brightness, but the iPhone 16 Pro offers better color accuracy and minimum brightness.\n", "- **Software and Features**: The iPhone 16 Pro offers free Apple Intelligence features, while the Pixel 9 Pro comes with one year of Gemini Advanced (free for the first year, then $20/month).\n", "\n", "#### Recommendation\n", "- **For Performance and Overall User Experience**: The **iPhone 16 Pro** is the clear winner. It offers superior CPU and graphics performance, better battery management, and excellent camera capabilities. User reviews and ratings consistently praise its performance, camera quality, and battery life.\n", "- **For Budget-Conscious Users**: The **iPhone 15 Pro** is a solid option if you don't need the latest features of the iPhone 16 Pro. It offers good performance and camera quality at a potentially more affordable price point.\n", "- **For Camera and Display Enthusiasts**: The **Google Pixel 9 Pro** is a strong contender if you prioritize display brightness and camera specs. However, be aware of its underperforming processor and potential long-term costs for software features.\n", "\n", "In conclusion, if you prioritize performance, camera quality, and overall user experience, the **iPhone 16 Pro** is the best choice. If you are looking for a more budget-friendly option with still excellent performance, consider the **iPhone 15 Pro**. For those who value display and camera specs above all else, the **Google Pixel 9 Pro** might be the way to go, but be prepared for potential performance trade-offs." ], "text/plain": [ "<IPython.core.display.Markdown object>" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "print(\"\\n=== FINAL SYNTHESIZED RESPONSE ===\")\n", "\n", "display(Markdown(result[\"final_response\"]))" ] } ], "metadata": { "colab": { "provenance": [] }, "kernelspec": { "display_name": "Python 3", "name": "python3" }, "language_info": { "name": "python" } }, "nbformat": 4, "nbformat_minor": 0 }