Skip to content

Commit

Permalink
fix / promptflow[azure] dependency, aoai-connection api_version (Azur…
Browse files Browse the repository at this point in the history
  • Loading branch information
nitya authored Apr 29, 2024
1 parent bef980d commit 66116f5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ CONTOSO_SEARCH_KEY=<YOUR_SEARCH_SERVICE_KEY>
COSMOS_ENDPOINT=<YOUR_COSMOS_ENDPOINT>
COSMOS_KEY=<YOUR_COSMOS_KEY>

# This allows us to handle api_version retirement dates gracefully
AZURE_OPENAI_API_VERSION=<YOUR_OPENAI_API_VERSION> # default is "2024-03-01-preview"

# These connection are for running the intent promotflow
SUPPORT_ENDPOINT = ""
SUPPORT_KEY = ""
Expand Down
6 changes: 4 additions & 2 deletions connections/create-connections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
"# Create local Azure OpenAI Connection\n",
"AOAI_KEY= os.environ[\"CONTOSO_AI_SERVICES_KEY\"]\n",
"AOAI_ENDPOINT= os.environ[\"CONTOSO_AI_SERVICES_ENDPOINT\"]\n",
"API_VERSION = os.getenv(\"AZURE_OPENAI_API_VERSION\") or \"2024-03-01-preview\"\n",
"connection = AzureOpenAIConnection(\n",
" name=\"aoai-connection\",\n",
" api_key=AOAI_KEY,\n",
" api_base=AOAI_ENDPOINT,\n",
" api_type=\"azure\",\n",
" api_version=\"2023-07-01-preview\",\n",
" api_version=API_VERSION,\n",
")\n",
"\n",
"print(f\"Creating connection {connection.name}...\")\n",
Expand Down Expand Up @@ -77,11 +78,12 @@
"# Create the local contoso-search connection\n",
"SEARCH_ENDPOINT = os.environ[\"CONTOSO_SEARCH_ENDPOINT\"]\n",
"SEARCH_KEY = os.environ[\"CONTOSO_SEARCH_KEY\"]\n",
"API_VERSION = os.getenv(\"AZURE_OPENAI_API_VERSION\") or \"2024-03-01-preview\"\n",
"connection = CognitiveSearchConnection(\n",
" name=\"contoso-search\",\n",
" api_key=SEARCH_KEY,\n",
" api_base=SEARCH_ENDPOINT,\n",
" api_version=\"2023-07-01-preview\",\n",
" api_version=API_VERSION,\n",
")\n",
"\n",
"print(f\"Creating connection {connection.name}...\")\n",
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
promptflow
promptflow-tools
promptflow[azure]
azure-cosmos
azure-ai-ml
azure-ai-resources
Expand Down

0 comments on commit 66116f5

Please sign in to comment.