Skip to content

Commit

Permalink
update azure search notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
Yazeed Alaudah committed Feb 21, 2024
1 parent 062bc3a commit 7096ae1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions Basic_Samples/Functions/functions_with_azure_search.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@
"client = AzureOpenAI(\n",
" azure_endpoint=config_details[\"AZURE_OPENAI_ENDPOINT\"], # The base URL for your Azure OpenAI resource. e.g. \"https://<your resource name>.openai.azure.com\"\n",
" api_key=os.getenv(\"AZURE_OPENAI_KEY\"), # The API key for your Azure OpenAI resource.\n",
" api_version=\"2023-12-01-preview\", # This version supports function calling\n",
")"
" api_version=config_details[\"OPENAI_API_VERSION\"], # This version supports function calling\n",
")\n",
"\n",
"model_name = config_details[\"MODEL_NAME\"]"
]
},
{
Expand Down Expand Up @@ -293,7 +295,7 @@
"]\n",
"\n",
"response = client.chat.completions.create(\n",
" model=\"gpt-35-turbo\",\n",
" model=model_name,\n",
" messages=messages,\n",
" tools=tools,\n",
" temperature=0.2,\n",
Expand Down Expand Up @@ -362,7 +364,7 @@
"\n",
" # Step 1: send the conversation and available functions to GPT\n",
" response = client.chat.completions.create(\n",
" model=\"gpt-35-turbo\",\n",
" model=model_name,\n",
" messages=messages,\n",
" tools=tools,\n",
" tool_choice=\"auto\",\n",
Expand Down Expand Up @@ -422,7 +424,7 @@
"\n",
" second_response = client.chat.completions.create(\n",
" messages=messages,\n",
" model=\"gpt-35-turbo\",\n",
" model=model_name,\n",
" ) # get a new response from GPT where it can see the function response\n",
"\n",
" return second_response\n",
Expand Down

0 comments on commit 7096ae1

Please sign in to comment.