Skip to content

Commit 72066b4

Browse files
committed
updating rest
1 parent 8ea5e7e commit 72066b4

File tree

4 files changed

+54
-35
lines changed

4 files changed

+54
-35
lines changed

articles/ai-services/agents/how-to/tools/azure-ai-search-samples.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -414,24 +414,25 @@ for (let i = messages.data.length - 1; i >= 0; i--) {
414414
:::zone pivot="rest"
415415
416416
## Create an Azure AI Client
417-
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN` and `AZURE_AI_AGENTS_ENDPOINT`.
417+
418+
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN`, `AZURE_AI_FOUNDRY_PROJECT_ENDPOINT` and `API_VERSION`. The client creation is demonstrated in the next section.
418419
419420
## Get the connection ID for the Azure AI Search resource
420-
Follow the next section on how to get the connection ID from the Azure AI Foundry.
421421
422-
The second way to get the connection ID is to navigate to the project in the Azure AI Foundry and click on the **Connected resources** tab and then select your Azure AI Search resource.
422+
To get the connection ID, navigate to the project in the Azure AI Foundry and click on the **Connected resources** tab and then select your Azure AI Search resource.
423423
424424
:::image type="content" source="../../media/tools/ai-search/success-connection.png" alt-text="A screenshot of an AI Search resource connection page in Azure AI Foundry." lightbox="../../media/tools/ai-search/success-connection.png":::
425425
426-
In the URL, you see the wsid=/subscription/your-subscription-id..., this is the connection ID you need to use. Copy everything that comes after wsid=.
426+
In the URL, you see the `wsid=/subscription/your-subscription-id...`, this is the connection ID you need to use. Copy everything that comes after `wsid=`.
427427
428428
:::image type="content" source="../../media/tools/ai-search/connection-id.png" alt-text="A screenshot of an AI Search resource connection and how to copy the connection ID." lightbox="../../media/tools/ai-search/connection-id.png":::
429429
430430
## Configure the Azure AI Search tool
431431
Using the connection ID you got in the previous step, you can now configure the Azure AI Search tool to use your Azure AI Search index.
432432
433-
```console
434-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
433+
```bash
434+
curl --request POST \
435+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=$API_VERSION \
435436
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
436437
-H "Content-Type: application/json" \
437438
-d '{
@@ -461,7 +462,8 @@ Now that the agent is created, ask it questions about the data in your Azure AI
461462
#### Create a thread
462463
463464
```console
464-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
465+
curl --request POST \
466+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=$API_VERSION \
465467
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
466468
-H "Content-Type: application/json" \
467469
-d ''
@@ -470,7 +472,8 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
470472
#### Add a user question to the thread
471473
472474
```console
473-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
475+
curl --request POST \
476+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
474477
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
475478
-H "Content-Type: application/json" \
476479
-d '{
@@ -481,7 +484,8 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-versi
481484
#### Run the thread
482485
483486
```console
484-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2025-05-01 \
487+
curl --request POST \
488+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=$API_VERSION \
485489
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
486490
-H "Content-Type: application/json" \
487491
-d '{
@@ -492,14 +496,16 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2
492496
#### Retrieve the status of the run
493497
494498
```console
495-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=2025-05-01 \
499+
curl --request GET \
500+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=$API_VERSION \
496501
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
497502
```
498503
499504
#### Retrieve the agent response
500505
501506
```console
502-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
507+
curl --request GET \
508+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
503509
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
504510
```
505511

articles/ai-services/agents/how-to/tools/azure-functions-samples.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,11 @@ For any issues with the Python code, create an issue on the [sample code reposit
180180

181181
In the sample below we create a client and an agent that has the tools definition for the Azure Function
182182

183-
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN` and `AZURE_AI_AGENTS_ENDPOINT`. Then create the agent using:
184-
```console
185-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
183+
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN`, `AZURE_AI_FOUNDRY_PROJECT_ENDPOINT` and `API_VERSION`. Then create the agent using:
184+
185+
```bash
186+
curl --request POST \
187+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=$API_VERSION \
186188
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
187189
-H "Content-Type: application/json" \
188190
-d '{
@@ -226,17 +228,19 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
226228
227229
## Create a thread for the agent
228230
229-
```console
230-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
231+
```bash
232+
curl --request POST \
233+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=$API_VERSION \
231234
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
232235
-H "Content-Type: application/json" \
233236
-d ''
234237
```
235238
236239
## Create a run and check the output
237240
238-
```console
239-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
241+
```bash
242+
curl --request POST \
243+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
240244
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
241245
-H "Content-Type: application/json" \
242246
-d '{
@@ -245,8 +249,9 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-versi
245249
}'
246250
```
247251
248-
```console
249-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2025-05-01 \
252+
```bash
253+
curl --request POST \
254+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=$API_VERSION \
250255
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
251256
-H "Content-Type: application/json" \
252257
-d '{
@@ -255,14 +260,16 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2
255260
```
256261
257262
```console
258-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=2025-05-01 \
263+
curl --request GET \
264+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=$API_VERSION \
259265
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
260266
```
261267
262268
## Get the result of the run
263269
264270
```console
265-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
271+
curl --request GET \
272+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
266273
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
267274
```
268275

articles/ai-services/agents/how-to/tools/bing-code-samples.md

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -401,15 +401,16 @@ Create a client object, which will contain the connection string for connecting
401401
>[!IMPORTANT]
402402
> 1. This REST API allows developers to invoke the Grounding with Bing Search tool through the Azure AI Foundry Agent Service. It does not send calls to the Grounding with Bing Search API directly.
403403
404-
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN` and `AZURE_AI_AGENTS_ENDPOINT`. The client creation is demonstrated in the next section.
404+
Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the right values for the environment variables `AZURE_AI_AGENTS_TOKEN`, `AZURE_AI_FOUNDRY_PROJECT_ENDPOINT` and `API_VERSION`. The client creation is demonstrated in the next section.
405405
406406
407407
## Create an Agent with the Grounding with Bing search tool enabled
408408
409409
To make the Grounding with Bing search tool available to your agent, use a connection to initialize the tool and attach it to the agent. You can find your connection in the **connected resources** section of your project in the [Azure AI Foundry portal](https://ai.azure.com/).
410410
411-
```console
412-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
411+
```bash
412+
curl --request POST \
413+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=$API_VERSION \
413414
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
414415
-H "Content-Type: application/json" \
415416
-d '{
@@ -437,17 +438,19 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-01 \
437438
438439
## Create a thread
439440
440-
```console
441-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=2025-05-01 \
441+
```bash
442+
curl --request POST \
443+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads?api-version=$API_VERSION \
442444
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
443445
-H "Content-Type: application/json" \
444446
-d ''
445447
```
446448
447449
## Add a user question to the thread
448450
449-
```console
450-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
451+
```bash
452+
curl --request POST \
453+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
451454
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
452455
-H "Content-Type: application/json" \
453456
-d '{
@@ -460,8 +463,9 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-versi
460463
461464
Create a run and observe that the model uses the Grounding with Bing Search tool to provide a response to the user's question.
462465
463-
```console
464-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2025-05-01 \
466+
```bash
467+
curl --request POST \
468+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=$API_VERSION \
465469
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
466470
-H "Content-Type: application/json" \
467471
-d '{
@@ -471,15 +475,17 @@ curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs?api-version=2
471475
472476
### Retrieve the status of the run
473477
474-
```console
475-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=2025-05-01 \
478+
```bash
479+
curl --request GET \
480+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/runs/run_abc123?api-version=$API_VERSION \
476481
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
477482
```
478483
479484
### Retrieve the agent response
480485
481486
```console
482-
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=2025-05-01 \
487+
curl --request GET \
488+
--url $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/threads/thread_abc123/messages?api-version=$API_VERSION \
483489
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
484490
```
485491

articles/ai-services/agents/how-to/tools/bing-custom-search-samples.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ Follow the [REST API Quickstart](../../quickstart.md?pivots=rest-api) to set the
390390
391391
To make the Grounding with Bing Custom Search tool available to your agent, use a connection to initialize the tool and attach it to the agent. You can find your connection in the **connected resources** section of your project in the [Azure AI Foundry portal](https://ai.azure.com/).
392392
393-
```console
393+
```bash
394394
curl $AZURE_AI_FOUNDRY_PROJECT_ENDPOINT/assistants?api-version=2025-05-15-preview \
395395
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
396396
-H "Content-Type: application/json" \

0 commit comments

Comments
 (0)