|
166 | 166 | " azure_endpoint = os.getenv(\"AZURE_OPENAI_ENDPOINT\")\n", |
167 | 167 | " )\n", |
168 | 168 | "\n", |
169 | | - "def generate_embeddings(text, model=\"text-embedding-ada-002\"):\n", |
| 169 | + "def generate_embeddings(text, model=\"text-embedding-3-small\"):\n", |
170 | 170 | " return client.embeddings.create(input = [text], model=model).data[0].embedding\n", |
171 | 171 | "\n", |
172 | 172 | "#adding embeddings for job title to get more accurate search results\n", |
173 | | - "df['job_title_vector'] = df['job_title'].apply(lambda x : generate_embeddings (x)) # model should be set to the deployment name you chose when you deployed the text-embedding-ada-002 (Version 2) model" |
| 173 | + "df['job_title_vector'] = df['job_title'].apply(lambda x : generate_embeddings (x)) # model should be set to the deployment name you chose when you deployed the text-embedding-3-small model" |
174 | 174 | ] |
175 | 175 | }, |
176 | 176 | { |
|
392 | 392 | "outputs": [], |
393 | 393 | "source": [ |
394 | 394 | "endpoint = \"https://{}.search.windows.net/\".format(service_name)\n", |
395 | | - "index_client = SearchIndexClient(endpoint, AzureKeyCredential(index_key))" |
| 395 | + "index_client = SearchIndexClient(endpoint, AzureKeyCredential(search_key))" |
396 | 396 | ] |
397 | 397 | }, |
398 | 398 | { |
|
610 | 610 | "outputs": [], |
611 | 611 | "source": [ |
612 | 612 | "from azure.search.documents import SearchClient\n", |
613 | | - "search_client = SearchClient(endpoint, index_name, AzureKeyCredential(index_key))" |
| 613 | + "search_client = SearchClient(endpoint, index_name, AzureKeyCredential(search_key))" |
614 | 614 | ] |
615 | 615 | }, |
616 | 616 | { |
|
741 | 741 | "outputs": [], |
742 | 742 | "source": [ |
743 | 743 | "response = client.chat.completions.create(\n", |
744 | | - " model=\"gpt-4\",\n", |
| 744 | + " model=\"gpt-4o\",\n", |
745 | 745 | " messages=[\n", |
746 | 746 | " {\"role\": \"system\", \"content\": \"You are a helpful assistant who answers only from the given Context and answers the question from the given Query. If you are asked to count then you must count all of the occurances mentioned.\"},\n", |
747 | 747 | " {\"role\": \"user\", \"content\": \"Context: \"+ context + \"\\n\\n Query: \" + query}\n", |
|
0 commit comments