Skip to content

Commit

Permalink
Add support and chat endpoint checks and vars (#62)
Browse files Browse the repository at this point in the history
* update deployment sku

* add support and chat endpoint to env and checks in notebook
  • Loading branch information
cassiebreviu authored Feb 6, 2024
1 parent 1096c2d commit 39ab119
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 22 deletions.
9 changes: 8 additions & 1 deletion .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@ CONTOSO_AI_SERVICES_KEY=<YOUR_OPENAI_KEY>
CONTOSO_SEARCH_ENDPOINT=<YOUR_SEARCH_SERVICE_ENDPOINT>
CONTOSO_SEARCH_KEY=<YOUR_SEARCH_SERVICE_KEY>
COSMOS_ENDPOINT=<YOUR_COSMOS_ENDPOINT>
COSMOS_KEY=<YOUR_COSMOS_KEY>
COSMOS_KEY=<YOUR_COSMOS_KEY>

# These connection are for running the intent promotflow
SUPPORT_ENDPOINT = ""
SUPPORT_KEY = ""

CHAT_ENDPOINT = ""
CHAT_KEY = ""
51 changes: 30 additions & 21 deletions connections/create-connections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
")\n",
"from dotenv import load_dotenv\n",
"\n",
"load_dotenv()\n",
"load_dotenv(\"../.env.sample\")\n",
"\n",
"pf = PFClient()"
]
Expand Down Expand Up @@ -98,18 +98,23 @@
"# Create the local contoso-search connection\n",
"SUPPORT_ENDPOINT = os.environ[\"SUPPORT_ENDPOINT\"]\n",
"SUPPORT_KEY = os.environ[\"SUPPORT_KEY\"]\n",
"connection = CustomConnection(\n",
" name=\"support-endpoint\",\n",
" configs={\n",
" \"api_base\": SUPPORT_ENDPOINT,\n",
" },\n",
" secrets={\"api_key\": SUPPORT_KEY},\n",
")\n",
"print(SUPPORT_ENDPOINT)\n",
"\n",
"if(SUPPORT_ENDPOINT == \"\"):\n",
" print(\"Skipping support connection creation, missing environment variables\")\n",
"else:\n",
" connection = CustomConnection(\n",
" name=\"support-endpoint\",\n",
" configs={\n",
" \"api_base\": SUPPORT_ENDPOINT,\n",
" },\n",
" secrets={\"api_key\": SUPPORT_KEY},\n",
" )\n",
"\n",
"print(f\"Creating connection {connection.name}...\")\n",
"result = pf.connections.create_or_update(connection)\n",
"print(result)"
"\n",
" print(f\"Creating connection {connection.name}...\")\n",
" result = pf.connections.create_or_update(connection)\n",
" print(result)"
]
},
{
Expand All @@ -121,18 +126,22 @@
"# Create the local contoso-search connection\n",
"CHAT_ENDPOINT = os.environ[\"CHAT_ENDPOINT\"]\n",
"CHAT_KEY = os.environ[\"CHAT_KEY\"]\n",
"connection = CustomConnection(\n",
" name=\"chat-endpoint\",\n",
" configs={\n",
" \"api_base\": CHAT_ENDPOINT,\n",
" },\n",
" secrets={\"api_key\": CHAT_KEY},\n",
")\n",
"\n",
"if(CHAT_ENDPOINT == \"\"):\n",
" print(\"Skipping chat connection creation, missing environment variables\")\n",
"else:\n",
" connection = CustomConnection(\n",
" name=\"chat-endpoint\",\n",
" configs={\n",
" \"api_base\": CHAT_ENDPOINT,\n",
" },\n",
" secrets={\"api_key\": CHAT_KEY},\n",
" )\n",
"\n",
"print(f\"Creating connection {connection.name}...\")\n",
"result = pf.connections.create_or_update(connection)\n",
"print(result)"
"\n",
" print(f\"Creating connection {connection.name}...\")\n",
" result = pf.connections.create_or_update(connection)\n",
" print(result)"
]
}
],
Expand Down

0 comments on commit 39ab119

Please sign in to comment.