Skip to content

Commit d3591fb

Browse files
committed
chore: add chapter on flow options
1 parent 897e996 commit d3591fb

2 files changed

Lines changed: 89 additions & 6 deletions

File tree

docs/arc/adl/adl_cheat.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,35 @@
1414

1515
## ⚡ Advanced Features
1616

17-
| **Feature** | **How it looks** | **Why it matters** |
18-
| --- | --- | --- |
19-
| **Conditionals** | `md<br>#### Solution<br><isBusinessCustomer>Provide https://example.com/business/reset<br>Provide https://example.com/reset.<isPrivateCustomer><br>` | Adjust response per customer type. |
20-
| **Tool Calls** | `md<br>#### Solution<br>Call @password_reset_link()! to generate a reset link.<br>` | Calls or enforces external functions. |
21-
| **Use Case References** | `md<br>If business customer, follow #business_customer_support<br>` | Reuse existing flows, stay modular. |
17+
**Conditionals**
2218

23-
---
19+
Similar to `if` conditionals, they let you tailor responses based on context.
20+
21+
```
22+
#### Solution
23+
<isBusinessCustomer> Provide https://example.com/business/reset
24+
Provide https://example.com/reset. <isPrivateCustomer>
25+
```
26+
27+
**Tool Calls**
28+
29+
Calls or enforces external functions.
30+
31+
```
32+
#### Solution
33+
Call @password_reset_link()! to generate a reset link.
34+
```
35+
36+
**Use Case References**
37+
38+
Reuse existing flows, stay modular.
39+
40+
```
41+
#### Solution
42+
If business customer, follow #business_customer_support
43+
```
44+
45+
----
2446

2547
✅ **Workflow in 15 minutes:**
2648

docs/arc/adl/adl_technical.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,5 +178,66 @@ If the customer is a business customer, the use case #business_customer_support
178178

179179
```
180180

181+
### Flow Options
181182

183+
Flow Options enables Use Case authors to express decision trees within the Use Case markdown.
182184

185+
To achieve this, the Use Case writer can simply add so called Flow Options to the bottom of any Use Case as follows:
186+
187+
```markdown
188+
[option 1] command
189+
[option 2] command 2
190+
```
191+
192+
**Option** Used to match the user's input to the command that should be executed.
193+
194+
**Command** This can be any instruction given to the LLM to perform. Examples include:
195+
- Tool calls
196+
- A reply to give to the user
197+
- A use case reference
198+
199+
The options should be placed at the bottom of the solution section of a use case.
200+
201+
There can be any number of options, i.e. from 1 to N.
202+
203+
Example
204+
205+
```markdown
206+
#### Use Case: buy_car
207+
Customer wants to buy a car Use Case.
208+
209+
#### Description
210+
The customer wants to buy a car.
211+
212+
#### Solution
213+
Ask the customer what type of car they would like to buy.
214+
215+
[bmw] go to the case #buy_bmw
216+
[other] reply that we don't sell that type of car.
217+
218+
#### Case: buy_bmw
219+
Ask the customer what color would they like.
220+
221+
[color selected] go to the final case #buy_bmw_with_color
222+
[other] reply with "ok, we need to know the color "
223+
224+
#### Case: buy_bmw_with_color
225+
Call the tool @buy_car() to finalize the purchase.
226+
And reply to the customer that we are grateful for their businees.
227+
228+
```
229+
230+
In this flow, we start by asking the customer what type of car they would like to buy.
231+
232+
Based on their response, the agent will either return the solution defined
233+
in the #buy_bmw use case or reply that "We dont sell that type of car. "
234+
235+
If the customer wants to buy a BMW, the agent will then ask what color they would like.
236+
If the customer provides a color, the agent will proceed to the final case #buy_bmw_with_color
237+
where it will call the tool @buy_car() to finalize the purchase
238+
and reply to the customer that we are grateful for their business.
239+
240+
By modularizing the flow in this way, the Use Case Compiler can re-enforce that the agent follows the defined flow.
241+
242+
This feature also introduces "Cases". These are Use Cases that are only reachable via a Flow Option.
243+
Unlike regular Use Cases, Cases do not have Examples nor a Description section.

0 commit comments

Comments
 (0)