Skip to content

Commit 00da91e

Browse files
author
ecfan
committed
Draft doc
1 parent 39479b6 commit 00da91e

File tree

8 files changed

+135
-39
lines changed

8 files changed

+135
-39
lines changed

articles/logic-apps/connectors/azure-ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: how-to
99
ms.date: 02/29/2024
1010
---
1111

12-
# Integrate Azure AI services with Standard workflows in Azure Logic Apps (preview)
12+
# Integrate Azure AI services with Standard workflows in Azure Logic Apps (Preview)
1313

1414
[!INCLUDE [logic-apps-sku-standard](../../../includes/logic-apps-sku-standard.md)]
1515

31.3 KB
Loading
43.4 KB
Loading
20.3 KB
Loading
61.4 KB
Loading
73.5 KB
Loading

articles/logic-apps/parse-chunk-content.md

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
---
2+
title: Parse document or chunk text
3+
description: Parse a document or chunk text to use with Azure AI operations for Standard workflows in Azure Logic Apps.
4+
services: logic-apps
5+
ms.suite: integration
6+
ms.reviewer: estfan, azla
7+
ms.topic: how-to
8+
ms.date: 07/26/2024
9+
# Customer intent: As a developer using Azure Logic Apps, I want to parse a document or chunk text that I want to use with Azure AI operations for my Standard workflow in Azure Logic Apps.
10+
---
11+
12+
# Parse or chunk content to use with Azure AI operations for Standard workflows in Azure Logic Apps (Preview)
13+
14+
[!INCLUDE [logic-apps-sku-standard](../../includes/logic-apps-sku-standard.md)]
15+
16+
> [!IMPORTANT]
17+
> This capability is in preview and is subject to the
18+
> [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
19+
20+
To convert content, such as a PDF document, CSV file, or even an Excel file, into a format that you can more easily use with an Azure AI operation, such as **Azure AI Search** or **Azure OpenAI**, you can include the **Data Operations** actions named **Parse a document** and **Chunk text** in your Standard logic app workflow.
21+
22+
The following table describes these data operations:
23+
24+
| Data operation | Description |
25+
|----------------|-------------|
26+
| **Parse a document** | Convert the specified content into a string with tokens that represent outputs, which you can reference and use with subsequent actions in your workflow. |
27+
| **Chunk text** | Split the specified content into pieces, based on the selected strategy: <br><br>- **FixedLength** - number of characters: Provide the maximum number of characters per chunk and the language to use. <br><br>- **TokenSize** - number of tokens: Provide the maximum number of tokens per chunk and the encoding model to use. |
28+
29+
> [!NOTE]
30+
>
31+
> Preceding actions that use chunking don't affect the **Chunk text** action,
32+
> nor does the **Chunk text** action affect subsequent actions that use chunking.
33+
34+
This how-to guide shows how to add and set up these operations in your workflow.
35+
36+
## Prerequisites
37+
38+
* An Azure account and subscription. If you don't have an Azure subscription, [sign up for a free Azure account](https://azure.microsoft.com/free/?WT.mc_id=A261C142F).
39+
40+
* A Standard logic app workflow with an existing trigger because the **Parse a document** and **Chunk text** operations are available only as actions. Make sure that the action that retrieves the content that you want to parse or chunk precedes these data operations.
41+
42+
## Parse a document
43+
44+
For this example, suppose your workflow starts with the **Request** trigger named **When a HTTP request is received**. This trigger waits to receive an HTTP request sent from another component, such as an Azure function or another logic app workflow. The HTTP request indicates that content is available for the workflow to retrieve and parse. An **HTTP** action immediately follows the trigger and gets the content from its storage location.
45+
46+
Other example triggers you might use include Azure Blob Storage, Office 365 Outlook, or another service-based trigger. Other example actions that can retrieve content include Azure Blob Storage, File System, FTP, and so on.
47+
48+
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource and workflow in the designer.
49+
50+
1. Under the existing trigger and actions, [follow these general steps to add the **Data Operations** action named **Parse a document**](create-workflow-with-trigger-or-action.md#add-action).
51+
52+
1. On the designer, select the **Parse a document** action. After the action information pane opens, on the **Parameters** tab, in the **Document Content** property, specify the content to parse by following these steps:
53+
54+
1. Select inside the **Document Content** box.
55+
56+
The options for the dynamic content list (lightning icon) and the expression editor (function icon) appear.
57+
58+
- To choose the output from a preceding action, select the dynamic content list.
59+
60+
- To create an expression that manipulates output from a preceding action, select the expression editor.
61+
62+
This example continues by selecting the lightning icon for the dynamic content list.
63+
64+
1. After the dynamic content list opens, select the output that you want from a preceding operation.
65+
66+
In this example, the **Parse a document** action references the **Body** output from the **HTTP** action.
67+
68+
:::image type="content" source="media/parse-document-chunk-text/select-http-body.png" alt-text="Screenshot shows Azure portal, Standard workflow designer, Request trigger, HTTP action, and action named Parse a document with opened dynamic content list and selected Body output from HTTP action." lightbox="media/parse-document-chunk-text/select-http-body.png":::
69+
70+
The **Body** output now appears in the **Document Content** box:
71+
72+
:::image type="content" source="media/parse-document-chunk-text/parse-document.png" alt-text="Screenshot shows sample workflow with Body output in the action named Parse a document." lightbox="media/parse-document-chunk-text/parse-document.png":::
73+
74+
1. Under the **Parse a document** action, add the actions that you want to work with the tokenized output string, for example, **Chunk text**.
75+
76+
## Chunk text
77+
78+
This example builds on the preceding section by using the **Chunk text** operation to split the tokenized output string into pieces that subsequent actions in the workflow can more easily use.
79+
80+
1. In the [Azure portal](https://portal.azure.com), open your Standard logic app resource and workflow in the designer.
81+
82+
1. Under the **Parse a document** action, [follow these general steps to add the **Data Operations** action named **Chunk text**](create-workflow-with-trigger-or-action.md#add-action).
83+
84+
1. On the designer, select the **Chunk text** action. After the action information pane opens, on the **Parameters** tab, for the **Chunking Strategy** property, select the strategy to use for chunking and provide the corresponding property values:
85+
86+
| Strategy | Description |
87+
|----------|-------------|
88+
| **FixedLength** | Split the specified content into pieces based on number of characters. <br><br>**Text**: The content to chunk. <br><br>**MaxPageLength**: The maximum number of characters per content chunk. <br><br>**PageOverlapLength** (optional): The number of characters to overlap in each chunk. The default value is **0**. <br><br>- **Language**: The language to use for the resulting chunks. |
89+
| **TokenSize** | Split the specified content into pieces based on number of tokens. <br><br>**Text**: The content to chunk. <br><br>- **TokenSize**: The maximum number of tokens per content chunk. <br><br>- **Encoding model**: The encoding model to use. |
90+
91+
1. After you select the strategy, select inside the **Text** box to specify the content for chunking.
92+
93+
The options for the dynamic content list (lightning icon) and the expression editor (function icon) appear.
94+
95+
- To choose the output from a preceding action, select the dynamic content list.
96+
97+
- To create an expression that manipulates output from a preceding action, select the expression editor.
98+
99+
This example continues by selecting the lightning icon for the dynamic content list.
100+
101+
1. After the dynamic content list opens, select the output that you want from a preceding operation.
102+
103+
In this example, the **Chunk text** action references the **Parsed result text** output from the **Parse a document** action.
104+
105+
:::image type="content" source="media/parse-document-chunk-text/select-parsed-result-text.png" alt-text="Screenshot shows Azure portal, Standard workflow designer, Request trigger, HTTP action, action named Parse a document, and action named Chunk text with opened dynamic content list and selected output from Parse a document action." lightbox="media/parse-document-chunk-text/select-parsed-result-text.png":::
106+
107+
The **Parsed result action** output now appears in the **Text** box:
108+
109+
:::image type="content" source="media/parse-document-chunk-text/chunk-text.png" alt-text="Screenshot shows sample workflow with selected parsed result text output in the action named Chunk text." lightbox="media/parse-document-chunk-text/chunk-text.png":::
110+
111+
1. Complete the setup for the **Chunk text** action, based on your selected strategy.
112+
113+
Now, when you add Azure AI operations, the content is formatted for easier consumption.
114+
115+
The following example includes other actions to create a complete workflow pattern to ingest data from any source:
116+
117+
:::image type="content" source="media/parse-document-chunk-text/complete-example.png" alt-text="Screenshot shows sample workflow with selected parsed result text output in the action named Chunk text." lightbox="media/parse-document-chunk-text/complete-example.png":::
118+
119+
| Step | Task | Underlying operation | Description |
120+
|------|------|----------------------|-------------|
121+
| 1 | Check for new data. | **When an HTTP request is received** | A trigger that either polls or waits for new data to arrive, either based on a scheduled recurrence or in response to specific events respectively. Such an event might be a new file that's uploaded to a specific storage system, such as SharePoint, OneDrive, or Azure Blob Storage. <br><br>In this example, the **Request** trigger operation waits for an HTTP or HTTPS request sent from another endpoint. The request includes the URL for a new uploaded document. |
122+
| 2 | Get the data. | **HTTP** | An **HTTP** action that retrieves the uploaded document using the file URL from the trigger output. |
123+
| 3 | Compose document details. | **Compose** | A **Data Operations** action that concatenates various items. <br><br>This example concatenates key-value information about the document. |
124+
| 4 | Create token string. | **Parse a document** | A **Data Operations** action that produces a tokenized string using the output from the **Compose** action. |
125+
| 5 | Create content chunks. | **Chunk text** | A **Data Operations** action that splits the token string into pieces, based on either the number of characters or tokens per content chunk. |
126+
| 6 | Convert tokenized and chunked text to JSON. | **Parse JSON** | A **Data Operations** action that converts the chunked output into a JSON array. |
127+
| 7 | Select JSON array items. | **Select** | A **Data Operations** action that selects multiple items from the JSON array. |
128+
| 8 | Generate the embeddings. | **Get multiple embeddings** | An **Azure OpenAI** action that creates embeddings for each JSON array item. |
129+
| 9 | Select embeddings and other information. | **Select** | A **Data Operations** action that selects embeddings and other document information. |
130+
| 10 | Index the data. | **Index documents** | An **Azure AI Search** action that indexes the data based on each selected embedding. |
131+
132+
## Related content
133+
134+
[Integrate Azure AI services with Standard workflows in Azure Logic Apps](connectors/azure-ai.md)

0 commit comments

Comments
 (0)