@@ -83,7 +83,7 @@ As a fallback, there's a 60-second maximum wait in the run object when the threa
83
83
84
84
::: zone-end
85
85
86
- ::: zone pivot="code-examples"
86
+ ::: zone pivot="upload-files- code-examples"
87
87
88
88
## Quickstart – Upload Local Files with file search
89
89
@@ -106,7 +106,7 @@ from azure.identity import DefaultAzureCredential
106
106
107
107
108
108
# Create an Azure AI Client from a connection string, copied from your AI Studio project.
109
- # At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<HubName >"
109
+ # At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName >"
110
110
# Customer needs to login to Azure subscription via Azure CLI and set the environment variables
111
111
112
112
credential = DefaultAzureCredential()
@@ -126,7 +126,7 @@ using Azure.Core.TestFramework;
126
126
using NUnit .Framework ;
127
127
128
128
// Create an Azure AI Client from a connection string, copied from your AI Studio project.
129
- // At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<HubName >"
129
+ // At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName >"
130
130
// Customer needs to login to Azure subscription via Azure CLI and set the environment variables
131
131
var connectionString = TestEnvironment .AzureAICONNECTIONSTRING ;
132
132
AgentsClient client = new AgentsClient (connectionString , new DefaultAzureCredential ());
@@ -145,7 +145,7 @@ Vector stores are created using message attachments that have a default expirati
145
145
``` python
146
146
# We will upload the local file to Azure and will use it for vector store creation.
147
147
_, asset_uri = project_client.upload_file(" ./data/product_info_1.md" )
148
-
148
+ print ( f " Uploaded file, asset URI: { asset_uri } " )
149
149
# create a vector store with no file and wait for it to be processed
150
150
ds = VectorStoreDataSource(asset_identifier = asset_uri, asset_type = VectorStoreDataSourceAssetType.URI_ASSET )
151
151
vector_store = project_client.agents.create_vector_store_and_poll(data_sources = [ds], name = " sample_vector_store" )
@@ -301,6 +301,37 @@ foreach (ThreadMessage threadMessage in messages)
301
301
302
302
::: zone-end
303
303
304
+ ::: zone pivot="azure-blob-storage-code-examples"
305
+ ## Quickstart – Use existing files in Azure Blob Storage with file search
306
+ In this example, we’ll use Azure AI Agent Service to create an agent that can help answer questions on information from files in Azure Blob Storage.
307
+
308
+ ### Prerequisites
309
+ Complete the [ standard agent setup] ( ../../quickstart.md ) .
310
+
311
+ > [ !NOTE]
312
+ > Azure Blob Storage is only available with the standard agent setup. The basic agent setup does not support this file source.
313
+
314
+ ### Step 1: Create a project client
315
+ # [ Python] ( #tab/python )
316
+
317
+ ``` python
318
+ import os
319
+ from azure.ai.projects import AIProjectClient
320
+ from azure.ai.projects.models import FileSearchTool, VectorStoreDataSource, VectorStoreDataSourceAssetType
321
+ from azure.identity import DefaultAzureCredential
322
+
323
+
324
+ # Create an Azure AI Client from a connection string, copied from your AI Studio project.
325
+ # At the moment, it should be in the format "<HostName>;<AzureSubscriptionId>;<ResourceGroup>;<ProjectName>"
326
+ # Customer needs to login to Azure subscription via Azure CLI and set the environment variables
327
+
328
+ credential = DefaultAzureCredential()
329
+ project_client = AIProjectClient.from_connection_string(
330
+ credential = credential, conn_str = os.environ[" PROJECT_CONNECTION_STRING" ]
331
+ )
332
+ ```
333
+
334
+ ::: zone-end
304
335
::: zone pivot="supported-filetypes"
305
336
306
337
### Supported file types
0 commit comments