Skip to content

Commit 2280088

Browse files
authored
Merge pull request #4549 from MicrosoftDocs/main
05/05/2025 PM Publishing
2 parents 272dea3 + 4aec58e commit 2280088

File tree

13 files changed

+439
-140
lines changed

13 files changed

+439
-140
lines changed

.openpublishing.publish.config.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@
9292
"branch": "main",
9393
"branch_mapping": {}
9494
},
95+
{
96+
"path_to_root": "azure-functions-ai-services-agent-javascript",
97+
"url": "https://github.com/Azure-Samples/azure-functions-ai-services-agent-javascript",
98+
"branch": "main",
99+
"branch_mapping": {}
100+
},
95101
{
96102
"path_to_root": "samples-cognitive-services-speech-sdk",
97103
"url": "https://github.com/Azure-Samples/cognitive-services-speech-sdk",

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

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services: azure-ai-agent-service
66
manager: nitinme
77
ms.service: azure-ai-agent-service
88
ms.topic: how-to
9-
ms.date: 01/30/2025
9+
ms.date: 04/15/2025
1010
author: aahill
1111
ms.author: aahi
1212
ms.custom: azure-ai-agents
@@ -138,7 +138,9 @@ To use all features of function calling including parallel functions, you need t
138138

139139
## Define a function for your agent to call
140140

141-
Start by defining an Azure Function queue trigger function that will process function calls from the queue.
141+
Start by defining an Azure Function queue trigger function that will process AI function calls from the queue.
142+
143+
# [Python](#tab/python)
142144

143145
```python
144146
# Function to get the weather from an Azure Storage queue where the AI Agent will send function call information
@@ -172,12 +174,27 @@ def process_queue_message(msg: func.QueueMessage) -> None:
172174
logging.info(f"Sent message to output queue with message {result_message}")
173175
```
174176

177+
# [TypeScript](#tab/typescript)
178+
179+
:::code language="TypeScript" source="~/azure-functions-ai-services-agent-javascript/app/src/functions/queueGetWeather.ts" :::
180+
181+
# [REST API](#tab/rest)
182+
183+
No REST equivalent provided.
184+
185+
186+
---
187+
175188

176189
## Create an AI project client and agent
177190

178-
In the sample below we create a client and an agent that has the tools definition for the Azure Function
191+
In the sample below we create a client and an agent that has the AI tools definition for the Azure Function. The term `function` is used in two contexts within the AI tool definition:
192+
193+
* Azure Function: the type of tool. This is the Azure Functions app.
194+
* Function: the Http trigger function `GetWeather` within the Azure Function to call when the tool is invoked in the AI Project.
179195

180196
# [Python](#tab/python)
197+
181198
```python
182199
# Initialize the client and create agent for the tools Azure Functions that the agent can use
183200

@@ -231,7 +248,12 @@ agent = project_client.agents.create_agent(
231248
)
232249
```
233250

251+
# [TypeScript](#tab/typescript)
252+
253+
:::code language="TypeScript" source="~/azure-functions-ai-services-agent-javascript/app/src/azureProjectInit.ts" id="CreateAgent" :::
254+
234255
# [REST API](#tab/rest)
256+
235257
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:
236258
```console
237259
curl $AZURE_AI_AGENTS_ENDPOINT/assistants?api-version=2024-12-01-preview \
@@ -276,6 +298,7 @@ curl $AZURE_AI_AGENTS_ENDPOINT/assistants?api-version=2024-12-01-preview \
276298
}'
277299
```
278300

301+
279302
---
280303

281304
## Create a thread for the agent
@@ -287,13 +310,18 @@ thread = project_client.agents.create_thread()
287310
print(f"Created thread, thread ID: {thread.id}")
288311
```
289312

313+
# [TypeScript](#tab/typescript)
314+
315+
:::code language="TypeScript" source="~/azure-functions-ai-services-agent-javascript/app/src/azureProjectInit.ts" id="CreateThread" :::
316+
290317
# [REST API](#tab/rest)
291318
```console
292319
curl $AZURE_AI_AGENTS_ENDPOINT/threads?api-version=2024-12-01-preview \
293320
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN" \
294321
-H "Content-Type: application/json" \
295322
-d ''
296323
```
324+
297325
---
298326

299327
## Create a run and check the output
@@ -320,6 +348,11 @@ while run.status in ["queued", "in_progress", "requires_action"]:
320348

321349
print(f"Run finished with status: {run.status}")
322350
```
351+
352+
# [TypeScript](#tab/typescript)
353+
354+
:::code language="TypeScript" source="~/azure-functions-ai-services-agent-javascript/app/src/functions/httpPrompt.ts" id="CreateMessage" :::
355+
323356
# [REST API](#tab/rest)
324357
```console
325358
curl $AZURE_AI_AGENTS_ENDPOINT/threads/thread_abc123/messages?api-version=2024-12-01-preview \
@@ -364,10 +397,34 @@ project_client.agents.delete_agent(agent.id)
364397
print("Deleted agent")
365398
```
366399

400+
# [TypeScript](#tab/typescript)
401+
402+
:::code language="TypeScript" source="~/azure-functions-ai-services-agent-javascript/app/src/functions/httpPrompt.ts" id="ListMessages" :::
403+
367404
# [REST API](#tab/rest)
368405
```console
369406
curl $AZURE_AI_AGENTS_ENDPOINT/threads/thread_abc123/messages?api-version=2024-12-01-preview \
370407
-H "Authorization: Bearer $AZURE_AI_AGENTS_TOKEN"
371408
```
372409

410+
---
411+
412+
## Troubleshooting
413+
414+
# [Python](#tab/python)
415+
416+
For any issues with the Python code, create an issue on the [sample code repository](https://github.com/Azure-Samples/azure-functions-ai-services-agent-python/issues)
417+
418+
# [TypeScript](#tab/typescript)
419+
420+
For any issues with the TypeScript code, create an issue on the [sample code repository](https://github.com/Azure-Samples/azure-functions-ai-services-agent-javascript/issues)
421+
422+
# [REST API](#tab/rest)
423+
424+
No REST equivalent provided.
425+
426+
---
427+
373428
::: zone-end
429+
430+

articles/ai-services/agents/how-to/virtual-networks.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ Azure AI Agent Service offers a standard agent configuration with private networ
113113

114114
| Template | Description | Autodeploy |
115115
| ------------------- | -----------------------------------------------| -----------------------|
116-
| `network-secured-agent.bicep` | Deploy a network secured agent setup that uses user-managed identity authentication on the Agent connections. | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fazureai-samples%2Fmain%2Fscenarios%2FAgents%2Fsetup%2Fnetwork-secured-agent%2Fazuredeploy.json)
116+
| `network-secured-agent.bicep` | Deploy a network secured agent setup that uses user-managed identity authentication on the Agent connections. | [![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2FAzure-Samples%2Fazureai-samples%2Fmain%2Fscenarios%2FAgents%2Fsetup%2Fnetwork-secured-agent-thread-storage%2Fazuredeploy.json)
117117

118118
### Option 2: manually deploy the bicep template
119119

120-
1. To manually run the bicep templates, [download the template from GitHub](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Agents/setup/network-secured-agent). Download the following from the `network-secured-agent` folder:
120+
1. To manually run the bicep templates, [download the template from GitHub](https://github.com/Azure-Samples/azureai-samples/tree/main/scenarios/Agents/setup/network-secured-agent-thread-storage). Download the following from the `network-secured-agent` folder:
121121
1. `main.bicep`
122122
1. `azuredeploy.parameters.json`
123123
1. `modules-network-secured folder`

articles/ai-services/computer-vision/index.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,6 @@ highlightedContent:
3232

3333
conceptualContent:
3434
items:
35-
- title: Optical character recognition
36-
links:
37-
- itemType: overview
38-
text: About OCR
39-
url: overview-ocr.md
40-
- itemType: quickstart
41-
text: Get started with OCR
42-
url: quickstarts-sdk/client-library.md
43-
- itemType: how-to-guide
44-
text: Call the Read API
45-
url: how-to/call-read-api.md
46-
- itemType: deploy
47-
text: Use the Read OCR container
48-
url: computer-vision-how-to-install-containers.md
49-
- itemType: learn
50-
text: Microsoft Learn training
51-
url: /training/modules/read-text-images-documents-with-computer-vision-service/
52-
- itemType: reference
53-
text: OCR API reference
54-
url: /rest/api/computervision/recognize-printed-text?view=rest-computervision-v3.2
55-
5635
- title: Image Analysis
5736
links:
5837
- itemType: overview
@@ -119,6 +98,27 @@ conceptualContent:
11998
- itemType: how-to-guide
12099
text: Call the Video Retrieval APIs
121100
url: how-to/video-retrieval.md
101+
- title: Optical character recognition (legacy)
102+
links:
103+
- itemType: overview
104+
text: About OCR
105+
url: overview-ocr.md
106+
- itemType: quickstart
107+
text: Get started with OCR
108+
url: quickstarts-sdk/client-library.md
109+
- itemType: how-to-guide
110+
text: Call the Read API
111+
url: how-to/call-read-api.md
112+
- itemType: deploy
113+
text: Use the Read OCR container
114+
url: computer-vision-how-to-install-containers.md
115+
- itemType: learn
116+
text: Microsoft Learn training
117+
url: /training/modules/read-text-images-documents-with-computer-vision-service/
118+
- itemType: reference
119+
text: OCR API reference
120+
url: /rest/api/computervision/recognize-printed-text?view=rest-computervision-v3.2
121+
122122

123123
tools:
124124
title: Software development kits (SDKs)

articles/ai-services/computer-vision/overview-ocr.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ ms.custom: devx-track-csharp
1616

1717
# OCR - Optical Character Recognition
1818

19+
> [!WARNING]
20+
> This service, including the Azure AI Vision legacy [OCR API in v3.2](/rest/api/computervision/recognize-printed-text?view=rest-computervision-v3.2) and [RecognizeText API in v2.1](/rest/api/computervision/recognize-printed-text/recognize-printed-text?view=rest-computervision-v2.1), is not recommended for use.
21+
22+
[!INCLUDE [read-editions](includes/read-editions.md)]
23+
24+
1925
OCR or Optical Character Recognition is also referred to as text recognition or text extraction. Machine-learning-based OCR techniques allow you to extract printed or handwritten text from images such as posters, street signs and product labels, as well as from documents like articles, reports, forms, and invoices. The text is typically extracted as words, text lines, and paragraphs or text blocks, enabling access to digital version of the scanned text. This eliminates or significantly reduces the need for manual data entry.
2026

2127

@@ -24,10 +30,8 @@ OCR or Optical Character Recognition is also referred to as text recognition or
2430

2531
Microsoft's **Read** OCR engine is composed of multiple advanced machine-learning based models supporting [global languages](./language-support.md). It can extract printed and handwritten text including mixed languages and writing styles. **Read** is available as cloud service and on-premises container for deployment flexibility. It's also available as a synchronous API for single, non-document, image-only scenarios with performance enhancements that make it easier to implement OCR-assisted user experiences.
2632

27-
> [!WARNING]
28-
> The Azure AI Vision legacy [OCR API in v3.2](/rest/api/computervision/recognize-printed-text?view=rest-computervision-v3.2) and [RecognizeText API in v2.1](/rest/api/computervision/recognize-printed-text/recognize-printed-text?view=rest-computervision-v2.1) operations are not recommended for use.
2933

30-
[!INCLUDE [read-editions](includes/read-editions.md)]
34+
3135

3236
## How is OCR related to Intelligent Document Processing (IDP)?
3337

0 commit comments

Comments
 (0)