diff --git a/quickstarts/rest/Search_Grounding.ipynb b/quickstarts/rest/Search_Grounding.ipynb index 2b1873db1..3f7826106 100644 --- a/quickstarts/rest/Search_Grounding.ipynb +++ b/quickstarts/rest/Search_Grounding.ipynb @@ -11,7 +11,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "cellView": "form", "id": "zxdx4xJxrTfP" @@ -68,7 +68,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "id": "GgaOvPo_r2SB" }, @@ -94,24 +94,27 @@ "id": "aIn2wj3tsh4Q" }, "source": [ - "Call search grounding. The `dynamic_threshold` is optional and sets the threshold that determines whether the query could be backed by grounding. Setting to 1.0 would require 100% confidence from the model, and setting to 0.0 would invoke search grounding on any input. You can see the score in the `googleSearchDynamicRetrievalScore` response field." + "Call search grounding." ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "id": "jG3msvzFw-YN", - "outputId": "f4b087e5-1eb1-49c5-851c-a6a7217ded95" + "outputId": "54a3a1af-2f0e-4163-bce2-8049908ad233", + "colab": { + "base_uri": "https://localhost:8080/" + } }, "outputs": [ { - "name": "stderr", "output_type": "stream", + "name": "stderr", "text": [ " % Total % Received % Xferd Average Speed Time Time Time Current\n", " Dload Upload Total Spent Left Speed\n", - "\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 439 0 0 100 439 0 2120 --:--:-- --:--:-- --:--:-- 2120\r100 439 0 0 100 439 0 363 0:00:01 0:00:01 --:--:-- 363\r100 439 0 0 100 439 0 198 0:00:02 0:00:02 --:--:-- 198\r100 9619 0 9180 100 439 3529 168 0:00:02 0:00:02 --:--:-- 3698\n" + "\r 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0\r100 252 0 0 100 252 0 184 0:00:01 0:00:01 --:--:-- 184\r100 7793 0 7541 100 252 3904 130 0:00:01 0:00:01 --:--:-- 4033\r100 7793 0 7541 100 252 3904 130 0:00:01 0:00:01 --:--:-- 4033\n" ] } ], @@ -129,12 +132,7 @@ " ],\n", " \"tools\": [\n", " {\n", - " \"google_search_retrieval\": {\n", - " \"dynamic_retrieval_config\": {\n", - " \"mode\": \"MODE_DYNAMIC\",\n", - " \"dynamic_threshold\": 0.5,\n", - " }\n", - " }\n", + " \"google_search\": {}\n", " }\n", " ]\n", " }' > result.json" @@ -160,11 +158,84 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { - "id": "v7wEfiFNrnNF" + "id": "v7wEfiFNrnNF", + "colab": { + "base_uri": "https://localhost:8080/" + }, + "outputId": "f2d94cee-851f-4f24-ca99-148eb17fbb2c" }, - "outputs": [], + "outputs": [ + { + "output_type": "stream", + "name": "stdout", + "text": [ + "Reading package lists...\n", + "Building dependency tree...\n", + "Reading state information...\n", + "The following additional packages will be installed:\n", + " libjq1 libonig5\n", + "The following NEW packages will be installed:\n", + " jq libjq1 libonig5\n", + "0 upgraded, 3 newly installed, 0 to remove and 20 not upgraded.\n", + "Need to get 357 kB of archives.\n", + "After this operation, 1,087 kB of additional disk space will be used.\n", + "Get:1 http://archive.ubuntu.com/ubuntu jammy/main amd64 libonig5 amd64 6.9.7.1-2build1 [172 kB]\n", + "Get:2 http://archive.ubuntu.com/ubuntu jammy/main amd64 libjq1 amd64 1.6-2.1ubuntu3 [133 kB]\n", + "Get:3 http://archive.ubuntu.com/ubuntu jammy/main amd64 jq amd64 1.6-2.1ubuntu3 [52.5 kB]\n", + "Fetched 357 kB in 1s (481 kB/s)\n", + "debconf: unable to initialize frontend: Dialog\n", + "debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 78, <> line 3.)\n", + "debconf: falling back to frontend: Readline\n", + "debconf: unable to initialize frontend: Readline\n", + "debconf: (This frontend requires a controlling tty.)\n", + "debconf: falling back to frontend: Teletype\n", + "dpkg-preconfigure: unable to re-open stdin: \n", + "Selecting previously unselected package libonig5:amd64.\n", + "(Reading database ... 124926 files and directories currently installed.)\n", + "Preparing to unpack .../libonig5_6.9.7.1-2build1_amd64.deb ...\n", + "Unpacking libonig5:amd64 (6.9.7.1-2build1) ...\n", + "Selecting previously unselected package libjq1:amd64.\n", + "Preparing to unpack .../libjq1_1.6-2.1ubuntu3_amd64.deb ...\n", + "Unpacking libjq1:amd64 (1.6-2.1ubuntu3) ...\n", + "Selecting previously unselected package jq.\n", + "Preparing to unpack .../jq_1.6-2.1ubuntu3_amd64.deb ...\n", + "Unpacking jq (1.6-2.1ubuntu3) ...\n", + "Setting up libonig5:amd64 (6.9.7.1-2build1) ...\n", + "Setting up libjq1:amd64 (1.6-2.1ubuntu3) ...\n", + "Setting up jq (1.6-2.1ubuntu3) ...\n", + "Processing triggers for man-db (2.10.2-1) ...\n", + "Processing triggers for libc-bin (2.35-0ubuntu3.8) ...\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc.so.2 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libhwloc.so.15 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtcm_debug.so.1 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_opencl.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbmalloc_proxy.so.2 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_loader.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_5.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtcm.so.1 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libur_adapter_level_zero.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libumf.so.0 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbbbind_2_0.so.3 is not a symbolic link\n", + "\n", + "/sbin/ldconfig.real: /usr/local/lib/libtbb.so.12 is not a symbolic link\n", + "\n" + ] + } + ], "source": [ "!sudo apt install -q jq" ] @@ -180,15 +251,18 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "id": "uCWcvi_nqSkx", - "outputId": "14698c05-4e78-4752-9ec6-a7729963df40" + "outputId": "99e99e94-13d7-49e1-a5a8-5e080a1dba00", + "colab": { + "base_uri": "https://localhost:8080/" + } }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"candidates\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", @@ -196,7 +270,7 @@ " \u001b[0m\u001b[34;1m\"content\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"parts\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"The Google stock price varies depending on the class of shares and the source. As of today, February 6th, 2025, here's a summary of the information I found:\\n\\n* **Alphabet Inc. Class C (GOOG):** Prices reported range from $193.30 (showing a 2.50% increase in the last 24 hours) to $194.54 (intraday high). One source shows a significant decrease of 6.94% from the previous close at $207.71. There is some discrepancy between reported prices.\\n\\n* **Alphabet Inc. Class A (GOOGL):** One source lists the price as $206.38 as of February 4th, 2025. Note that this is not the most current price.\\n\\nIt's important to note that stock prices are constantly changing, and these figures are snapshots from different times and sources. To get the most up-to-the-minute price, you should consult a live stock ticker or your preferred financial information source.\\n\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"Here are the current prices for Google stock, as of February 12, 2025:\\n\\n* **GOOG (Alphabet Inc Class C):** $187.07\\n* **GOOGL (Alphabet Inc Class A):** $185.37\\n\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"role\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"model\"\u001b[0m\u001b[1;39m\n", @@ -204,24 +278,18 @@ " \u001b[0m\u001b[34;1m\"finishReason\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"STOP\"\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"searchEntryPoint\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"renderedContent\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n what is the current google stock price\\n
\\n
\\n\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"renderedContent\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n current Google stock price\\n
\\n
\\n\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunks\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYuL7uWJtwjgAuTWt0Z9-cX_i256U2016-lBn4JJqf8yBiiQI7ud9yezJolzudSPsN2fLyV8z-JhIoPA40yAv5PZ832kQYiuHELQrSKu8Yf5kQRWbn-ES_uIBXIkFoixlfYgCtA=\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"yahoo.com\"\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYu5ej168MCMQA9ozLLBbiua_1cFvdHBLP0_-xYXEAhckxerQdtYkvShFPBqk9NeAA0MUlMztmyAHNwbS2qNe-lQXBX-4xOQ-khyygzaSq3bjN1PUkJyrbvX6Upy5qTaOzbz48vnEs6v3umO9Q==\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYvCJxuNIWBDoRknIAxxifZXpHRRWw2EYq_3wLZYeXplhyBxyEXA8VR2gftuCOHw7l0DYe9vQXwt860nKn9EJJpfOItiUBUhDM64uXio5y-9r025--_HNVv_yGP4YXz3JoXg3iUZLNZUiOjI4g==\"\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"tradingview.com\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYtHKtN7ya-51rEnLje88PF0MtekqqACoAcRfPPzhrnTnQxfKkT4zWRYrpx7vBlgsxfpSOpWXiwbm3CxS_r4FM01zGHjfJamYQHa8grOaHEX0xKgZv1WI637IlMdMr9k_3mqAVefXNZQOWcNBeQDFyya2o69Nifmq18=\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYtewfAk1Th37hwCctYVIoy0TYS730BK8s4DRGZC349rRb7N2GXSh38AeOZ83yPSJRD_Upz9SC-iQeV2BYc6VR0AcFtldLQwyGTEMu80nZqpw-OyFPJCCHNYBVANjiBcGrYt_GiSMpGveP6xAakM_w3kPsqfzd9EEjw=\"\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"angelone.in\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", @@ -229,66 +297,42 @@ " \u001b[0m\u001b[34;1m\"groundingSupports\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m160\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m177\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **Alphabet Inc.\"\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m1\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m2\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.63467747\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.6486053\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.65795654\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m390\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m444\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"71. There is some discrepancy between reported prices.\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m72\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m116\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **GOOG (Alphabet Inc Class C):** $187.07\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;39m0\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.65081346\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.9517465\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m446\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m463\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **Alphabet Inc.\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m117\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m162\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **GOOGL (Alphabet Inc Class A):** $185.37\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m1\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m2\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m1\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.63467747\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.6486053\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.65795654\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.96076244\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"retrievalMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"googleSearchDynamicRetrievalScore\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m0.96872854\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"retrievalMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"webSearchQueries\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;32m\"what is the current google stock price\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"current Google stock price\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"avgLogprobs\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m-0.18573995614151576\u001b[0m\u001b[1;39m\n", + " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"usageMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"promptTokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m8\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"candidatesTokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m239\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"totalTokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m247\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"candidatesTokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m64\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"totalTokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m72\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"promptTokensDetails\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"modality\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"TEXT\"\u001b[0m\u001b[1;39m,\n", @@ -298,11 +342,11 @@ " \u001b[0m\u001b[34;1m\"candidatesTokensDetails\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"modality\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"TEXT\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"tokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m239\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"tokenCount\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m64\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"modelVersion\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"gemini-1.5-flash\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"modelVersion\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"gemini-2.0-flash\"\u001b[0m\u001b[1;39m\n", "\u001b[1;39m}\u001b[0m\n" ] } @@ -322,23 +366,23 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "id": "IdjXdj5IpNNY", - "outputId": "cc54318b-6128-42b1-98da-eab0dec5bf57" + "outputId": "cde71713-d82d-4a75-e6ab-159476990266", + "colab": { + "base_uri": "https://localhost:8080/" + } }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ - "The Google stock price varies depending on the class of shares and the source. As of today, February 6th, 2025, here's a summary of the information I found:\n", - "\n", - "* **Alphabet Inc. Class C (GOOG):** Prices reported range from $193.30 (showing a 2.50% increase in the last 24 hours) to $194.54 (intraday high). One source shows a significant decrease of 6.94% from the previous close at $207.71. There is some discrepancy between reported prices.\n", - "\n", - "* **Alphabet Inc. Class A (GOOGL):** One source lists the price as $206.38 as of February 4th, 2025. Note that this is not the most current price.\n", + "Here are the current prices for Google stock, as of February 12, 2025:\n", "\n", - "It's important to note that stock prices are constantly changing, and these figures are snapshots from different times and sources. To get the most up-to-the-minute price, you should consult a live stock ticker or your preferred financial information source.\n", + "* **GOOG (Alphabet Inc Class C):** $187.07\n", + "* **GOOGL (Alphabet Inc Class A):** $185.37\n", "\n" ] } @@ -358,36 +402,33 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "id": "NIqD3Qp9qqnC", - "outputId": "d098bd4c-8bc8-4a63-dc7a-7c722b15b741" + "outputId": "3b2ab828-3abc-46ff-d032-333ff6bffeca", + "colab": { + "base_uri": "https://localhost:8080/" + } }, "outputs": [ { - "name": "stdout", "output_type": "stream", + "name": "stdout", "text": [ "\u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"searchEntryPoint\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"renderedContent\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n what is the current google stock price\\n
\\n
\\n\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"renderedContent\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"\\n
\\n
\\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n \\n
\\n
\\n
\\n current Google stock price\\n
\\n
\\n\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunks\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYuL7uWJtwjgAuTWt0Z9-cX_i256U2016-lBn4JJqf8yBiiQI7ud9yezJolzudSPsN2fLyV8z-JhIoPA40yAv5PZ832kQYiuHELQrSKu8Yf5kQRWbn-ES_uIBXIkFoixlfYgCtA=\"\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"yahoo.com\"\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYu5ej168MCMQA9ozLLBbiua_1cFvdHBLP0_-xYXEAhckxerQdtYkvShFPBqk9NeAA0MUlMztmyAHNwbS2qNe-lQXBX-4xOQ-khyygzaSq3bjN1PUkJyrbvX6Upy5qTaOzbz48vnEs6v3umO9Q==\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYvCJxuNIWBDoRknIAxxifZXpHRRWw2EYq_3wLZYeXplhyBxyEXA8VR2gftuCOHw7l0DYe9vQXwt860nKn9EJJpfOItiUBUhDM64uXio5y-9r025--_HNVv_yGP4YXz3JoXg3iUZLNZUiOjI4g==\"\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"tradingview.com\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"web\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYtHKtN7ya-51rEnLje88PF0MtekqqACoAcRfPPzhrnTnQxfKkT4zWRYrpx7vBlgsxfpSOpWXiwbm3CxS_r4FM01zGHjfJamYQHa8grOaHEX0xKgZv1WI637IlMdMr9k_3mqAVefXNZQOWcNBeQDFyya2o69Nifmq18=\"\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"uri\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"https://vertexaisearch.cloud.google.com/grounding-api-redirect/AUBnsYtewfAk1Th37hwCctYVIoy0TYS730BK8s4DRGZC349rRb7N2GXSh38AeOZ83yPSJRD_Upz9SC-iQeV2BYc6VR0AcFtldLQwyGTEMu80nZqpw-OyFPJCCHNYBVANjiBcGrYt_GiSMpGveP6xAakM_w3kPsqfzd9EEjw=\"\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"title\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"angelone.in\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", @@ -395,57 +436,34 @@ " \u001b[0m\u001b[34;1m\"groundingSupports\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m160\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m177\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **Alphabet Inc.\"\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m1\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m2\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.63467747\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.6486053\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.65795654\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", - " \u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m390\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m444\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"71. There is some discrepancy between reported prices.\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m72\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m116\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **GOOG (Alphabet Inc Class C):** $187.07\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", " \u001b[0;39m0\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.65081346\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.9517465\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[1;39m{\n", " \u001b[0m\u001b[34;1m\"segment\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m446\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m463\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **Alphabet Inc.\"\u001b[0m\u001b[1;39m\n", + " \u001b[0m\u001b[34;1m\"startIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m117\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"endIndex\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m162\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"text\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;32m\"* **GOOGL (Alphabet Inc Class A):** $185.37\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"groundingChunkIndices\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m1\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m2\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m1\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"confidenceScores\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;39m0.63467747\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.6486053\u001b[0m\u001b[1;39m,\n", - " \u001b[0;39m0.65795654\u001b[0m\u001b[1;39m\n", + " \u001b[0;39m0.96076244\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", " \u001b[1;39m}\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m,\n", - " \u001b[0m\u001b[34;1m\"retrievalMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{\n", - " \u001b[0m\u001b[34;1m\"googleSearchDynamicRetrievalScore\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[0;39m0.96872854\u001b[0m\u001b[1;39m\n", - " \u001b[1;39m}\u001b[0m\u001b[1;39m,\n", + " \u001b[0m\u001b[34;1m\"retrievalMetadata\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m{}\u001b[0m\u001b[1;39m,\n", " \u001b[0m\u001b[34;1m\"webSearchQueries\"\u001b[0m\u001b[1;39m: \u001b[0m\u001b[1;39m[\n", - " \u001b[0;32m\"what is the current google stock price\"\u001b[0m\u001b[1;39m\n", + " \u001b[0;32m\"current Google stock price\"\u001b[0m\u001b[1;39m\n", " \u001b[1;39m]\u001b[0m\u001b[1;39m\n", "\u001b[1;39m}\u001b[0m\n" ] @@ -475,7 +493,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "id": "Mn249uJ1rEdt" }, @@ -486,14 +504,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "id": "tLohvh3DqfSW", - "outputId": "94164978-b2ce-456f-db46-81c6a8852a9a" + "outputId": "6d3a50ec-7052-4ed8-f92b-b1731c640f6f", + "colab": { + "base_uri": "https://localhost:8080/", + "height": 65 + } }, "outputs": [ { + "output_type": "execute_result", "data": { + "text/plain": [ + "" + ], "text/html": [ "