Skip to content

Commit 7096ae1

Browse files
author
Yazeed Alaudah
committed
update azure search notebook
1 parent 062bc3a commit 7096ae1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Basic_Samples/Functions/functions_with_azure_search.ipynb

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@
8080
"client = AzureOpenAI(\n",
8181
" 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",
8282
" api_key=os.getenv(\"AZURE_OPENAI_KEY\"), # The API key for your Azure OpenAI resource.\n",
83-
" api_version=\"2023-12-01-preview\", # This version supports function calling\n",
84-
")"
83+
" api_version=config_details[\"OPENAI_API_VERSION\"], # This version supports function calling\n",
84+
")\n",
85+
"\n",
86+
"model_name = config_details[\"MODEL_NAME\"]"
8587
]
8688
},
8789
{
@@ -293,7 +295,7 @@
293295
"]\n",
294296
"\n",
295297
"response = client.chat.completions.create(\n",
296-
" model=\"gpt-35-turbo\",\n",
298+
" model=model_name,\n",
297299
" messages=messages,\n",
298300
" tools=tools,\n",
299301
" temperature=0.2,\n",
@@ -362,7 +364,7 @@
362364
"\n",
363365
" # Step 1: send the conversation and available functions to GPT\n",
364366
" response = client.chat.completions.create(\n",
365-
" model=\"gpt-35-turbo\",\n",
367+
" model=model_name,\n",
366368
" messages=messages,\n",
367369
" tools=tools,\n",
368370
" tool_choice=\"auto\",\n",
@@ -422,7 +424,7 @@
422424
"\n",
423425
" second_response = client.chat.completions.create(\n",
424426
" messages=messages,\n",
425-
" model=\"gpt-35-turbo\",\n",
427+
" model=model_name,\n",
426428
" ) # get a new response from GPT where it can see the function response\n",
427429
"\n",
428430
" return second_response\n",

0 commit comments

Comments
 (0)