Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor based on customer experience #263

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 24 additions & 9 deletions tools/SIP_SIPREC_integration_Dialogflow_CURL_commands.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,22 +24,17 @@
"import re\n",
"import sys\n",
"\n",
"google_auth.authenticate_user()\n",
"\n",
"# @title Input parameters\n",
"\n",
"PROJECT_ID = \"my-project-id\" # @param {type:\"string\"}\n",
"PROJECT_ID = \"cx-agent-305020\" # @param {type:\"string\"}\n",
"REGION = \"global\" # @param {type:\"string\"}\n",
"JWT = \"Leave as-is to use SSO or enter generated JWT token here\" # @param {type:\"string\"}\n",
"\n",
"\n",
"# Ensure that the project has Dialogflow APIs enabled\n",
"!gcloud config set project {PROJECT_ID}\n",
"!gcloud services enable dialogflow.googleapis.com\n",
"\n",
"CONTAINS_SPACES_PATTERN = r\"\\s\"\n",
"# If the JWT string has spaces, then use SSO for authentication\n",
"if re.search(CONTAINS_SPACES_PATTERN, JWT):\n",
" google_auth.authenticate_user()\n",
" JWT = !gcloud auth print-access-token\n",
" JWT = JWT[0]\n",
"\n",
Expand All @@ -52,6 +47,23 @@
"metadata": {
"id": "BDe-MhXg2U7C"
},
"execution_count": 1,
"outputs": []
},
{
"cell_type": "code",
"source": [
"# @title ** DO NOT USE IF USING A JWT** Enable the Dialogflow API in your project\n",
"\n",
"google_auth.authenticate_user()\n",
"\n",
"# Ensure that the project has Dialogflow APIs enabled\n",
"!gcloud config set project {PROJECT_ID}\n",
"!gcloud services enable dialogflow.googleapis.com"
],
"metadata": {
"id": "9ohBmJNaiZgr"
},
"execution_count": null,
"outputs": []
},
Expand Down Expand Up @@ -98,6 +110,9 @@
" print(\"No Dialogflow CX agent name provided.\")\n",
" virtual_agent = False\n",
"\n",
"project_allowlisted = True\n",
"\n",
"\n",
"# Create PhoneNumberOrder\n",
"\n",
"print(\"\\nCreating Phone Number Order Object:\\n\")\n",
Expand All @@ -124,9 +139,9 @@
" print(f'\\n>>>> PROJECT \"{PROJECT_ID}\" HAS NOT BEEN ALLOWLISTED. <<<< \\n\\n\\n'\n",
" 'Submit the form https://docs.google.com/forms/d/e/1FAIpQLSe2xMdpg_L2bhvl4EoNTUC4Nctzc3Qlw54uQ1_JNFgr0VhOfg/viewform '\n",
" 'wait to hear back and then re-run this script.\\n\\n')\n",
" project_not_allowlisted = True\n",
" project_allowlisted = False\n",
"\n",
"if not project_not_allowlisted:\n",
"if project_allowlisted:\n",
"\n",
" # Create Security Settings object\n",
"\n",
Expand Down
Loading