Skip to content

Commit ac79b7d

Browse files
Merge pull request #2382 from fosteramanda/main
Updating azure_ai_search code to reflect sdk changes
2 parents 7b44f45 + e5ef8f5 commit ac79b7d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

articles/ai-services/agents/includes/azure-search/code-examples.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Get the connection ID of the Azure AI Search connection in the project. You can
6969
conn_list = project_client.connections.list()
7070
conn_id = ""
7171
for conn in conn_list:
72-
if conn.connection_type == "CognitiveSearch":
72+
if conn.connection_type == "AZURE_AI_SEARCH":
7373
print(f"Connection ID: {conn.id}")
7474
```
7575
# [C#](#tab/csharp)
@@ -97,8 +97,7 @@ conn_id = "/subscriptions/<your-subscription-id>/resourceGroups/<your-resource-
9797

9898
# Initialize agent AI search tool and add the search index connection ID and index name
9999
# TO DO: replace <your-index-name> with the name of the index you want to use
100-
ai_search = AzureAISearchTool()
101-
ai_search.add_index(conn_id, "<your-index-name>")
100+
ai_search = AzureAISearchTool(index_connection_id=conn_id, index_name="<your-index-name>")
102101
```
103102
# [C#](#tab/csharp)
104103
```csharp

0 commit comments

Comments
 (0)