@@ -75,8 +75,8 @@ Move between topics using `@utils.transition to @topic.name`:
7575``` agentscript
7676reasoning:
7777 actions:
78- proceed_to_booking : @utils.transition to @topic.hotel_booking
79- description: "Move to booking when user wants to reserve a hotel "
78+ browse_hotels : @utils.transition to @topic.hotel_browse
79+ description: "Browse and search for available hotels "
8080```
8181
8282### Conditional Transition Availability
@@ -98,27 +98,11 @@ Transition after an action completes using `transition to`:
9898actions:
9999 create_booking: @actions.create_booking
100100 with hotel_name=...
101- 102- 103- set @variables.hotel_name = @inputs.hotel_name
104- set @variables.booking_id = @outputs.booking_id
105- set @variables.booking_confirmed = True
106- # Automatically move to confirmation after booking
107- transition to @topic.hotel_confirmation
108- ```
109-
110- ### Storing Action Inputs
111-
112- Capture inputs that the LLM provides:
113-
114- ``` agentscript
115- actions:
116- search_hotels: @actions.search_hotels
117- with location=...
118101 with check_in=...
119102 with check_out=...
120- set @variables.check_in_date = @inputs.check_in
121- set @variables.check_out_date = @inputs.check_out
103+ set @variables.booking_id = @outputs.booking_id
104+ set @variables.booking_confirmed = @outputs.success
105+ transition to @topic.hotel_confirmation
122106```
123107
124108## Key Code Snippets
@@ -141,36 +125,29 @@ topic hotel_browse:
141125 description: "Check-out date in ISO format (YYYY-MM-DD)"
142126 outputs:
143127 hotels: list[object]
144- description: "List of available hotel objects"
128+ description: "List of available hotel objects with name, price, rating, and amenities information"
129+ complex_data_type_name: "lightning__recordInfoType" # This is the name of the complex data type that is used to store the hotel objects
145130 target: "flow://SearchHotels"
146131
147132 reasoning:
148133 instructions:->
149- | Help users find the perfect hotel.
150-
151- Current search criteria:
134+ | Help users find the perfect hotel using {[email protected] _hotels}. 152135
153- if @variables.check_in_date :
154- | - Check-in: {[email protected] _in_date} 155- else:
156- | - Check-in: Not set
136+ Ensure to ask the user for :
137+ - location
138+ - check-in date
139+ - check-out date
157140
158- if @variables.check_out_date:
159- | - Check-out: {[email protected] _out_date} 160- else:
161- | - Check-out: Not set
141+ Do not ask for other booking details.
162142
163- | When users are ready to book, use the proceed_to_booking action .
143+ If you find available hotels provide the user the hotel information .
164144
165145 actions:
166146 search_hotels: @actions.search_hotels
167147 with location=...
168148 with check_in=...
169149 with check_out=...
170150 transition to @topic.hotel_booking
171-
172- proceed_to_booking: @utils.transition to @topic.hotel_booking
173- description: "Move to booking when user wants to reserve a hotel"
174151```
175152
176153### Complete Topic: Hotel Booking
@@ -186,31 +163,19 @@ topic hotel_booking:
186163 hotel_name: string
187164 description: "Name of the hotel to book"
188165 check_in: string
189- description: "Check-in date"
166+ description: "Check-in date in ISO format (YYYY-MM-DD) "
190167 check_out: string
191- description: "Check-out date"
168+ description: "Check-out date in ISO format (YYYY-MM-DD) "
192169 outputs:
193170 booking_id: string
194171 description: "Unique booking confirmation identifier"
195172 success: boolean
196- description: "Whether the booking was created successfully"
173+ description: "Indicates whether the booking was created successfully"
197174 target: "flow://CreateBooking"
198175
199176 reasoning:
200177 instructions:->
201- | Complete the booking for the customer.
202-
203- Booking details:
204-
205- if @variables.hotel_name:
206- | - Hotel: {[email protected] _name} 207- else:
208- | - Hotel: Not selected
209-
210- | - Check-in: {[email protected] _in_date} 211- - Check-out: {[email protected] _out_date} 212-
213- | Once booking is complete, transition to hotel_confirmation topic.
178+ | Complete the booking for the customer using {[email protected] _booking}. 214179
215180 actions:
216181 create_booking: @actions.create_booking
@@ -220,9 +185,6 @@ topic hotel_booking:
220185 set @variables.booking_id = @outputs.booking_id
221186 set @variables.booking_confirmed = @outputs.success
222187 transition to @topic.hotel_confirmation
223-
224- go_to_confirmation: @utils.transition to @topic.hotel_confirmation
225- description: "Move to confirmation after successful booking"
226188```
227189
228190### Complete Topic: Hotel Confirmation
@@ -240,7 +202,7 @@ topic hotel_confirmation:
240202241203 - Check-in: {[email protected] _in_date} 242204 - Check-out: {[email protected] _out_date} 243-
205+
244206 Provide these details to the customer and ask if they need anything else.
245207 If they want to make another booking, use start_new_booking action.
246208
@@ -275,7 +237,7 @@ User: I'll take the Bay View Hotel
275237Agent: Excellent choice! Let me help you book the Bay View Hotel.
276238```
277239
278- ** [ Agent calls proceed_to_booking → transitions to hotel_booking] **
240+ ** [ Agent calls search_hotels action → transitions to hotel_booking] **
279241
280242``` text
281243Agent: I'm ready to complete your booking at Bay View Hotel.
@@ -351,8 +313,8 @@ Good for: Exploratory interfaces, comparison shopping
351313** Good:**
352314
353315``` agentscript
354- proceed_to_booking : @utils.transition to @topic.hotel_booking
355- description: "Move to booking when user wants to reserve a hotel "
316+ start_new_booking : @utils.transition to @topic.hotel_browse
317+ description: "Start a new hotel search and booking "
356318```
357319
358320** Poor:**
@@ -362,18 +324,6 @@ go_next: @utils.transition to @topic.next
362324 description: "Go next"
363325```
364326
365- ### State Management
366-
367- Store state in variables before transitioning:
368-
369- ``` agentscript
370- actions:
371- search_hotels: @actions.search_hotels
372- with check_in=...
373- set @variables.check_in_date = @inputs.check_in
374- # State preserved for next topic
375- ```
376-
377327## What's Next
378328
379329- ** TopicDelegation** : Learn about delegation (consulting other topics)
0 commit comments