You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Files can be removed from a vector store by either:
42
42
43
43
* Deleting the vector store file object or,
44
-
* By deleting the underlying file object (which removes the file it from all vector_store and code_interpreter configurations across all agents and threads in your organization)
44
+
* By deleting the underlying file object, which removes the file it from all vector_store and code_interpreter configurations across all agents and threads in your organization
45
45
46
46
The maximum file size is 512 MB. Each file should contain no more than 5,000,000 tokens per file (computed automatically when you attach a file).
47
47
@@ -69,15 +69,15 @@ print("Deleted vector store")
69
69
70
70
## Ensuring vector store readiness before creating runs
71
71
72
-
We highly recommend that you ensure all files in a vector_store are fully processed before you create a run. This ensures that all the data in your vector store is searchable. You can check for vector store readiness by using the polling helpers in the SDKs, or by manually polling the `vector_store` object to ensure the status is completed.
72
+
We highly recommend that you ensure all files in a vector_store are fully processed before you create a run. This approach ensures that all the data in your vector store is searchable. You can check for vector store readiness by using the polling helpers in the SDKs, or by manually polling the `vector_store` object to ensure the status is completed.
73
73
74
-
As a fallback, there's a 60-second maximum wait in the run object when the thread's vector store contains files that are still being processed. This is to ensure that any files your users upload in a thread a fully searchable before the run proceeds. This fallback wait does not apply to the agent's vector store.
74
+
As a fallback, there's a 60-second maximum wait in the run object when the thread's vector store contains files that are still being processed. This step ensures that any files your users upload in a thread are fully searchable before the run proceeds. This fallback wait does not apply to the agent's vector store.
75
75
76
76
## Managing costs with expiration policies
77
77
78
-
For basic agent setup. the `file_search` tool uses the `vector_stores` object as its resource and you will be billed based on the size of the vector_store objects created. The size of the vector store object is the sum of all the parsed chunks from your files and their corresponding embeddings.
78
+
For basic agent setup, the `file_search` tool uses the `vector_stores`object as its resource and you are billed based on the size of the vector_store objects created. The size of the vector store object is the sum of all the parsed chunks from your files and their corresponding embeddings.
79
79
80
-
In order to help you manage the costs associated with these vector_store objects, we have added support for expiration policies in the `vector_store` object. You can set these policies when creating or updating the `vector_store` object.
80
+
To help you manage the costs associated with these vector_store objects, we added support for expiration policies in the `vector_store` object. You can set these policies when creating or updating the `vector_store` object.
Vector stores created using thread helpers (like `tool_resources.file_search.vector_stores` in Threads or `message.attachments` in Messages) have a default expiration policy of seven days after they were last active (defined as the last time the vector store was part of a run).
96
96
97
-
When a vector store expires, the runs on that thread fail. To fix this, you can recreate a new vector_store with the same files and reattach it to the thread.
97
+
When a vector store expires, the runs on that thread fail. To fix this issue, you can recreate a new vector_store with the same files and reattach it to the thread.
Copy file name to clipboardExpand all lines: articles/ai-services/agents/includes/file-search/upload-files-code-examples.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,7 @@ Complete the [agent setup](../../quickstart.md).
7
7
8
8
## Step 1: Create a project client
9
9
10
-
Create a client object, that contains the connection string for connecting to your AI project and other resources.
11
-
10
+
Create a client object that contains the connection string for connecting to your AI project and other resources.
12
11
# [Python](#tab/python)
13
12
14
13
```python
@@ -49,7 +48,7 @@ AgentsClient client = new AgentsClient(connectionString, new DefaultAzureCredent
49
48
50
49
## Step 2: Upload files and add them to a Vector Store
51
50
52
-
To access your files, the file search tool uses the vector store object. Upload your files and create a vector store to contain them. Once the vector store is created, you should poll its status until all files are out of the `in_progress` state to ensure that all content has finished processing. The SDK provides helpers for uploading and polling.
51
+
To access your files, the file search tool uses the vector store object. Upload your files and create a vector store. After creating the vector store, poll its status until all files are out of the `in_progress` state to ensure that all content is fully processing. The SDK provides helpers for uploading and polling.
## Step 3: Create an agent with access to file search
87
+
## Step 3: Create an agent and enable file search
89
88
90
89
To make the files accessible to your agent, create a `FileSearchTool` object with the `vector_store` ID, and attach `tools` and `tool_resources` to the agent.
You can also attach files as Message attachments on your thread. Doing so will create another ```vector_store``` associated with the thread, or, if there is already a vector store attached to this thread, attach the new files to the existing thread vector store. When you create a Run on this thread, the file search tool will query both the ```vector_store``` from your assistant and the ```vector_store``` on the thread.
128
+
You can also attach files as Message attachments on your thread. Doing so creates another ```vector_store``` associated with the thread, or, if there's already a vector store attached to this thread, attaches the new files to the existing thread vector store. When you create a Run on this thread, the file search tool queries both the ```vector_store``` from your agent and the ```vector_store``` on the thread.
0 commit comments