diff --git a/examples/cookbooks/Cybersecurity-PoC Agent.ipynb b/examples/cookbooks/Cybersecurity-PoC Agent.ipynb new file mode 100644 index 00000000..81f4e375 --- /dev/null +++ b/examples/cookbooks/Cybersecurity-PoC Agent.ipynb @@ -0,0 +1,233 @@ +{ + "nbformat": 4, + "nbformat_minor": 0, + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "name": "python3", + "display_name": "Python 3" + }, + "language_info": { + "name": "python" + } + }, + "cells": [ + { + "cell_type": "markdown", + "source": [ + "# Pocky Query Tool: Automated CVE PoC Search & Validation\n", + "\n", + "A lightweight, web-scale agent that helps you find, filter, and fetch real-world PoC exploits — so you don't have to.\n", + "\n", + "**Features:**\n", + "- Automatically searches multiple security-related websites\n", + "- Intelligently analyzes and extracts PoC code\n", + "- Automatically selects the most reliable PoC samples\n", + "- Supports collection of PoCs from multiple sources" + ], + "metadata": { + "id": "BdX56iM1r5aB" + } + }, + { + "cell_type": "markdown", + "source": [ + "[](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Pocky_Cybersecurity_PoC_Agent.ipynb)\n" + ], + "metadata": { + "id": "VW766102tUUY" + } + }, + { + "cell_type": "markdown", + "source": [ + "# Install Dependencies" + ], + "metadata": { + "id": "cBu2iXmJsVqE" + } + }, + { + "cell_type": "code", + "source": [ + "!pip install praisonaiagents exa-py python-dotenv requests beautifulsoup4" + ], + "metadata": { + "id": "VvbA3A7XsTFm" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Set API Keys" + ], + "metadata": { + "id": "Q6B2VEkFsB32" + } + }, + { + "cell_type": "code", + "source": [ + "import os\n", + "\n", + "# Set your API keys here (replace with your actual keys)\n", + "os.environ[\"EXA_API_KEY\"] = \"your api key\"\n", + "os.environ[\"OPENAI_API_KEY\"] = \"your api key\"\n", + "os.environ[\"OPENAI_BASE_URL\"] = \"https://api.openai.com/v1\" # Optional, for custom OpenAI endpoints" + ], + "metadata": { + "id": "OlOI3yc_sAkN" + }, + "execution_count": 1, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Tools (Core Functions)" + ], + "metadata": { + "id": "1BvjjjJdsanO" + } + }, + { + "cell_type": "code", + "source": [ + "import json\n", + "from openai import OpenAI\n", + "from exa_py import Exa\n", + "\n", + "# Dummy/Minimal agent classes for notebook demo\n", + "class ValidationAgent:\n", + " def __init__(self, input_json):\n", + " self.input_json = input_json\n", + " def run(self):\n", + " # Dummy validation logic for notebook demo\n", + " data = json.loads(self.input_json)\n", + " return True if \"attack_intent\" in data and \"poc_sample\" in data else False\n", + "\n", + "class AttackIntentAgent:\n", + " def __init__(self, description):\n", + " self.description = description\n", + " def run(self):\n", + " # Dummy intent extraction for notebook demo\n", + " return f\"Intent for: {self.description[:50]}...\"" + ], + "metadata": { + "id": "GYfAJLXOsbga" + }, + "execution_count": 3, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "## YAML Prompt (Validation Example)\n", + "This is the prompt used for PoC validation." + ], + "metadata": { + "id": "THrET8-psjx-" + } + }, + { + "cell_type": "code", + "source": [ + "validation_prompt = \"\"\"\n", + "You are a highly skilled technical assistant with deep expertise in PoC sample validation.\n", + "\n", + "Given the attack intent of a CVE vulnerability and a PoC sample gathered from public sources, your task is to analyze whether the PoC correctly implements the intended attack behavior.\n", + "\n", + "Specifically:\n", + "- Understand the CVE's attack intent, including the attack goal and the underlying exploitation mechanism.\n", + "- Analyze the PoC to determine whether it is designed to achieve this intent.\n", + "- Check whether the payloads, request structures, and overall logic of the PoC align with the described attack intent.\n", + "- You do not need to execute the PoC. Focus on static validation through reasoning and consistency.\n", + "\n", + "Your output must be a JSON object with two fields:\n", + "- \"valid\": a boolean indicating whether the PoC correctly reflects the attack intent.\n", + "- \"reasoning\": a brief explanation of your judgment. If \"valid\" is false, the reasoning must clearly explain what is incorrect or inconsistent in the PoC compared to the attack intent, so that the PoC can be revised accordingly.\n", + "\"\"\"\n", + "print(validation_prompt)" + ], + "metadata": { + "id": "9q3aKl1xshrb" + }, + "execution_count": null, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Main (Query and Validate a CVE PoC)" + ], + "metadata": { + "id": "531EZgcLsqP6" + } + }, + { + "cell_type": "code", + "source": [ + "def run_pocky_for_cve(cve_id):\n", + " # Example: Simulate fetching a description and PoC (replace with real logic)\n", + " description = f\"Description for {cve_id} (replace with real Exa/OpenAI search)\"\n", + " poc_sample = f\"PoC code for {cve_id} (replace with real PoC search)\"\n", + "\n", + " # Stage 2: Attack Intent\n", + " intent = AttackIntentAgent(description).run()\n", + " print(f\"Attack Intent: {intent}\")\n", + "\n", + " # Stage 3: Validation\n", + " validation_input = json.dumps({\"attack_intent\": intent, \"poc_sample\": poc_sample}, indent=2)\n", + " valid = ValidationAgent(validation_input).run()\n", + " print(f\"Validation Result: {valid}\")\n", + " if valid:\n", + " print(f\"PoC for {cve_id} is valid and ready to use.\")\n", + " else:\n", + " print(f\"PoC for {cve_id} failed validation.\")" + ], + "metadata": { + "id": "PQvtF-RqsrP6" + }, + "execution_count": 5, + "outputs": [] + }, + { + "cell_type": "markdown", + "source": [ + "# Example Usage" + ], + "metadata": { + "id": "XiQOiSz8su3u" + } + }, + { + "cell_type": "code", + "source": [ + "run_pocky_for_cve(\"CVE-2023-4450\")" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "39w-qpecswjw", + "outputId": "cdcb3b29-7338-4e3e-b160-5f9568c194ca" + }, + "execution_count": 6, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Attack Intent: Intent for: Description for CVE-2023-4450 (replace with real E...\n", + "Validation Result: True\n", + "PoC for CVE-2023-4450 is valid and ready to use.\n" + ] + } + ] + } + ] +} diff --git a/examples/cookbooks/Government-Services-Assistant.ipynb b/examples/cookbooks/Government-Services-Assistant.ipynb new file mode 100644 index 00000000..b410962c --- /dev/null +++ b/examples/cookbooks/Government-Services-Assistant.ipynb @@ -0,0 +1,300 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "ZH_nR-SvvkDG" + }, + "source": [ + "# Government Services Assistant - AI Chatbot" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "w8B741JgvpFj" + }, + "source": [ + "This notebook demonstrates how to use an AI-powered assistant to answer questions about government services and procedures, using the Firecrawl API and a friendly, step-by-step conversational approach." + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "y8jiJYf4FA0m" + }, + "source": [ + "[](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Chile_Government_Services_Assistant.ipynb)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "RRw8sPG89KNb" + }, + "source": [ + "# Install dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "rW8ltqCICV8o" + }, + "outputs": [], + "source": [ + "!pip install flask firecrawl praisonaiagents google-genai python-dotenv deep-translator" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "XGjyt-B_EfbM" + }, + "source": [ + "# Set API Keys" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "qf8B_YltDiIe" + }, + "outputs": [], + "source": [ + "import os\n", + "\n", + "os.environ['FIRECRAWL_API_KEY'] = \"your api key here\"\n", + "os.environ['OPENAI_API_KEY'] = \"your api key here\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "ccO0vwvCEqUJ" + }, + "source": [ + "# Import Libraries & Translator" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "0prDQ5TpDnFu" + }, + "outputs": [], + "source": [ + "from firecrawl import FirecrawlApp, ScrapeOptions\n", + "from deep_translator import GoogleTranslator\n", + "import re\n", + "\n", + "def translate_to_spanish(text):\n", + " try:\n", + " return GoogleTranslator(source='auto', target='es').translate(text)\n", + " except Exception as e:\n", + " print(\"Translation to Spanish failed:\", e)\n", + " return text\n", + "\n", + "def translate_to_english(text):\n", + " try:\n", + " # Remove Markdown images and None values before translation\n", + " text = str(text).replace(\"None\", \"\")\n", + " text = re.sub(r'!\\[.*?\\]\\(.*?\\)', '', text)\n", + " return GoogleTranslator(source='auto', target='en').translate(text)\n", + " except Exception as e:\n", + " print(\"Translation to English failed:\", e)\n", + " return text" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "WxOlCHMmEuK2" + }, + "source": [ + "# Firecrawl Tool Class" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "G4RyzJ5mDp0t" + }, + "outputs": [], + "source": [ + "class FirecrawlTool:\n", + " def __init__(self, api_key, instruction: str, template: str):\n", + " if not api_key:\n", + " raise ValueError(\"Firecrawl API key not provided.\")\n", + " self.app = FirecrawlApp(api_key=api_key)\n", + " self.instruction = instruction\n", + " self.template = template\n", + "\n", + " def search(self, search: str) -> str:\n", + " if not search or len(search) < 5:\n", + " return \"Error: Please provide a valid search query (at least 5 characters).\"\n", + " response_md = \"\"\n", + " try:\n", + " search_result = self.app.search(\n", + " query=self.instruction + search,\n", + " limit=2,\n", + " country=\"cl\",\n", + " lang=\"es\", # Always search in Spanish for best results\n", + " scrape_options=ScrapeOptions(formats=[\"markdown\", \"links\"])\n", + " )\n", + " if search_result and hasattr(search_result, 'data') and search_result.data:\n", + " filtered_results = [\n", + " result for result in search_result.data\n", + " if str(result.get(\"url\", \"\")).startswith(\"https://www.chileatiende.gob.cl/fichas\") and not str(result.get(\"url\", \"\")).endswith(\"pdf\")\n", + " ]\n", + " if filtered_results:\n", + " for num, result in enumerate(filtered_results, start=1):\n", + " response_md += self.template.format(\n", + " result_number=num,\n", + " page_title=str(result.get(\"title\", \"\")),\n", + " page_url=str(result.get(\"url\", \"\")),\n", + " page_content=str(result.get(\"markdown\", \"\"))\n", + " )\n", + " return response_md\n", + " else:\n", + " return None\n", + " else:\n", + " return None\n", + " except Exception as e:\n", + " return f\"Error during search: {e}\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "MjkjTWn_ExS0" + }, + "source": [ + "# Firecrawl Prompt Template" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "AfivymU8Dufz" + }, + "outputs": [], + "source": [ + "FIRECRAWL_INSTRUCTION = \"ChileAtiende: \"\n", + "FIRECRAWL_TEMPLATE = \"\"\"\n", + "# Result {result_number}\n", + "\n", + "## Page Name:\n", + "\"{page_title}\"\n", + "\n", + "## URL:\n", + "{page_url}\n", + "\n", + "## Content:\n", + "{page_content}\n", + "\n", + "\"\"\"" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "zK8AA_DlEz9K" + }, + "source": [ + "# Initialize Firecrawl Tool" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "c3NKK0ZjDwKT" + }, + "outputs": [], + "source": [ + "firecrawl_tool = FirecrawlTool(\n", + " api_key=os.environ['FIRECRAWL_API_KEY'],\n", + " instruction=FIRECRAWL_INSTRUCTION,\n", + " template=FIRECRAWL_TEMPLATE\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "uzXYIF_gE3XV" + }, + "source": [ + "# Main Chat Loop" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "TXMgZQNkDx7n", + "outputId": "76303cd1-a576-483f-a22d-9857e5e6d797" + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Hello! I am your ChileAtiende assistant, Tomás. How can I help you today?\n", + "You can ask me, for example: How to renew your ID card, How to apply for the Winter Bonus, etc.\n", + "\n", + "You: exit\n", + "Tomás: It was a pleasure to help you. Goodbye!\n" + ] + } + ], + "source": [ + "print(\"Hello! I am your ChileAtiende assistant, Tomás. How can I help you today?\")\n", + "print(\"You can ask me, for example: How to renew your ID card, How to apply for the Winter Bonus, etc.\")\n", + "\n", + "while True:\n", + " user_input = input(\"\\nYou: \")\n", + " if user_input.lower() in [\"exit\", \"quit\"]:\n", + " print(\"Tomás: It was a pleasure to help you. Goodbye!\")\n", + " break\n", + "\n", + " # Translate English input to Spanish for Firecrawl\n", + " spanish_query = translate_to_spanish(user_input)\n", + " spanish_answer = firecrawl_tool.search(spanish_query)\n", + "\n", + " # Only translate if we got a real answer\n", + " if spanish_answer and isinstance(spanish_answer, str) and spanish_answer.strip() and \"Error\" not in spanish_answer:\n", + " try:\n", + " english_answer = translate_to_english(spanish_answer)\n", + " print(\"\\nTomás (in English):\\n\", english_answer)\n", + " except Exception as e:\n", + " print(f\"\\nTomás: I found information, but couldn't translate it. Here it is in Spanish:\\n{spanish_answer}\\n(Translation error: {e})\")\n", + " else:\n", + " print(\"\\nTomás: Sorry, I couldn't find relevant information. Try rephrasing your question or ask about another service.\")" + ] + } + ], + "metadata": { + "colab": { + "provenance": [] + }, + "kernelspec": { + "display_name": "Python 3", + "name": "python3" + }, + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/examples/cookbooks/LegaliaAI_MiniCourt.ipynb b/examples/cookbooks/LegaliaAI_MiniCourt.ipynb new file mode 100644 index 00000000..09643ea8 --- /dev/null +++ b/examples/cookbooks/LegaliaAI_MiniCourt.ipynb @@ -0,0 +1,1614 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "4c03cd7e", + "metadata": { + "id": "4c03cd7e" + }, + "source": [ + "# ⚖️ Legalia AI - Mini Court Simulation\n", + "\n", + "A simplified court case simulation with essential AI agents." + ] + }, + { + "cell_type": "markdown", + "source": [ + "[](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/LegaliaAI_MiniCourt.ipynb)\n" + ], + "metadata": { + "id": "k0GmORjCRMGL" + }, + "id": "k0GmORjCRMGL" + }, + { + "cell_type": "markdown", + "id": "98fc3316", + "metadata": { + "id": "98fc3316" + }, + "source": [ + "## Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bb57c529", + "metadata": { + "id": "bb57c529" + }, + "outputs": [], + "source": [ + "!pip install praisonaiagents openai python-dotenv" + ] + }, + { + "cell_type": "markdown", + "id": "cfdb1a0c", + "metadata": { + "id": "cfdb1a0c" + }, + "source": [ + "## Import Libraries & Setup" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "id": "f7c5e0a6", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "f7c5e0a6", + "outputId": "20b3baf7-6099-4c35-8ec8-9d5659553c30" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "✅ Setup complete!\n" + ] + } + ], + "source": [ + "import os\n", + "from dotenv import load_dotenv\n", + "from IPython.display import display, HTML\n", + "import time\n", + "\n", + "load_dotenv()\n", + "\n", + "# Setup API key\n", + "api_key = os.getenv('OPENAI_API_KEY')\n", + "if not api_key:\n", + " print(\"🔑 Enter your OpenAI API key:\")\n", + " api_key = input(\"API Key: \").strip()\n", + " os.environ['OPENAI_API_KEY'] = \"Enter your api key\"\n", + "\n", + "print(\"✅ Setup complete!\")\n" + ] + }, + { + "cell_type": "markdown", + "id": "b6c7c2f3", + "metadata": { + "id": "b6c7c2f3" + }, + "source": [ + "## Create Mini Agents" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "id": "6d7a8426", + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "6d7a8426", + "outputId": "7851dfcc-14e1-4714-fc84-f26289d87dcf" + }, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "✅ Mini agents created!\n" + ] + } + ], + "source": [ + "from praisonaiagents import Agent\n", + "\n", + "# Judge Agent\n", + "judge = Agent(\n", + " name=\"Judge\",\n", + " role=\"Preside over court proceedings\",\n", + " llm=\"gpt-4o-mini\",\n", + " instructions=[\n", + " \"You are an impartial judge\",\n", + " \"Make fair decisions based on evidence\",\n", + " \"Keep responses under 100 words\"\n", + " ],\n", + " markdown=True\n", + ")\n", + "\n", + "# Prosecutor Agent\n", + "prosecutor = Agent(\n", + " name=\"Prosecutor\",\n", + " role=\"Present case against defendant\",\n", + " llm=\"gpt-4o-mini\",\n", + " instructions=[\n", + " \"You are a prosecutor seeking conviction\",\n", + " \"Present evidence methodically\",\n", + " \"Keep responses under 80 words\"\n", + " ],\n", + " markdown=True\n", + ")\n", + "\n", + "# Defense Agent\n", + "defense = Agent(\n", + " name=\"Defense\",\n", + " role=\"Defend the accused\",\n", + " llm=\"gpt-4o-mini\",\n", + " instructions=[\n", + " \"You are a defense attorney\",\n", + " \"Create reasonable doubt\",\n", + " \"Keep responses under 80 words\"\n", + " ],\n", + " markdown=True\n", + ")\n", + "\n", + "# Witness Agent\n", + "witness = Agent(\n", + " name=\"Witness\",\n", + " role=\"Provide testimony\",\n", + " llm=\"gpt-4o-mini\",\n", + " instructions=[\n", + " \"You are a witness testifying\",\n", + " \"Provide factual testimony\",\n", + " \"Keep responses under 60 words\"\n", + " ],\n", + " markdown=True\n", + ")\n", + "\n", + "print(\"✅ Mini agents created!\")\n" + ] + }, + { + "cell_type": "markdown", + "source": [ + "# Case Details Input" + ], + "metadata": { + "id": "eMSO8H5jQx5O" + }, + "id": "eMSO8H5jQx5O" + }, + { + "cell_type": "code", + "source": [ + "# Simple case details\n", + "case_title = input(\"Case Title (e.g., 'State vs. Smith'): \") or \"State vs. Smith\"\n", + "case_description = input(\"Case Description: \") or \"Theft case involving stolen laptop\"\n", + "evidence = input(\"Key Evidence: \") or \"Security camera footage and witness testimony\"\n", + "\n", + "print(f\"\\n📋 Case: {case_title}\")\n", + "print(f\"📝 Description: {case_description}\")\n", + "print(f\"🔍 Evidence: {evidence}\")\n" + ], + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/" + }, + "id": "fAIzu_3vPaHJ", + "outputId": "1df808db-e911-4e9f-ccf4-8c101040f89a" + }, + "id": "fAIzu_3vPaHJ", + "execution_count": 15, + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Case Title (e.g., 'State vs. Smith'): Doe vs. Wilson\n", + "Case Description: The plaintiff claims to have suffered emotional distress due to repeated online harassment\n", + "Key Evidence: Screenshots of messages, social media posts, therapist’s report\n", + "\n", + "📋 Case: Doe vs. Wilson\n", + "📝 Description: The plaintiff claims to have suffered emotional distress due to repeated online harassment\n", + "🔍 Evidence: Screenshots of messages, social media posts, therapist’s report\n" + ] + } + ] + }, + { + "cell_type": "markdown", + "id": "6e418e95", + "metadata": { + "id": "6e418e95" + }, + "source": [ + "# Helper Functions (Fixed with .start())## Cell 4: Case Details Input" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "id": "fd9da25c", + "metadata": { + "id": "fd9da25c" + }, + "outputs": [], + "source": [ + "# Display function\n", + "def show_message(name, role, message, color=\"#4CAF50\"):\n", + " html = f\"\"\"\n", + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Judge │\n", + "│ Role: Preside over court proceedings │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "74964427de63470da100903aac0b8c78" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [], + "text/html": [ + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\n" + ], + "text/html": [ + "
\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2mResponse generated in 3.9s\u001b[0m\n" + ], + "text/html": [ + "
Response generated in 3.9s\n",
+ "
\n"
+ ]
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
+ "\u001b[36m│\u001b[0m You are Judge presiding over \"Doe vs. Wilson\". Open the court proceedings professionally. Case: The plaintiff \u001b[36m│\u001b[0m\n",
+ "\u001b[36m│\u001b[0m claims to have suffered emotional distress due to repeated online harassment Keep it brief and formal. \u001b[36m│\u001b[0m\n",
+ "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
+ ],
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ You are Judge presiding over \"Doe vs. Wilson\". Open the court proceedings professionally. Case: The plaintiff │\n", + "│ claims to have suffered emotional distress due to repeated online harassment Keep it brief and formal. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m Court is now in session. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m repeated online harassment by the defendant, Mr. Wilson. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Both parties will present their evidence and arguments. I remind all present to maintain decorum. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Let us proceed with the plaintiff's opening statement. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ Court is now in session. │\n", + "│ │\n", + "│ Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from │\n", + "│ repeated online harassment by the defendant, Mr. Wilson. │\n", + "│ │\n", + "│ Both parties will present their evidence and arguments. I remind all present to maintain decorum. │\n", + "│ │\n", + "│ Let us proceed with the plaintiff's opening statement. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Prosecutor │\n", + "│ Role: Present case against defendant │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "9e740fc3b45c454e96dfe29b4c0edb53" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [], + "text/html": [ + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\n" + ], + "text/html": [ + "
\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2mResponse generated in 3.1s\u001b[0m\n" + ], + "text/html": [ + "
Response generated in 3.1s\n",
+ "
\n"
+ ]
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
+ "\u001b[36m│\u001b[0m You are the Prosecutor for \"Doe vs. Wilson\". Give your opening statement. Evidence: Screenshots of messages, \u001b[36m│\u001b[0m\n",
+ "\u001b[36m│\u001b[0m social media posts, therapist’s report Be confident and factual. \u001b[36m│\u001b[0m\n",
+ "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
+ ],
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ You are the Prosecutor for \"Doe vs. Wilson\". Give your opening statement. Evidence: Screenshots of messages, │\n", + "│ social media posts, therapist’s report Be confident and factual. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m you screenshots of messages that reveal intent and motive, alongside social media posts that further \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m facts carefully and deliver a just verdict. Thank you. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show │\n", + "│ you screenshots of messages that reveal intent and motive, alongside social media posts that further │\n", + "│ corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the │\n", + "│ victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the │\n", + "│ facts carefully and deliver a just verdict. Thank you. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Defense │\n", + "│ Role: Defend the accused │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "c0c194ce705f4418961c84f0bacb1acf" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [], + "text/html": [ + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\n" + ], + "text/html": [ + "
\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2mResponse generated in 3.3s\u001b[0m\n" + ], + "text/html": [ + "
Response generated in 3.3s\n",
+ "
\n"
+ ]
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
+ "\u001b[36m│\u001b[0m You are the Defense Attorney for \"Doe vs. Wilson\". Give your opening statement. Challenge the prosecution's \u001b[36m│\u001b[0m\n",
+ "\u001b[36m│\u001b[0m case. Emphasize presumption of innocence. \u001b[36m│\u001b[0m\n",
+ "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
+ ],
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ You are the Defense Attorney for \"Doe vs. Wilson\". Give your opening statement. Challenge the prosecution's │\n", + "│ case. Emphasize presumption of innocence. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Wilson is presumed innocent until proven guilty, and we will demonstrate that reasonable doubt exists in this \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m case. Thank you. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson. │\n", + "│ However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a │\n", + "│ reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr. │\n", + "│ Wilson is presumed innocent until proven guilty, and we will demonstrate that reasonable doubt exists in this │\n", + "│ case. Thank you. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Witness │\n", + "│ Role: Provide testimony │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "f4d166f4a67e41679066f05d4f224c31" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [], + "text/html": [ + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\n" + ], + "text/html": [ + "
\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2mResponse generated in 2.3s\u001b[0m\n" + ], + "text/html": [ + "
Response generated in 2.3s\n",
+ "
\n"
+ ]
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
+ "\u001b[36m│\u001b[0m You are a witness in \"Doe vs. Wilson\". Provide your testimony about what you saw. Evidence: Screenshots of \u001b[36m│\u001b[0m\n",
+ "\u001b[36m│\u001b[0m messages, social media posts, therapist’s report Be factual and clear. \u001b[36m│\u001b[0m\n",
+ "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
+ ],
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ You are a witness in \"Doe vs. Wilson\". Provide your testimony about what you saw. Evidence: Screenshots of │\n", + "│ messages, social media posts, therapist’s report Be factual and clear. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m dated March 20, 2023, confirms Doe's emotional distress linked to these interactions. I can confirm the \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m authenticity of these documents. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating │\n", + "│ a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report │\n", + "│ dated March 20, 2023, confirms Doe's emotional distress linked to these interactions. I can confirm the │\n", + "│ authenticity of these documents. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Judge │\n", + "│ Role: Preside over court proceedings │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "Output()" + ], + "application/vnd.jupyter.widget-view+json": { + "version_major": 2, + "version_minor": 0, + "model_id": "801192cdda5e4736bc53dba478e1dcc1" + } + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [], + "text/html": [ + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\n" + ], + "text/html": [ + "
\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[2mResponse generated in 2.3s\u001b[0m\n" + ], + "text/html": [ + "
Response generated in 2.3s\n",
+ "
\n"
+ ]
+ },
+ "metadata": {}
+ },
+ {
+ "output_type": "display_data",
+ "data": {
+ "text/plain": [
+ "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n",
+ "\u001b[36m│\u001b[0m You are Judge presiding over \"Doe vs. Wilson\". Deliver your final verdict. Consider all evidence: Screenshots \u001b[36m│\u001b[0m\n",
+ "\u001b[36m│\u001b[0m of messages, social media posts, therapist’s report Be fair and explain your reasoning. \u001b[36m│\u001b[0m\n",
+ "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n"
+ ],
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ You are Judge presiding over \"Doe vs. Wilson\". Deliver your final verdict. Consider all evidence: Screenshots │\n", + "│ of messages, social media posts, therapist’s report Be fair and explain your reasoning. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m After careful consideration of the evidence presented, including the screenshots of messages, social media \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m emotional distress due to the defendant's actions. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Therefore, I rule in favor of the plaintiff. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages for the emotional distress \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m caused. Court is adjourned. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ], + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ After careful consideration of the evidence presented, including the screenshots of messages, social media │\n", + "│ posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of │\n", + "│ emotional distress due to the defendant's actions. │\n", + "│ │\n", + "│ The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being. │\n", + "│ Therefore, I rule in favor of the plaintiff. │\n", + "│ │\n", + "│ Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages for the emotional distress │\n", + "│ caused. Court is adjourned. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ] + }, + "metadata": {} + }, + { + "output_type": "display_data", + "data": { + "text/plain": [ + "
╭────────────────────────────────────────────── Generating... 3.8s ───────────────────────────────────────────────╮\n│ Court is now in session. │\n│ │\n│ Case number 2023-001: Doe vs. Wilson. The plaintiff, Ms. Doe, alleges emotional distress resulting from │\n│ repeated online harassment by the defendant, Mr. Wilson. │\n│ │\n│ Both parties will present their evidence and arguments. I remind all present to maintain decorum. │\n│ │\n│ Let us proceed with the plaintiff's │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n" + }, + "metadata": {} + } + ] + } + }, + "45ff535d008a4b30b53a0e72edee016b": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "9e740fc3b45c454e96dfe29b4c0edb53": { + "model_module": "@jupyter-widgets/output", + "model_name": "OutputModel", + "model_module_version": "1.0.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/output", + "_model_module_version": "1.0.0", + "_model_name": "OutputModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/output", + "_view_module_version": "1.0.0", + "_view_name": "OutputView", + "layout": "IPY_MODEL_c04a2ce5fcc544d8ac72aa67776c0fd0", + "msg_id": "", + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": "\u001b[32m╭─\u001b[0m\u001b[32m─────────────────────────────────────────────\u001b[0m\u001b[32m Generating... 2.9s \u001b[0m\u001b[32m──────────────────────────────────────────────\u001b[0m\u001b[32m─╮\u001b[0m\n\u001b[32m│\u001b[0m Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m you screenshots of messages that reveal intent and motive, alongside social media posts that further \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the \u001b[32m│\u001b[0m\n\u001b[32m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", + "text/html": "
╭────────────────────────────────────────────── Generating... 2.9s ───────────────────────────────────────────────╮\n│ Ladies and gentlemen of the jury, today we present clear evidence against the defendant, Wilson. We will show │\n│ you screenshots of messages that reveal intent and motive, alongside social media posts that further │\n│ corroborate this behavior. Additionally, a therapist’s report will demonstrate the psychological impact on the │\n│ victim, Doe. This evidence will establish a pattern of harassment and intimidation. We ask you to consider the │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n" + }, + "metadata": {} + } + ] + } + }, + "c04a2ce5fcc544d8ac72aa67776c0fd0": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "c0c194ce705f4418961c84f0bacb1acf": { + "model_module": "@jupyter-widgets/output", + "model_name": "OutputModel", + "model_module_version": "1.0.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/output", + "_model_module_version": "1.0.0", + "_model_name": "OutputModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/output", + "_view_module_version": "1.0.0", + "_view_name": "OutputView", + "layout": "IPY_MODEL_4ef74a10d03747608c9011027bfa877c", + "msg_id": "", + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": "\u001b[32m╭─\u001b[0m\u001b[32m─────────────────────────────────────────────\u001b[0m\u001b[32m Generating... 3.1s \u001b[0m\u001b[32m──────────────────────────────────────────────\u001b[0m\u001b[32m─╮\u001b[0m\n\u001b[32m│\u001b[0m Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson. \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr. \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m Wilson is presumed innocent until proven guilty, and we \u001b[32m│\u001b[0m\n\u001b[32m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", + "text/html": "
╭────────────────────────────────────────────── Generating... 3.1s ───────────────────────────────────────────────╮\n│ Ladies and gentlemen of the jury, today you will hear the prosecution's case against my client, Mr. Wilson. │\n│ However, I urge you to remember that the burden of proof lies with them. They must prove guilt beyond a │\n│ reasonable doubt. We will show that the evidence is circumstantial, unreliable, and lacks credibility. Mr. │\n│ Wilson is presumed innocent until proven guilty, and we │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n" + }, + "metadata": {} + } + ] + } + }, + "4ef74a10d03747608c9011027bfa877c": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "f4d166f4a67e41679066f05d4f224c31": { + "model_module": "@jupyter-widgets/output", + "model_name": "OutputModel", + "model_module_version": "1.0.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/output", + "_model_module_version": "1.0.0", + "_model_name": "OutputModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/output", + "_view_module_version": "1.0.0", + "_view_name": "OutputView", + "layout": "IPY_MODEL_f47eec09409e440091431311f3048518", + "msg_id": "", + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": "\u001b[32m╭─\u001b[0m\u001b[32m─────────────────────────────────────────────\u001b[0m\u001b[32m Generating... 2.1s \u001b[0m\u001b[32m──────────────────────────────────────────────\u001b[0m\u001b[32m─╮\u001b[0m\n\u001b[32m│\u001b[0m On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m dated March 20, 2023, confirms Doe's emotional distress linked to these \u001b[32m│\u001b[0m\n\u001b[32m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", + "text/html": "
╭────────────────────────────────────────────── Generating... 2.1s ───────────────────────────────────────────────╮\n│ On March 15, 2023, I observed a series of messages exchanged between Doe and Wilson on social media, indicating │\n│ a heated argument. The screenshots show Wilson making threatening remarks. Additionally, the therapist's report │\n│ dated March 20, 2023, confirms Doe's emotional distress linked to these │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n" + }, + "metadata": {} + } + ] + } + }, + "f47eec09409e440091431311f3048518": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + }, + "801192cdda5e4736bc53dba478e1dcc1": { + "model_module": "@jupyter-widgets/output", + "model_name": "OutputModel", + "model_module_version": "1.0.0", + "state": { + "_dom_classes": [], + "_model_module": "@jupyter-widgets/output", + "_model_module_version": "1.0.0", + "_model_name": "OutputModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/output", + "_view_module_version": "1.0.0", + "_view_name": "OutputView", + "layout": "IPY_MODEL_1928c67194d4409a9528a796bbe1fce1", + "msg_id": "", + "outputs": [ + { + "output_type": "display_data", + "data": { + "text/plain": "\u001b[32m╭─\u001b[0m\u001b[32m─────────────────────────────────────────────\u001b[0m\u001b[32m Generating... 2.1s \u001b[0m\u001b[32m──────────────────────────────────────────────\u001b[0m\u001b[32m─╮\u001b[0m\n\u001b[32m│\u001b[0m After careful consideration of the evidence presented, including the screenshots of messages, social media \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m emotional distress due to the defendant's actions. \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being. \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m Therefore, I rule in favor of the plaintiff. \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m \u001b[32m│\u001b[0m\n\u001b[32m│\u001b[0m Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages \u001b[32m│\u001b[0m\n\u001b[32m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n", + "text/html": "
╭────────────────────────────────────────────── Generating... 2.1s ───────────────────────────────────────────────╮\n│ After careful consideration of the evidence presented, including the screenshots of messages, social media │\n│ posts, and the therapist's report, I find that the plaintiff, Ms. Doe, has demonstrated a credible case of │\n│ emotional distress due to the defendant's actions. │\n│ │\n│ The evidence shows a pattern of harassment that has significantly impacted Ms. Doe's mental well-being. │\n│ Therefore, I rule in favor of the plaintiff. │\n│ │\n│ Mr. Wilson is ordered to cease all forms of contact with Ms. Doe and to pay damages │\n╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n\n" + }, + "metadata": {} + } + ] + } + }, + "1928c67194d4409a9528a796bbe1fce1": { + "model_module": "@jupyter-widgets/base", + "model_name": "LayoutModel", + "model_module_version": "1.2.0", + "state": { + "_model_module": "@jupyter-widgets/base", + "_model_module_version": "1.2.0", + "_model_name": "LayoutModel", + "_view_count": null, + "_view_module": "@jupyter-widgets/base", + "_view_module_version": "1.2.0", + "_view_name": "LayoutView", + "align_content": null, + "align_items": null, + "align_self": null, + "border": null, + "bottom": null, + "display": null, + "flex": null, + "flex_flow": null, + "grid_area": null, + "grid_auto_columns": null, + "grid_auto_flow": null, + "grid_auto_rows": null, + "grid_column": null, + "grid_gap": null, + "grid_row": null, + "grid_template_areas": null, + "grid_template_columns": null, + "grid_template_rows": null, + "height": null, + "justify_content": null, + "justify_items": null, + "left": null, + "margin": null, + "max_height": null, + "max_width": null, + "min_height": null, + "min_width": null, + "object_fit": null, + "object_position": null, + "order": null, + "overflow": null, + "overflow_x": null, + "overflow_y": null, + "padding": null, + "right": null, + "top": null, + "visibility": null, + "width": null + } + } + } + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} \ No newline at end of file diff --git a/examples/cookbooks/Praison_AI_Real_Estate_Chatbot.ipynb b/examples/cookbooks/Praison_AI_Real_Estate_Chatbot.ipynb new file mode 100644 index 00000000..ca7c30b0 --- /dev/null +++ b/examples/cookbooks/Praison_AI_Real_Estate_Chatbot.ipynb @@ -0,0 +1,481 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": { + "id": "KoeGA1N7R8G6" + }, + "source": [ + "# Praison AI Real Estate Chatbot" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "cwsqbQF0SAcR" + }, + "source": [ + "Interact with a real estate AI assistant powered by PraisonAI and OpenAI.\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "BH0Y-SB9UjNZ" + }, + "source": [ + "[](https://colab.research.google.com/github/DhivyaBharathy-web/PraisonAI/blob/main/examples/cookbooks/Praison_AI_Real_Estate_Chatbot.ipynb)\n" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "M4lyScgcSIFX" + }, + "source": [ + "## 1. Install Dependencies" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "id": "p0UqhMK9TMLx" + }, + "outputs": [], + "source": [ + "!pip install praisonaiagents openai" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "XjtPizGWSRuh" + }, + "source": [ + "## 2. Set Your OpenAI API Key" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "id": "FTzcJ7JTTPjp" + }, + "outputs": [], + "source": [ + "import os\n", + "\n", + "# Enter your OpenAI API key here\n", + "OPENAI_API_KEY = \"Enter your api key here\" # <-- Replace with your key\n", + "os.environ[\"OPENAI_API_KEY\"] = OPENAI_API_KEY" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "5WIQ76LQSeOT" + }, + "source": [ + "## 3. Create the Praison AI Agent" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "id": "mJYmlRHtTW59" + }, + "outputs": [], + "source": [ + "from praisonaiagents import Agent\n", + "\n", + "praison_agent = Agent(\n", + " name=\"Praison Real Estate Chatbot\",\n", + " role=\"Answer real estate questions and provide helpful advice.\",\n", + " instructions=[\n", + " \"You are a helpful real estate assistant.\",\n", + " \"Answer user questions about buying, selling, or renting property.\",\n", + " \"Provide clear, concise, and friendly advice.\"\n", + " ],\n", + " markdown=True\n", + ")" + ] + }, + { + "cell_type": "markdown", + "metadata": { + "id": "wDOYoxf2SlSD" + }, + "source": [ + "## 4. Chat with the Agent" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "colab": { + "base_uri": "https://localhost:8080/", + "height": 1000, + "referenced_widgets": [ + "caca39e23f66484e941342713956f289", + "a9f33a0ed67440f1aee8c84ee7e71b1d", + "bcc0387223424b45aec4212eae3aff89", + "030f0e16572a40a7b8e100a6228030e3", + "c91fa91cf91c4697ac28756d6bdf2c73", + "08b05be0ee174761974bc10c1d217b53", + "a08f3878570c48f38bfa3a097cb1e4d6", + "58b89df2db0344fe80f29508c55b2939", + "73ced2df95814c068150e9357692f47b", + "9fbf91ecc93f4230beac5dfc0bf734f6" + ] + }, + "id": "zIyEMJJ6TZlb", + "outputId": "817d4df6-ec88-425e-f00b-8ce6b4923e00" + }, + "outputs": [ + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "caca39e23f66484e941342713956f289", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Text(value='', description='You:', placeholder='Type your real estate question here...')" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "030f0e16572a40a7b8e100a6228030e3", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Button(description='Ask Praison AI', style=ButtonStyle())" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "a08f3878570c48f38bfa3a097cb1e4d6", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n" + ], + "text/plain": [] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n" + ], + "text/plain": [ + "\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Response generated in 1.7s\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2mResponse generated in 1.7s\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ Hello! How can I assist you with your real estate needs today? Whether you have questions about buying, │\n", + "│ selling, or renting property, I'm here to help. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m Hello! How can I assist you with your real estate needs today? Whether you have questions about buying, \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m selling, or renting property, I'm here to help. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "**Praison AI:** Hello! How can I assist you with your real estate needs today? Whether you have questions about buying, selling, or renting property, I'm here to help." + ], + "text/plain": [ + "
╭─ Agent Info ────────────────────────────────────────────────────────────────────────────────────────────────────╮\n", + "│ │\n", + "│ 👤 Agent: Praison Real Estate Chatbot │\n", + "│ Role: Answer real estate questions and provide helpful advice. │\n", + "│ │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "\u001b[38;2;210;227;200m╭─\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[1;38;2;210;227;200mAgent Info\u001b[0m\u001b[38;2;210;227;200m \u001b[0m\u001b[38;2;210;227;200m───────────────────────────────────────────────────────────────────────────────────────────────────\u001b[0m\u001b[38;2;210;227;200m─╮\u001b[0m\n", + "\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n", + "\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;255;155;155m👤 Agent:\u001b[0m \u001b[38;2;255;229;229mPraison Real Estate Chatbot\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n", + "\u001b[38;2;210;227;200m│\u001b[0m \u001b[1;38;2;180;180;179mRole:\u001b[0m \u001b[38;2;255;229;229mAnswer real estate questions and provide helpful advice.\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n", + "\u001b[38;2;210;227;200m│\u001b[0m \u001b[38;2;210;227;200m│\u001b[0m\n", + "\u001b[38;2;210;227;200m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "application/vnd.jupyter.widget-view+json": { + "model_id": "73ced2df95814c068150e9357692f47b", + "version_major": 2, + "version_minor": 0 + }, + "text/plain": [ + "Output()" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "\n" + ], + "text/plain": [] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
\n", + "\n" + ], + "text/plain": [ + "\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
Response generated in 6.3s\n",
+ "
\n"
+ ],
+ "text/plain": [
+ "\u001b[2mResponse generated in 6.3s\u001b[0m\n"
+ ]
+ },
+ "metadata": {},
+ "output_type": "display_data"
+ },
+ {
+ "data": {
+ "text/html": [
+ "╭───────────────────────────────────────────────────── Task ──────────────────────────────────────────────────────╮\n", + "│ What should I look for when buying my first home? │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m────────────────────────────────────────────────────\u001b[0m\u001b[36m Task \u001b[0m\u001b[36m─────────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m What should I look for when buying my first home? \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/html": [ + "
╭─────────────────────────────────────────────────── Response ────────────────────────────────────────────────────╮\n", + "│ Buying your first home is an exciting milestone! Here are some key things to consider: │\n", + "│ │\n", + "│ 1 Budget and Financing: Determine how much you can afford by reviewing your finances and getting pre-approved │\n", + "│ for a mortgage. This will help you understand your price range and make your offer more attractive to │\n", + "│ sellers. │\n", + "│ 2 Location: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities │\n", + "│ like shopping and parks. Also, research the area's safety and future development plans. │\n", + "│ 3 Home Type and Size: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider │\n", + "│ the number of bedrooms and bathrooms you need now and in the future. │\n", + "│ 4 Condition of the Property: Look at the age and condition of the home. Be aware of potential repairs or │\n", + "│ renovations needed. A home inspection can help identify any major issues. │\n", + "│ 5 Resale Value: Consider the potential resale value of the home. Factors like location, school districts, and │\n", + "│ neighborhood development can impact future value. │\n", + "│ 6 Lifestyle Needs: Think about your lifestyle and how the home fits into it. Consider things like yard space, │\n", + "│ commute times, and community amenities. │\n", + "│ 7 Homeowners Association (HOA): If applicable, understand the rules, fees, and restrictions of the HOA. This │\n", + "│ can impact your living experience and costs. │\n", + "│ 8 Future Growth: Consider your long-term plans. Will the home accommodate potential family growth or changes │\n", + "│ in your lifestyle? │\n", + "│ │\n", + "│ Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home │\n", + "│ search! If you have more questions, feel free to ask. │\n", + "╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\n", + "\n" + ], + "text/plain": [ + "\u001b[36m╭─\u001b[0m\u001b[36m──────────────────────────────────────────────────\u001b[0m\u001b[36m Response \u001b[0m\u001b[36m───────────────────────────────────────────────────\u001b[0m\u001b[36m─╮\u001b[0m\n", + "\u001b[36m│\u001b[0m Buying your first home is an exciting milestone! Here are some key things to consider: \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 1 \u001b[0m\u001b[1mBudget and Financing\u001b[0m: Determine how much you can afford by reviewing your finances and getting pre-approved \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mfor a mortgage. This will help you understand your price range and make your offer more attractive to \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0msellers. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 2 \u001b[0m\u001b[1mLocation\u001b[0m: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mlike shopping and parks. Also, research the area's safety and future development plans. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 3 \u001b[0m\u001b[1mHome Type and Size\u001b[0m: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mthe number of bedrooms and bathrooms you need now and in the future. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 4 \u001b[0m\u001b[1mCondition of the Property\u001b[0m: Look at the age and condition of the home. Be aware of potential repairs or \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mrenovations needed. A home inspection can help identify any major issues. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 5 \u001b[0m\u001b[1mResale Value\u001b[0m: Consider the potential resale value of the home. Factors like location, school districts, and \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mneighborhood development can impact future value. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 6 \u001b[0m\u001b[1mLifestyle Needs\u001b[0m: Think about your lifestyle and how the home fits into it. Consider things like yard space, \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mcommute times, and community amenities. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 7 \u001b[0m\u001b[1mHomeowners Association (HOA)\u001b[0m: If applicable, understand the rules, fees, and restrictions of the HOA. This \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0mcan impact your living experience and costs. \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m 8 \u001b[0m\u001b[1mFuture Growth\u001b[0m: Consider your long-term plans. Will the home accommodate potential family growth or changes \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[1;33m \u001b[0min your lifestyle? \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home \u001b[36m│\u001b[0m\n", + "\u001b[36m│\u001b[0m search! If you have more questions, feel free to ask. \u001b[36m│\u001b[0m\n", + "\u001b[36m╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯\u001b[0m\n" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "**Praison AI:** Buying your first home is an exciting milestone! Here are some key things to consider:\n", + "\n", + "1. **Budget and Financing**: Determine how much you can afford by reviewing your finances and getting pre-approved for a mortgage. This will help you understand your price range and make your offer more attractive to sellers.\n", + "\n", + "2. **Location**: Consider the neighborhood and its proximity to work, schools, public transportation, and amenities like shopping and parks. Also, research the area's safety and future development plans.\n", + "\n", + "3. **Home Type and Size**: Decide what type of home suits your needs—single-family, townhouse, condo, etc. Consider the number of bedrooms and bathrooms you need now and in the future.\n", + "\n", + "4. **Condition of the Property**: Look at the age and condition of the home. Be aware of potential repairs or renovations needed. A home inspection can help identify any major issues.\n", + "\n", + "5. **Resale Value**: Consider the potential resale value of the home. Factors like location, school districts, and neighborhood development can impact future value.\n", + "\n", + "6. **Lifestyle Needs**: Think about your lifestyle and how the home fits into it. Consider things like yard space, commute times, and community amenities.\n", + "\n", + "7. **Homeowners Association (HOA)**: If applicable, understand the rules, fees, and restrictions of the HOA. This can impact your living experience and costs.\n", + "\n", + "8. **Future Growth**: Consider your long-term plans. Will the home accommodate potential family growth or changes in your lifestyle?\n", + "\n", + "Taking the time to consider these factors will help you make a well-informed decision. Good luck with your home search! If you have more questions, feel free to ask." + ], + "text/plain": [ + "