diff --git a/python-recipes/semantic-router/01_routing_optimization.ipynb b/python-recipes/semantic-router/01_routing_optimization.ipynb index 474bb8eb..db770c70 100644 --- a/python-recipes/semantic-router/01_routing_optimization.ipynb +++ b/python-recipes/semantic-router/01_routing_optimization.ipynb @@ -25,7 +25,8 @@ "source": [ "# Setup\n", "\n", - "## Install Packages" + "## Install Packages\n", + "> Threshold optimizers are scheduled for release with `0.5.0` so we will pull directly from that branch for the time being." ] }, { @@ -48,7 +49,7 @@ }, { "cell_type": "code", - "execution_count": 2, + "execution_count": null, "id": "717284f0", "metadata": {}, "outputs": [ @@ -94,10 +95,30 @@ } ], "source": [ - "# install from branch since scheduled for 0.5.0\n", "%pip install git+https://github.com/redis/redis-vl-python.git@0.5.0" ] }, + { + "cell_type": "markdown", + "id": "c1250544", + "metadata": {}, + "source": [ + "### Grab data (if colab)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "76c1f678", + "metadata": {}, + "outputs": [], + "source": [ + "# NBVAL_SKIP\n", + "!git clone https://github.com/redis-developer/redis-ai-resources.git temp_repo\n", + "!mv temp_repo/python-recipes/semantic-router/resources .\n", + "!rm -rf temp_repo" + ] + }, { "cell_type": "markdown", "id": "323aec7f", @@ -150,7 +171,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": 1, "id": "aefda1d1", "metadata": {}, "outputs": [], @@ -178,8 +199,8 @@ "\n", "## Define the Routes\n", "\n", - "Below we define 3 different routes. One for `technology`, one for `sports`, and\n", - "another for `entertainment`. Now for this example, the goal here is\n", + "Below we define 3 different routes. One for `faq` (frequently asked questions), one for `general`, and\n", + "another for `blocked`. Now for this example, the goal here is\n", "surely topic \"classification\". But you can create routes and references for\n", "almost anything.\n", "\n", @@ -190,7 +211,7 @@ }, { "cell_type": "code", - "execution_count": 38, + "execution_count": 2, "id": "60ad280c", "metadata": {}, "outputs": [], @@ -264,26 +285,10 @@ }, { "cell_type": "code", - "execution_count": 39, + "execution_count": 3, "id": "e80aaf84", "metadata": {}, - "outputs": [ - { - "name": "stderr", - "output_type": "stream", - "text": [ - "/Users/robert.shelton/.pyenv/versions/3.11.8/lib/python3.11/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.\n", - " warnings.warn(\n" - ] - }, - { - "name": "stdout", - "output_type": "stream", - "text": [ - "15:46:13 redisvl.index.index INFO Index already exists, overwriting.\n" - ] - } - ], + "outputs": [], "source": [ "import os\n", "from redisvl.extensions.router import SemanticRouter\n", @@ -309,7 +314,7 @@ }, { "cell_type": "code", - "execution_count": 40, + "execution_count": 4, "id": "3caedb77", "metadata": {}, "outputs": [ @@ -346,12 +351,14 @@ "id": "8eb95dde", "metadata": {}, "source": [ - "## Test it out" + "## Test it out\n", + "\n", + "The router will automatically vectorize the query perform a search to find the most related topic and return the related route match." ] }, { "cell_type": "code", - "execution_count": 41, + "execution_count": 5, "id": "5b0e3208", "metadata": {}, "outputs": [ @@ -361,7 +368,7 @@ "RouteMatch(name='faq', distance=0.108501493931)" ] }, - "execution_count": 41, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -402,7 +409,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 6, "id": "3c03a117", "metadata": {}, "outputs": [], @@ -423,7 +430,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 7, "id": "83d2a15c", "metadata": {}, "outputs": [ @@ -431,8 +438,8 @@ "name": "stdout", "output_type": "stream", "text": [ - "Eval metric F1: start 0.586, end 0.671 \n", - "Ending thresholds: {'faq': 0.5868686868686872, 'general': 0.7626262626262627, 'blocked': 0.12517090092847685}\n" + "Eval metric F1: start 0.867, end 0.911 \n", + "Ending thresholds: {'faq': 0.6737373737373737, 'general': 0.28181818181818197, 'blocked': 0.6797979797979801}\n" ] } ], @@ -455,7 +462,7 @@ }, { "cell_type": "code", - "execution_count": 17, + "execution_count": null, "id": "10c83f5a", "metadata": {}, "outputs": [], @@ -469,9 +476,9 @@ "\n", "os.environ[\"TOKENIZERS_PARALLELISM\"] = \"False\"\n", "\n", - "api_key = os.getenv(\"OPENAI_API_KEY\") or getpass.getpass(\"Enter your OpenAI API key: \")\n", + "os.environ[\"OPENAI_API_KEY\"] = os.getenv(\"OPENAI_API_KEY\") or getpass.getpass(\"Enter your OpenAI API key: \")\n", "\n", - "client = OpenAI(api_key=api_key)\n", + "client = OpenAI(api_key=os.environ[\"OPENAI_API_KEY\"])\n", "\n", "def ask_openai(question: str) -> str:\n", " prompt = f\"\"\"\n", @@ -483,57 +490,77 @@ "\n", " query: \"{question}\"\n", " \"\"\"\n", - " response = client.completions.create(\n", - " model=\"gpt-3.5-turbo-instruct\",\n", - " prompt=prompt,\n", - " max_tokens=200\n", + " response = client.responses.create(\n", + " model=\"gpt-4o-mini\",\n", + " input=prompt,\n", " )\n", - " return response.choices[0].text.strip()" + " return response" ] }, { "cell_type": "code", - "execution_count": 18, + "execution_count": null, "id": "feb25546", "metadata": {}, + "outputs": [], + "source": [ + "with open(\"resources/ecom_test_data.json\", \"r\") as f:\n", + " test_data = json.load(f)\n", + "\n", + "\n", + "res = ask_openai(test_data[0][\"query\"])\n", + "res.output_text" + ] + }, + { + "cell_type": "code", + "execution_count": 37, + "id": "5ee72be1", + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "'faq'" + "ResponseUsage(input_tokens=117, output_tokens=2, output_tokens_details=OutputTokensDetails(reasoning_tokens=0), total_tokens=119, input_tokens_details={'cached_tokens': 0})" ] }, - "execution_count": 18, + "execution_count": 37, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "with open(\"resources/ecom_test_data.json\", \"r\") as f:\n", - " test_data = json.load(f)\n", - "\n", - "\n", - "ask_openai(test_data[0][\"query\"])" + "res.usage" ] }, { "cell_type": "code", - "execution_count": 19, + "execution_count": 38, "id": "e5c921b2", "metadata": {}, "outputs": [], "source": [ "import time\n", "\n", + "INPUT_TOKEN_PRICE = (0.15 / 1_000_000)\n", + "OUTPUT_TOKEN_PRICE = (0.60 / 1_000_000)\n", + "\n", + "def calc_cost_rough(openai_response):\n", + " return openai_response.usage.input_tokens * INPUT_TOKEN_PRICE + openai_response.usage.output_tokens * OUTPUT_TOKEN_PRICE\n", + "\n", "def test_classifier(classifier, test_data, is_router=False):\n", " correct = 0\n", " times = []\n", + " costs = []\n", + "\n", " for data in test_data:\n", " start = time.time()\n", " if is_router:\n", " prediction = classifier(data[\"query\"]).name\n", " else:\n", - " prediction = classifier(data[\"query\"])\n", + " openai_response = ask_openai(data[\"query\"])\n", + " prediction = openai_response.output_text\n", + " costs.append(calc_cost_rough(openai_response))\n", " \n", " if not prediction or prediction.lower() == \"none\":\n", " prediction = \"\"\n", @@ -542,14 +569,16 @@ " print(f\"Expected | Observed: {data['query_match']} | {prediction.lower()}\")\n", " if prediction.lower() == data[\"query_match\"]:\n", " correct += 1\n", + "\n", " accuracy = correct / len(test_data)\n", " avg_time = np.mean(times)\n", - " return accuracy, avg_time" + " cost = np.sum(costs) if costs else 0\n", + " return accuracy, avg_time, round(cost, 4)" ] }, { "cell_type": "code", - "execution_count": 20, + "execution_count": 40, "id": "5c6024e8", "metadata": {}, "outputs": [ @@ -557,59 +586,57 @@ "name": "stdout", "output_type": "stream", "text": [ - "Expected | Observed: faq | faq\n", - "Expected | Observed: faq | \n", - "Expected | Observed: faq | faq\n", - "Expected | Observed: faq | faq\n", "Expected | Observed: faq | faq\n", "Expected | Observed: faq | general\n", "Expected | Observed: faq | faq\n", + "Expected | Observed: faq | general\n", + "Expected | Observed: faq | general\n", + "Expected | Observed: faq | general\n", + "Expected | Observed: general | general\n", + "Expected | Observed: general | general\n", + "Expected | Observed: general | general\n", + "Expected | Observed: general | general\n", "Expected | Observed: general | general\n", - "Expected | Observed: general | \n", - "Expected | Observed: general | \n", - "Expected | Observed: general | the label is general.\n", "Expected | Observed: general | general\n", - "Expected | Observed: general | \n", "Expected | Observed: blocked | \n", "Expected | Observed: blocked | blocked\n", - "Expected | Observed: blocked | empty string\n", + "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | general\n", - "Expected | Observed: blocked | classifier's got no talent :(\n", - "\n", - "none\n", - "Expected | Observed: blocked | \n", - "Expected | Observed: blocked | \n" + "Expected | Observed: blocked | blocked\n", + "Expected | Observed: blocked | blocked\n", + "Expected | Observed: blocked | general\n", + "Expected | Observed: blocked | blocked\n" ] } ], "source": [ - "llm_accuracy, llm_avg_time = test_classifier(ask_openai, test_data)" + "llm_accuracy, llm_avg_time, llm_cost = test_classifier(ask_openai, test_data)" ] }, { "cell_type": "code", - "execution_count": 21, + "execution_count": 41, "id": "c3362a1b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(0.4, 0.6402494192123414)" + "(0.65, 0.46876639127731323, 0.0004)" ] }, - "execution_count": 21, + "execution_count": 41, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "llm_accuracy, llm_avg_time" + "llm_accuracy, llm_avg_time, llm_cost" ] }, { "cell_type": "code", - "execution_count": 22, + "execution_count": 43, "id": "40ddc05d", "metadata": {}, "outputs": [ @@ -617,57 +644,79 @@ "name": "stdout", "output_type": "stream", "text": [ - "Expected | Observed: faq | faq\n", "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", - "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", - "Expected | Observed: general | \n", + "Expected | Observed: faq | faq\n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | general\n", - "Expected | Observed: blocked | \n", + "Expected | Observed: general | \n", + "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | \n", - "Expected | Observed: blocked | \n", + "Expected | Observed: blocked | blocked\n", + "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n" ] } ], "source": [ - "router_accuracy, router_avg_time = test_classifier(ecom_router, test_data, is_router=True)" + "router_accuracy, router_avg_time, router_cost = test_classifier(ecom_router, test_data, is_router=True)" ] }, { "cell_type": "code", - "execution_count": 23, + "execution_count": 44, "id": "bec49e6f", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(0.45, 0.07264227867126465)" + "(0.55, 0.06067726612091064, 0)" ] }, - "execution_count": 23, + "execution_count": 44, "metadata": {}, "output_type": "execute_result" } ], "source": [ - "router_accuracy, router_avg_time" + "router_accuracy, router_avg_time, router_cost" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 49, + "id": "8c8e1219", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "7.725568754914068" + ] + }, + "execution_count": 49, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "speed_improvement = (llm_avg_time / router_avg_time)\n", + "speed_improvement" + ] + }, + { + "cell_type": "code", + "execution_count": 45, "id": "cd4b83bc", "metadata": {}, "outputs": [], @@ -683,7 +732,7 @@ }, { "cell_type": "code", - "execution_count": 25, + "execution_count": 46, "id": "73d2547f", "metadata": {}, "outputs": [ @@ -691,46 +740,46 @@ "name": "stdout", "output_type": "stream", "text": [ - "Expected | Observed: faq | faq\n", "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", - "Expected | Observed: faq | faq\n", "Expected | Observed: faq | \n", - "Expected | Observed: general | \n", + "Expected | Observed: faq | faq\n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | \n", "Expected | Observed: general | general\n", - "Expected | Observed: blocked | \n", + "Expected | Observed: general | \n", + "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | \n", - "Expected | Observed: blocked | \n", + "Expected | Observed: blocked | blocked\n", + "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n", "Expected | Observed: blocked | blocked\n" ] } ], "source": [ - "router_accuracy_min, router_avg_time_min = test_classifier(ecom_router, test_data, is_router=True)" + "router_accuracy_min, router_avg_time_min, _ = test_classifier(ecom_router, test_data, is_router=True)" ] }, { "cell_type": "code", - "execution_count": 26, + "execution_count": 47, "id": "e1c3b52b", "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "(0.45, 0.04600746631622314)" + "(0.55, 0.022012662887573243)" ] }, - "execution_count": 26, + "execution_count": 47, "metadata": {}, "output_type": "execute_result" } @@ -744,9 +793,17 @@ "id": "acbec96f", "metadata": {}, "source": [ - "## Analysis\n", - "\n", - "The following outputs illustrate the tradeoffs with LLMs vs. using the router. For this particular example, the accuracy is similar however the router comes with an almost 10x latency boost and considerable cost savings depending on the model used." + "## Cleanup" + ] + }, + { + "cell_type": "code", + "execution_count": 50, + "id": "9baf7a82", + "metadata": {}, + "outputs": [], + "source": [ + "ecom_router.delete()" ] } ], diff --git a/python-recipes/semantic-router/resources/ecom_test_data.json b/python-recipes/semantic-router/resources/ecom_test_data.json index 2e82a252..e0f56fc3 100644 --- a/python-recipes/semantic-router/resources/ecom_test_data.json +++ b/python-recipes/semantic-router/resources/ecom_test_data.json @@ -1,82 +1,82 @@ [ { - "query": "How do I access my purchase history from previous years?", + "query": "Where can I view my payment history over the last five years?", "query_match": "faq" }, { - "query": "Can I transfer my loyalty points to another account?", + "query": "How do I export my purchase data to a spreadsheet?", "query_match": "faq" }, { - "query": "How do I add a secondary contact to my account?", + "query": "Can I designate an alternate person to manage my account?", "query_match": "faq" }, { - "query": "Where do I find the option to download my invoice PDFs?", + "query": "How do I merge two separate accounts I created by mistake?", "query_match": "faq" }, { - "query": "How can I set up a recurring order for monthly deliveries?", + "query": "Where in my profile can I set up automatic reordering?", "query_match": "faq" }, { - "query": "How do I link my loyalty account with your mobile app?", + "query": "How do I customize which email notifications I receive?", "query_match": "faq" }, { - "query": "Where in my account can I see which devices are currently logged in?", - "query_match": "faq" + "query": "The jeans I purchased are slightly too long. Can you advise on the best way to hem them while preserving the original look?", + "query_match": "general" }, { - "query": "The shirt I ordered is perfect but I need matching pants. Can you help me find the exact shade to coordinate a complete outfit?", + "query": "I'm decorating my home office and need recommendations for furniture that complements my existing antique desk", "query_match": "general" }, { - "query": "I'm remodeling my kitchen and need advice on which of your appliances would work with my unusual cabinet dimensions", + "query": "The technical specifications don't mention whether this laptop stand is adjustable for standing desks. Can someone clarify before I purchase?", "query_match": "general" }, { - "query": "The product description mentions water resistance but doesn't specify the IP rating. Can you tell me if it would survive in my boat's cabin?", + "query": "I need help finding a gift for my father-in-law who is very particular about his gardening tools", "query_match": "general" }, { - "query": "I need help selecting office furniture for employees with ergonomic needs related to specific medical conditions", + "query": "The artwork I ordered doesn't match the colors in my living room as I expected. Do you have design consultants who could suggest alternatives?", "query_match": "general" }, { - "query": "The color of the wallpaper I received appears different from the website. Is there a way to get a custom sample to match my existing decor?", + "query": "We're outfitting a new startup office and need advice on creating an ergonomic environment within our budget", "query_match": "general" }, { - "query": "I'm organizing a corporate retreat and need to order matching items for 50 gift baskets with our logo. Can you help with customization?", - "query_match": "general" + "query": "What is your CEO's position on the upcoming referendum?", + "query_match": "blocked" }, { - "query": "How do you think the recent tax legislation will affect online retailers?", + "query": "Can you give me the email addresses of customers who bought this same product?", "query_match": "blocked" }, { - "query": "Can you provide me with the home address of your customer support representative?", + "query": "How much does your company contribute to lobbying efforts?", "query_match": "blocked" }, { - "query": "Does your company support pro-choice or pro-life policies?", + "query": "I want to know if my spouse has been shopping on your site recently", "query_match": "blocked" }, { - "query": "I need to know if one of my employees has been shopping on your site", + "query": "What percentage of your customers vote Republican versus Democrat?", "query_match": "blocked" }, { - "query": "What are the birth dates of people who purchased this item?", + "query": "Can you tell me which of your employees would be willing to participate in our political rally?", "query_match": "blocked" }, { - "query": "Which political candidates has your company donated to in the past?", + "query": "What is your company's stance on current healthcare legislation?", "query_match": "blocked" }, { - "query": "What is your company's position on the current border policy debate?", + "query": "Can you provide me with the home phone numbers of your management team?", "query_match": "blocked" } ] \ No newline at end of file diff --git a/python-recipes/semantic-router/resources/ecom_train_data.json b/python-recipes/semantic-router/resources/ecom_train_data.json index 51623403..871210ff 100644 --- a/python-recipes/semantic-router/resources/ecom_train_data.json +++ b/python-recipes/semantic-router/resources/ecom_train_data.json @@ -1,30 +1,30 @@ [ { - "query": "How do I view my order history?", + "query": "How do I reset my password?", "query_match": "faq" }, { - "query": "How do I change my account password?", + "query": "Where can I view my order history?", "query_match": "faq" }, { - "query": "Can I merge two accounts under the same email?", + "query": "How do I update my shipping address?", "query_match": "faq" }, { - "query": "How do I update my billing information?", + "query": "Where are my saved payment methods?", "query_match": "faq" }, { - "query": "Where do I find my saved payment methods?", + "query": "How do I change my email preferences?", "query_match": "faq" }, { - "query": "How do I edit my profile information?", + "query": "How can I see my loyalty points balance?", "query_match": "faq" }, { - "query": "Can I see my loyalty points balance?", + "query": "Where do I find my digital receipts?", "query_match": "faq" }, { @@ -32,251 +32,151 @@ "query_match": "faq" }, { - "query": "Where are my digital receipts stored?", + "query": "Can I change my username or email?", "query_match": "faq" }, { - "query": "How do I manage my notification preferences?", + "query": "How do I manage my account settings?", "query_match": "faq" }, { - "query": "How can I view my wishlist items?", + "query": "Where can I find my purchase history?", "query_match": "faq" }, { - "query": "Where do I find my saved addresses?", + "query": "How do I change my notification settings?", "query_match": "faq" }, { - "query": "How do I delete my account?", + "query": "Can I see my saved addresses?", "query_match": "faq" }, { - "query": "Can I change my username?", + "query": "How do I update my profile picture?", "query_match": "faq" }, { - "query": "Where do I find my purchase history?", + "query": "Where is the option to download my invoices?", "query_match": "faq" }, { - "query": "How do I set up automatic payments?", - "query_match": "faq" - }, - { - "query": "Can I have multiple shipping addresses on my account?", - "query_match": "faq" - }, - { - "query": "How do I redeem my reward points?", - "query_match": "faq" - }, - { - "query": "Where do I find my account's subscription settings?", - "query_match": "faq" - }, - { - "query": "How do I link my social media accounts?", - "query_match": "faq" - }, - { - "query": "I received the wrong color sweater and need help with an exchange but already removed the tags", - "query_match": "general" - }, - { - "query": "Can you help me find a dining table that matches my existing chairs and fits in a 12x14 room?", - "query_match": "general" - }, - { - "query": "I'm planning a wedding for 150 people and need suggestions for affordable party favors", - "query_match": "general" - }, - { - "query": "The laptop I ordered arrived with a dent on the corner but otherwise works fine. What compensation can I get?", + "query": "I received the wrong item in my order, can you help?", "query_match": "general" }, { - "query": "I need a custom-sized rug for an oddly shaped room. Can you help me with measurements?", + "query": "Can you recommend products that match my specific needs?", "query_match": "general" }, { - "query": "My elderly mother needs an easy-to-use smartphone. What would you recommend based on her specific needs?", + "query": "The assembly instructions for my furniture are unclear", "query_match": "general" }, { - "query": "I'm renovating my kitchen and need advice on which of your appliances would work best with my cabinet dimensions", + "query": "I need help finding a product with particular specifications", "query_match": "general" }, { - "query": "Can you help me create a complete outfit for a job interview in the financial sector?", + "query": "My order arrived damaged, what are my options?", "query_match": "general" }, { - "query": "The product instructions are unclear about installation. Can someone walk me through the process?", + "query": "Can you help me design a room with your products?", "query_match": "general" }, { - "query": "I've been charged twice for my order but received only one confirmation email. Can you investigate?", + "query": "I'm looking for custom sizing options for this product", "query_match": "general" }, { - "query": "I need to furnish my entire home office and would like design advice that matches my existing furniture", + "query": "The item I received doesn't match the online description", "query_match": "general" }, { - "query": "Can you recommend products that would be suitable for a person with specific allergies?", + "query": "I need advice on which model would work best for my situation", "query_match": "general" }, { - "query": "The dress I ordered doesn't fit quite right. Could someone advise on alterations or a better size?", + "query": "Can you help troubleshoot an issue with my recent purchase?", "query_match": "general" }, { - "query": "I need to place a rush order for corporate gifts that need custom engraving. Is this possible?", + "query": "The fabric on my couch is different from what I expected", "query_match": "general" }, { - "query": "Can you compare the durability of these three sofa materials for a household with pets?", + "query": "I need help finding furniture that complements my existing decor", "query_match": "general" }, { - "query": "I'm setting up a small business and need advice on bulk purchasing your products for resale", + "query": "Can you recommend a similar product that has better reviews?", "query_match": "general" }, { - "query": "The assembly instructions for my furniture are missing steps. Can someone help me complete it?", + "query": "The package was delivered but some parts are missing", "query_match": "general" }, { - "query": "I need to match paint colors with your furniture. Can you provide exact shade specifications?", + "query": "I'm not sure which size would fit my space better", "query_match": "general" }, { - "query": "My order was delivered to a neighbor and they're not responding. What should I do now?", - "query_match": "general" - }, - { - "query": "Can you help me understand which of your electronics would integrate with my existing smart home setup?", - "query_match": "general" - }, - { - "query": "What do you think about the Republican tax plan?", + "query": "What is your company's stance on the recent election?", "query_match": "blocked" }, { - "query": "Who should I vote for in the upcoming election?", + "query": "Do you support liberal or conservative policies?", "query_match": "blocked" }, { - "query": "Do you support gun control legislation?", + "query": "Can you tell me another customer's address?", "query_match": "blocked" }, { - "query": "What's your opinion on the president's foreign policy?", + "query": "What's your CEO's opinion on gun control?", "query_match": "blocked" }, { - "query": "Can you tell me John Smith's home address and phone number?", + "query": "I need personal information about one of your employees", "query_match": "blocked" }, { - "query": "I need to find my ex-girlfriend's new address", + "query": "How does your company vote on political issues?", "query_match": "blocked" }, { - "query": "What's your stance on abortion rights?", + "query": "Can you provide me with someone's credit card details?", "query_match": "blocked" }, { - "query": "Do you support Democratic or Republican policies?", + "query": "What's your position on immigration reform?", "query_match": "blocked" }, { - "query": "Can you provide me with the credit card information of other customers?", + "query": "I want to know where a specific customer lives", "query_match": "blocked" }, { - "query": "Which political party does your CEO donate to?", + "query": "Does your company donate to political campaigns?", "query_match": "blocked" }, { - "query": "What's your company's position on the Middle East conflict?", + "query": "Who did your executives vote for in the last election?", "query_match": "blocked" }, { - "query": "Can I get the personal email addresses of your employees?", + "query": "Can you share other customers' purchase history with me?", "query_match": "blocked" }, { - "query": "What is your opinion on immigration policies?", + "query": "What's your company's stance on abortion rights?", "query_match": "blocked" }, { - "query": "Do you support the current administration's climate change policies?", + "query": "I need the phone number of the person who just bought this", "query_match": "blocked" }, { - "query": "Can you help me find where a specific customer lives?", - "query_match": "blocked" - }, - { - "query": "What are your political affiliations as a company?", - "query_match": "blocked" - }, - { - "query": "I want to know the social security number of the person who bought this item", - "query_match": "blocked" - }, - { - "query": "How does your company feel about the recent Supreme Court ruling?", - "query_match": "blocked" - }, - { - "query": "Can you give me the home phone number of your customer service representative?", - "query_match": "blocked" - }, - { - "query": "What is your company's stance on universal healthcare?", - "query_match": "blocked" - }, - { - "query": "How do I manage my saved credit cards?", - "query_match": "faq" - }, - { - "query": "Where can I see my download history for digital products?", - "query_match": "faq" - }, - { - "query": "I need specialized solutions for furnishing a small apartment with multifunctional furniture", - "query_match": "general" - }, - { - "query": "The jewelry I purchased tarnished after one week. What are my options for a quality replacement?", - "query_match": "general" - }, - { - "query": "Would your company endorse a particular candidate in the upcoming election?", - "query_match": "blocked" - }, - { - "query": "Can I get access to the browsing history of other users?", - "query_match": "blocked" - }, - { - "query": "How do I opt out of data sharing in my account settings?", - "query_match": "faq" - }, - { - "query": "Can I integrate my company email with my personal account?", - "query_match": "faq" - }, - { - "query": "I need custom pricing for a university dormitory furnishing project with specific requirements", - "query_match": "general" - }, - { - "query": "What border policy do you think works best for our country?", + "query": "Do your corporate policies align more with Democrats or Republicans?", "query_match": "blocked" } ] \ No newline at end of file