Skip to content

Commit 8b00c7b

Browse files
committed
updating file search code samples
1 parent e862b63 commit 8b00c7b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ project_client = AIProjectClient.from_connection_string(
2626
```
2727
### Step 2: Upload local files to your project Azure Blob Storage container
2828
We will upload the local file to your project Azure Blob Storage container. This is the same storage account you connected to your agent during the agent setup.
29-
The project asset ID is the URI of the uploaded file and we print out this value. If you create more agents in the same project that want to use the uploaded file, you can reuse this asset ID.
30-
That way you don't need to upload the file again.
29+
The project asset ID is the URI of the uploaded file and we print out this value. If you create more agents in the same project that want to use the uploaded file, you can reuse this asset ID. That way you don't need to upload the file again.
3130
```python
3231
# We will upload the local file to your project Azure Blob Storage container and will use it for vector store creation.
3332
_, asset_uri = project_client.upload_file("C:\\Users\\fosteramanda\\Downloads\\hub bicep\\azure-ai-agents\\data\\product_info_1.md")
@@ -38,7 +37,7 @@ ds = VectorStoreDataSource(asset_identifier=asset_uri, asset_type=VectorStoreDat
3837
vector_store = project_client.agents.create_vector_store_and_poll(data_sources=[ds], name="sample_vector_store-3")
3938
print(f"Created vector store, vector store ID: {vector_store.id}")
4039
```
41-
### Step 3: Create agent_1 with access to the file search tool
40+
### Step 3: Create an agent with access to the file search tool
4241

4342
```python
4443
# create a file search tool
@@ -76,16 +75,17 @@ print(f"Messages: {messages}")
7675
```
7776

7877
### Step 4: Create second vector store using the previously uploaded file
78+
Now we will create a second vector store using the previously uploaded file. This is useful if you have multiple agents that need access to the same files.
7979
```python
8080

81-
# create a vector store with no file and wait for it to be processed
81+
# create a vector store with a previously uploaded file and wait for it to be processed
8282
ds_2 = VectorStoreDataSource(asset_identifier=asset_uri, asset_type=VectorStoreDataSourceAssetType.URI_ASSET)
8383
vector_store_2 = project_client.agents.create_vector_store_and_poll(data_sources=[ds_2], name="sample_vector_store_2")
8484
print(f"Created vector store, vector store ID: {vector_store.id}")
8585

8686
```
8787

88-
### Step 5: Create agent_2 with access to the file search tool
88+
### Step 5: Create a second agent with access to the file search tool
8989
```python
9090
file_search_tool_2 = FileSearchTool(vector_store_ids=[vector_store_2.id])
9191
# notices that FileSearchTool as tool and tool_resources must be added or the assistant unable to search the file

0 commit comments

Comments
 (0)