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
@@ -62,8 +62,8 @@ The example workflow uses the following operations:
62
62
63
63
| Operation | Description |
64
64
|-----------|-------------|
65
-
| Built-in trigger named **When an HTTP request is available**| Waits for a external caller to send an HTTPS request. This request fires the trigger to start the workflow and passes in a serialized token string with the inputs for the workflow actions. |
66
-
|Several**Compose** built-in actions | These actions store the following test data: <br><br>- **Question**: The question asked. <br><br>- **Product catalog**: Internal product catalog entries. <br><br>- **Employee**: Employee profile and past procurement orders. |
65
+
| Built-in trigger named **When an HTTP request is available**| Waits for an HTTPS request to arrive from external caller. This request causes the trigger to fire, start the workflow, and pass in a serialized token string with inputs for the workflow actions to use. |
66
+
|Three**Compose** built-in actions | These actions store the following test data: <br><br>- **Question**: The question asked. <br><br>- **Product catalog**: Internal product catalog entries. <br><br>- **Employee**: Employee profile and past procurement orders. |
67
67
| Built-in action named **Get chat completions using Prompt Template** | Gets [chat completions](/azure/ai-services/openai/how-to/chatgpt) for the specified prompt template. For more information, see [Get chat completions using prompt template](/azure/logic-apps/connectors/built-in/reference/openai/#get-chat-completions-using-prompt-template-(preview)).
68
68
69
69
> [!TIP]
@@ -106,6 +106,8 @@ To following along with the example, get the [sample prompt template and inputs]
To add the operation that starts your workflow when an event happens or a condition is met, follow these steps:
@@ -140,9 +142,32 @@ To add operations that store the trigger outputs for subsequent actions to use a
140
142
141
143
1. Under the trigger, follow [these steps to add the data operation named **Compose** action](/azure/logic-apps/create-workfklow-with-trigger-or-action?tabs=standard#add-action).
142
144
143
-
This example adds three **Compose** actions and uses the following test data as inputs:
145
+
The example adds three **Compose** actions and uses the following test data as inputs:
146
+
147
+
1. Rename the first **Compose** action as **Employee**, and enter the following data in the **Inputs** box:
148
+
149
+
```json
150
+
{
151
+
"firstName": "Sophie",
152
+
"lastName": "Owen",
153
+
"department": "IT",
154
+
"employeeId": "E12345",
155
+
"orders": [
156
+
{
157
+
"name": "Dell Latitude 5540 Laptop",
158
+
"description": "Ordered 15 units for Q1 IT onboarding",
159
+
"date": "2024/02/20"
160
+
},
161
+
{
162
+
"name": "Docking Station",
163
+
"description": "Bulk purchase of 20 Dell WD19S docking stations",
164
+
"date": "2024/01/10"
165
+
}
166
+
]
167
+
}
168
+
```
144
169
145
-
1. Rename the first**Compose** action to**Question**, and enter the following data in the **Inputs** box:
170
+
1. Rename the next **Compose** action as **Question**, and enter the following data in the **Inputs** box:
146
171
147
172
```json
148
173
[
@@ -153,7 +178,7 @@ To add operations that store the trigger outputs for subsequent actions to use a
153
178
]
154
179
```
155
180
156
-
1. Rename the next **Compose** action to **Product catalog**, and enter the following data in the **Inputs** box:
181
+
1. Rename the next **Compose** action as **Products**, and enter the following data in the **Inputs** box:
157
182
158
183
```json
159
184
[
@@ -170,29 +195,6 @@ To add operations that store the trigger outputs for subsequent actions to use a
170
195
]
171
196
```
172
197
173
-
1. Rename the final **Compose** action as **Employee**, and enter the following data in the **Inputs** box:
174
-
175
-
```json
176
-
{
177
-
"firstName": "Sophie",
178
-
"lastName": "Owen",
179
-
"department": "IT",
180
-
"employeeId": "E12345",
181
-
"orders": [
182
-
{
183
-
"name": "Dell Latitude 5540 Laptop",
184
-
"description": "Ordered 15 units for Q1 IT onboarding",
185
-
"date": "2024/02/20"
186
-
},
187
-
{
188
-
"name": "Docking Station",
189
-
"description": "Bulk purchase of 20 Dell WD19S docking stations",
190
-
"date": "2024/01/10"
191
-
}
192
-
]
193
-
}
194
-
```
195
-
196
198
When you're done, your workflow looks like the following example:
197
199
198
200
:::image type="content" source="media/create-chat-assistant-prompt-template-standard-workflow/compose-actions.png" alt-text="Screenshot shows the Standard workflow designer, Request trigger, and three renamed Compose actions." lightbox="media/create-chat-assistant-prompt-template-standard-workflow/compose-actions.png":::
@@ -214,51 +216,81 @@ Now, add the Azure OpenAI action to the workflow.
214
216
215
217
1. When you're done, select **Create new**.
216
218
217
-
1. After the action pane opens, provide the following information to use for the prompt template:
219
+
1. After the action pane opens, on the **Parameters** tab, provide the following information to use for the prompt template:
218
220
219
221
| Parameter | Value | Description |
220
222
|-----------|-------|-------------|
221
-
| **Deployment Identifier** | - **gpt-4o** <br>- **gpt-35** | The deployed model name. |
222
-
| **Prompt Template** | <*template-text*> | The prompt template, which uses Prompty liquid format. For more information, see the following documentation: <br><br>- [Get chat completions using Prompt Template](/azure/logic-apps/connectors/built-in/reference/openai/#get-chat-completions-using-prompt-template-(preview)) |
223
+
| **Deployment Identifier** | - **gpt-4o** <br>- **gpt-35** | The name for the Azure OpenAI deployed model, which should match the one that you used for your Azure OpenAI resource. |
224
+
| **Prompt Template** | <*template-text*> | The prompt template. For more information, see [Get chat completions using Prompt Template](/azure/logic-apps/connectors/built-in/reference/openai/#get-chat-completions-using-prompt-template-(preview)). |
223
225
224
226
For this example, replace the example template text with the following sample text:
225
227
226
228
```
227
229
system:
228
230
You are an AI assistant for Contoso's internal procurement team. You help employees get quick answers about previous orders and product catalog details. Be brief, professional, and use markdown formatting when appropriate. Include the employee’s name in your response for a personal touch.
Use this documentation to guide your response. Include specific item names and any relevant descriptions.
232
247
233
248
{% for item in documents %}
234
-
Catalog Item ID: {{item.id}}
249
+
Catalog item ID: {{item.id}}
235
250
Name: {{item.title}}
236
251
Description: {{item.content}}
237
252
{% endfor %}
238
253
239
-
# Order History
254
+
# Order history
240
255
Here is the employee's procurement history to use as context when answering their question.
241
256
242
257
{% for item in customer.orders %}
243
258
Order Item: {{item.name}}
244
259
Details: {{item.description}} — Ordered on {{item.date}}
245
260
{% endfor %}
261
+
262
+
Based on the product documentation and order history above, please provide a concise and helpful answer to their question. Do not fabricate information beyond the provided inputs.
| **`{{ Employee.department }}`** | Adds department context. |
271
+
| **`{{ Question[0].content }}`** | Injects the employee's question from the **Compose** action named **Question**. |
272
+
| **`{% for doc in Products %}`** | Loops through catalog data from the **Compose** action named **Products**. |
273
+
| **`{% for order in Employee.orders %}`** | Loops through the employee's order history from the **Compose** action named **Employee**. |
254
274
255
-
{% for item in question %}
256
-
{{item.role}}:
257
-
{{item.content}}
258
-
{% endfor %}
275
+
Each element value is dynamically pulled from the workflow's **Compose** actions - all without any code or external services needed. You can apply the same approach to reference data output from other operations, for example, a SharePoint list, SQL Server row, email body, or even AI Search results. You only have to map the outputs into the prompt template and let your workflow do the rest.
259
276
260
-
Based on the product documentation and order history above, please provide a concise and helpful answer to their question. Do not fabricate information beyond the provided inputs.
261
-
```
277
+
1. From the **Advanced parameters** list, select **Prompt Template Variable**, which now appears on the **Parameters** tab.
278
+
279
+
1. In the key-value table that appears on the **Parameters** tab, enter the following template variable names and outputs selected from the preceding **Compose** actions in the workflow, for example:
280
+
281
+
1. On the first row, in the first column, enter **Employee** as the variable name.
282
+
283
+
1. On the same row, in the next column, select inside the edit box, and then select the lightning icon to open the dynamic content list.
284
+
285
+
1. From the dynamic content list, under **Employee**, select **Outputs**.
286
+
287
+
:::image type="content" source="media/create-chat-assistant-prompt-template-standard-workflow/template-variable.png" alt-text="Screenshot shows the action named Get chat completions using Prompt Template, Prompt Template Variable table, open dynamic content list, and selected Outputs value in the Question section." lightbox="media/create-chat-assistant-prompt-template-standard-workflow/template-variable.png":::
288
+
289
+
1. Repeat the same steps on the next row and following row for **Question** and **Products**.
290
+
291
+
When you're done, the table looks like the following example:
292
+
293
+
:::image type="content" source="media/create-chat-assistant-prompt-template-standard-workflow/template-variables-complete.png" alt-text="Screenshot shows completed Prompt Template Variable table with Question, Product catalog, and Employee outputs." lightbox="media/create-chat-assistant-prompt-template-standard-workflow/template-variables-complete.png":::
262
294
263
295
1. For other parameters, see [Get chat completions using Prompt Template](/azure/logic-apps/connectors/built-in/reference/openai/#get-chat-completions-using-prompt-template-(preview)).
264
296
@@ -268,8 +300,45 @@ When you're done, your workflow looks like the following example:
268
300
269
301
## Test your workflow
270
302
271
-
## Delete your resources
303
+
1. To trigger your workflow, send an HTTPS request to the callback URL for the **Request** trigger, including the method that the **Request** trigger expects, by using your HTTP request tool, based on the instructions.
304
+
305
+
For more information about the trigger's underlying JSON definition and how to call this trigger, see the following documentation:
- [Receive and respond to inbound HTTPS calls to workflows in Azure Logic Apps](/azure/logic-apps/connectors-native-reqres?tabs=standard)
310
+
311
+
After workflow execution completes, the run history page opens for finished workflow instance to show the status for each action.
312
+
313
+
:::image type="content" source="media/create-chat-assistant-prompt-template-standard-workflow/run-history.png" alt-text="Screenshot shows run history for most recently complete workflow with status for each operation." lightbox="media/create-chat-assistant-prompt-template-standard-workflow/run-history.png":::
314
+
315
+
1. To find the run history page for a specific workflow run at a later time, follow these steps:
316
+
317
+
1. On the workflow menu, under **Tools**, select **Run history**.
318
+
319
+
1. On the **Run history** tab, select the workflow run to inspect.
320
+
321
+
1. To find the chat response, on the run history page, select the Azure OpenAI action.
322
+
323
+
A pane opens to show the inputs and outputs for the selected action.
324
+
325
+
1. On the opened pane, scroll to the **Outputs** section.
326
+
327
+
:::image type="content" source="media/create-chat-assistant-prompt-template-standard-workflow/chat-response.png" alt-text="Screenshot shows the run history for most recently complete workflow with status for each operation and selected Azure OpenAI action with inputs and outputs." lightbox="media/create-chat-assistant-prompt-template-standard-workflow/chat-response.png":::
328
+
329
+
The response is entirely based on the structured context that is passed into your workflow — no extra fine-tuning needed.
330
+
331
+
## Clean up resources
332
+
333
+
If you no longer need the resources that you created after you finish this guide, make sure to delete these resources so that you don't continue to get charged. You can either follow these steps to delete the resource group that contains these resources, or you can delete each resource individually.
334
+
335
+
1. In the Azure search box, enter **resource groups**, and select **Resource groups**.
336
+
337
+
1. Find and select the resource groups that contain the resources for this example.
338
+
339
+
1. On the **Overview** page, select **Delete resource group**.
272
340
341
+
1. When the confirmation pane appears, enter the resource group name, and select **Delete**.
0 commit comments