Skip to content

Commit 1a301e4

Browse files
committed
updating deep dive code
1 parent 4037acd commit 1a301e4

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

articles/ai-services/agents/includes/file-search/deep-dive.md

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@ ms.topic: include
77
ms.date: 12/10/2024
88
---
99
## Creating vector stores and adding files
10-
11-
You can create a vector store and add files to it in a single API call:
12-
13-
```python
14-
vector_store = project_client.agents.create_vector_store_file_batch_and_poll(
15-
name="my_vector_store",
16-
file_ids=['file_path_1', 'file_path_2', 'file_path_3', 'file_path_4', 'file_path_5']
17-
)
18-
```
19-
2010
Adding files to vector stores is an async operation. To ensure the operation is complete, we recommend that you use the 'create and poll' helpers in our official SDKs. If you're not using the SDKs, you can retrieve the `vector_store` object and monitor its `file_counts` property to see the result of the file ingestion operation.
2111

2212
Files can also be added to a vector store after it's created by creating vector store files.
@@ -40,7 +30,7 @@ Alternatively, you can add several files to a vector store by creating batches o
4030
```python
4131
batch = project_client.agents.create_vector_store_file_batch_and_poll(
4232
vector_store_id=vector_store.id,
43-
file_ids=['file_1', 'file_2', 'file_3', 'file_4', 'file_5']
33+
file_ids=[file_1.id, file_2.id, file_3.id, file_4.id, file_5.id]
4434
)
4535
```
4636

@@ -83,7 +73,7 @@ To help you manage the costs associated with these vector_store objects, we adde
8373
```python
8474
vector_store = project_client.agents.create_vector_store_and_poll(
8575
name="Product Documentation",
86-
file_ids=['file_1', 'file_2', 'file_3', 'file_4', 'file_5'],
76+
file_ids=[file_1.id],
8777
expires_after={
8878
"anchor": "last_active_at",
8979
"days": 7

0 commit comments

Comments
 (0)