From ae51c4f766cbfb6fdc1d45370b1d055e6f8f84b3 Mon Sep 17 00:00:00 2001 From: Patrick Marlow Date: Sat, 6 Apr 2024 13:17:41 -0500 Subject: [PATCH] feat: Add 1-click buttons to colabs --- .../bot_building_101.ipynb | 22 ++++++++++++-- .../bot_building_series/bot_building_101.py | 2 +- ...ilding_102_intents_with_annotated_tp.ipynb | 22 ++++++++++++-- .../copy_paste_series/copy_paste_pages.ipynb | 21 +++++++++++++- .../google_sheets_series/cx_to_sheets.ipynb | 22 +++++++++++++- .../cx_to_sheets_by_flow.ipynb | 23 +++++++++++++-- .../google_sheets_series/sheets_to_cx.ipynb | 22 ++++++++++++-- examples/misc/agent_backups.ipynb | 22 ++++++++++++-- .../intent_levenshtein_demo.ipynb | 22 ++++++++++++-- .../nlu_evaluation_testing.ipynb | 22 ++++++++++++-- .../nlu_semantic_similarity_demo.ipynb | 26 ++++++++++++++--- examples/scrapi_prebuilt.ipynb | 29 +++++++++++++++---- examples/template.ipynb | 23 +++++++++++++-- .../datastores_and_search.ipynb | 22 ++++++++++++-- ...valuation_tool__numeric_score__colab.ipynb | 19 ++++++++++++ 15 files changed, 289 insertions(+), 30 deletions(-) diff --git a/examples/bot_building_series/bot_building_101.ipynb b/examples/bot_building_series/bot_building_101.ipynb index aee83c78..1df7ddec 100644 --- a/examples/bot_building_series/bot_building_101.ipynb +++ b/examples/bot_building_series/bot_building_101.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -29,7 +29,25 @@ "In this notebook, we will show you how to build a Dialogflow CX Agent from scratch using plain text inputs and a simple CSV file.\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/bot_building_series/bot_building_101.py b/examples/bot_building_series/bot_building_101.py index 1be38b5a..24673c95 100644 --- a/examples/bot_building_series/bot_building_101.py +++ b/examples/bot_building_series/bot_building_101.py @@ -1,5 +1,5 @@ """A sample script for building a DFCX bot from scratch using simple inputs.""" -# Copyright 2023 Google LLC +# Copyright 2024 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/examples/bot_building_series/bot_building_102_intents_with_annotated_tp.ipynb b/examples/bot_building_series/bot_building_102_intents_with_annotated_tp.ipynb index 701f9013..5de6e60c 100644 --- a/examples/bot_building_series/bot_building_102_intents_with_annotated_tp.ipynb +++ b/examples/bot_building_series/bot_building_102_intents_with_annotated_tp.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -31,7 +31,25 @@ "In this example some of the training phrases will be anotated with the @sys.number entity\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/copy_paste_series/copy_paste_pages.ipynb b/examples/copy_paste_series/copy_paste_pages.ipynb index d80bdbbb..645c0628 100644 --- a/examples/copy_paste_series/copy_paste_pages.ipynb +++ b/examples/copy_paste_series/copy_paste_pages.ipynb @@ -31,7 +31,26 @@ "These same methods/functions can be further modified to move pages _BETWEEN_ Agents as well!\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/google_sheets_series/cx_to_sheets.ipynb b/examples/google_sheets_series/cx_to_sheets.ipynb index c53aebfe..89f413bd 100644 --- a/examples/google_sheets_series/cx_to_sheets.ipynb +++ b/examples/google_sheets_series/cx_to_sheets.ipynb @@ -31,7 +31,27 @@ "Specifically, we will show how to extract Intents and Training Phrases from Dialogflow CX to Google Sheets.\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it" + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it\n", + "\n", + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/google_sheets_series/cx_to_sheets_by_flow.ipynb b/examples/google_sheets_series/cx_to_sheets_by_flow.ipynb index d2b5dbc4..0f4dcbb3 100644 --- a/examples/google_sheets_series/cx_to_sheets_by_flow.ipynb +++ b/examples/google_sheets_series/cx_to_sheets_by_flow.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -31,7 +31,26 @@ "Specifically, we will show how to `update` **_Existing Intents_** and Training Phrases in Dialogflow CX using Google Sheets as a Source\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it" + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it\n", + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/google_sheets_series/sheets_to_cx.ipynb b/examples/google_sheets_series/sheets_to_cx.ipynb index 0a9285b0..1ab5e35d 100644 --- a/examples/google_sheets_series/sheets_to_cx.ipynb +++ b/examples/google_sheets_series/sheets_to_cx.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -31,7 +31,25 @@ "Specifically, we will show how to `update` **_Existing Intents_** and Training Phrases in Dialogflow CX using Google Sheets as a Source\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it" + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/misc/agent_backups.ipynb b/examples/misc/agent_backups.ipynb index 8abaad59..21672c8a 100644 --- a/examples/misc/agent_backups.ipynb +++ b/examples/misc/agent_backups.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -29,7 +29,25 @@ "In this notebook, we will show you how to extract all of the Agent files for a given GCP project and save them in a specified Google Cloud Storage (GCS) bucket.\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/nlu_analysis_series/intent_levenshtein_demo.ipynb b/examples/nlu_analysis_series/intent_levenshtein_demo.ipynb index 4a8a187c..09263c2f 100644 --- a/examples/nlu_analysis_series/intent_levenshtein_demo.ipynb +++ b/examples/nlu_analysis_series/intent_levenshtein_demo.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -29,7 +29,25 @@ "In this notebook, we will show you how to evaluate the levenshtein ratio between the training phrases of two intents.\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/nlu_analysis_series/nlu_evaluation_testing.ipynb b/examples/nlu_analysis_series/nlu_evaluation_testing.ipynb index c9660c9a..34c50869 100644 --- a/examples/nlu_analysis_series/nlu_evaluation_testing.ipynb +++ b/examples/nlu_analysis_series/nlu_evaluation_testing.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -29,7 +29,25 @@ "In this notebook, we will show you how to perform bulk NLU testing by providing a large input corpus and receiving the predicted Intent and Parameter extraction results from your agent.\n", "\n", "## Prerequisites\n", - "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it." + "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb b/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb index cc4ed4d5..93b668ce 100644 --- a/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb +++ b/examples/nlu_analysis_series/nlu_semantic_similarity_demo.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -36,7 +36,25 @@ "- Ensure you have a GCP Service Account key with the Dialogflow API Admin privileges assigned to it.\n", "\n", "## NOTE!\n", - "_This colab notebook was intended to run on [Google Colab](https://colab.sandbox.google.com/) infrastrucutre due to the `scann` library dependency._" + "_This colab notebook was intended to run on [Google Colab](https://colab.sandbox.google.com/) infrastrucutre due to the `scann` library dependency._\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { @@ -237,8 +255,8 @@ "utterance_column_name = \"no_match_utterances\"\n", "\n", "sheet_loader = SheetsLoader(creds_path)\n", - "utterances = sheet_loader.load_column_from_sheet(sheet_name, \n", - " worksheet_name, \n", + "utterances = sheet_loader.load_column_from_sheet(sheet_name,\n", + " worksheet_name,\n", " utterance_column_name).astype(str)\n", "embedder.find_new_groups(utterances)" ] diff --git a/examples/scrapi_prebuilt.ipynb b/examples/scrapi_prebuilt.ipynb index 08131802..7a803d21 100644 --- a/examples/scrapi_prebuilt.ipynb +++ b/examples/scrapi_prebuilt.ipynb @@ -6,7 +6,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", @@ -34,7 +34,26 @@ "## Prerequisites\n", "- Ensure you have a GCP Service Account key with the following privileges assigned to it, based on your needs:\n", " - Dialogflow API Reader, use this permission level if you are just exploring the Dialogflow CX resources and developing offline\n", - " - Dialogflow API Admin, use this permissions level if you are planning to Read/Write to your Dialogflow CX Agent and/or resources" + " - Dialogflow API Admin, use this permissions level if you are planning to Read/Write to your Dialogflow CX Agent and/or resources\n", + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { @@ -205,7 +224,7 @@ "for flow_name, flow_id in flows_map_reverse.items():\n", " all_pages_per_flow[flow_name] = pages_instance.list_pages(flow_id=flow_id)\n", " time.sleep(1)\n", - " \n", + "\n", " pages_map_per_flow[flow_name] = pages_instance.get_pages_map(\n", " flow_id=flow_id\n", " )\n", @@ -290,7 +309,7 @@ " )\n", " all_route_groups_per_flow[flow_name] = route_groups_list\n", " time.sleep(1)\n", - " \n", + "\n", " route_groups_map = route_groups_instance.get_route_groups_map(\n", " flow_id=flow_id\n", " )\n", @@ -318,7 +337,7 @@ "metadata": {}, "outputs": [], "source": [ - "# < - - Amazing Code Goes Here! -- > " + "# < - - Amazing Code Goes Here! -- >" ] }, { diff --git a/examples/template.ipynb b/examples/template.ipynb index f9cacade..04d16106 100644 --- a/examples/template.ipynb +++ b/examples/template.ipynb @@ -24,7 +24,26 @@ " - Instead, describe what your Section is about to do like `Extract Intents and Training Phrases`\n", "\n", "In each section below we've included sample instructions and minimal code as a pointer for the template. \n", - "If you need further motivation, see [this sample notebook](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/bot_building_series/bot_building_101.ipynb)" + "If you need further motivation, see [this sample notebook](https://github.com/GoogleCloudPlatform/dfcx-scrapi/blob/main/examples/bot_building_series/bot_building_101.ipynb)\n", + "\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { @@ -33,7 +52,7 @@ "metadata": {}, "outputs": [], "source": [ - "# Copyright 2023 Google LLC\n", + "# Copyright 2024 Google LLC\n", "#\n", "# Licensed under the Apache License, Version 2.0 (the \"License\");\n", "# you may not use this file except in compliance with the License.\n", diff --git a/examples/vertex_ai_conversation/datastores_and_search.ipynb b/examples/vertex_ai_conversation/datastores_and_search.ipynb index 19c7f784..09aef52a 100644 --- a/examples/vertex_ai_conversation/datastores_and_search.ipynb +++ b/examples/vertex_ai_conversation/datastores_and_search.ipynb @@ -25,7 +25,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "# Introduction\n", + "# Vertex AI Search and Conversation - Creating and Querying Datastores\n", "In this notebook, we will show you how to:\n", "1. Build a new Vertex Search DataStore\n", "2. Add Site URIs to your DataStore\n", @@ -35,7 +35,25 @@ "\n", "## Prerequisites\n", "- NOTE - For creating a new Engine, there is a hard requirement to use a Service Account Key.\n", - "- For all other methods, local ADC auth creds will work just fine." + "- For all other methods, local ADC auth creds will work just fine.\n", + "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
" ] }, { diff --git a/examples/vertex_ai_conversation/evaluation_tool__numeric_score__colab.ipynb b/examples/vertex_ai_conversation/evaluation_tool__numeric_score__colab.ipynb index 21eb3d10..9e00aa79 100644 --- a/examples/vertex_ai_conversation/evaluation_tool__numeric_score__colab.ipynb +++ b/examples/vertex_ai_conversation/evaluation_tool__numeric_score__colab.ipynb @@ -10,6 +10,25 @@ "\n", "This tool requieres user's input in several steps. Please run the cells one by one (Shift+Enter) to ensure all the steps are succesfully completed.\n", "\n", + "\n", + " \n", + " \n", + " \n", + "
\n", + " \n", + " \"Google
Run in Colab\n", + "
\n", + "
\n", + " \n", + " \"GitHub
View on GitHub\n", + "
\n", + "
\n", + " \n", + " \"Vertex
Open in Vertex AI Workbench\n", + "
\n", + "
\n", + "


\n", + "\n", "## Instructions:\n", "\n", "1. **Set-up**\n",