Course Classroom

A family trip to Melbourne, written so another agent can use it

Lesson summary

A family with two children asks for a trip from Singapore to Melbourne. A fluent itinerary would be useful to a reader. A booking service needs something else: a task it can recognise, a destination it can resolve and clear authority to act. Follow the family request from free text to a plan and decide what still needs checking.

Lesson 7 / 7 · 4 min · Beginner · English

Start here

Learning path

  1. Break the request into deliverables
  2. Define the shape of one handoff
  3. Read the enclosing model
  4. Match each assignment to an available role
  5. Inspect the returned plan

The diagrams reconstruct the teaching points. The timestamps link to the recorded lesson.

Break the request into deliverables

The instructor first decomposes a warm three-day holiday into flights, accommodation, transport and activities. This illustrates the pattern. The later family request is a separate example; importing the three-day duration into that plan would invent a constraint.

Break the request into deliverables · trip → tasks → agents

Original GuideWit diagram 1 · Break the request into deliverables. 00:58 · Microsoft video

Define the shape of one handoff

The demonstration introduces Pydantic to validate the structure of the response. Each subtask has a responsible agent and a description. Think of the description as a work order. It should tell the recipient enough to take the next step.

Define the shape of one handoff · input → Pydantic → TravelPlan

Original GuideWit diagram 2 · Define the shape of one handoff. 02:25 · Microsoft video

Read the enclosing model

The travel plan holds a main task and a collection of subtasks. The outer structure preserves the overall goal while each agent receives its own assignment. Compare a record missing its owner with one naming an unknown owner. The latter can still satisfy a plain string field.

Read the enclosing model · main_task → sub_tasks → assigned_agent

Original GuideWit diagram 3 · Read the enclosing model. 03:03 · Microsoft video

Match each assignment to an available role

The instructions list specialists including flights, hotels, rental cars and activities. Follow the Singapore–Melbourne request through that list. The children matter to hotel and activity choices even when those choices are handled by different recipients.

Match each assignment to an available role · Singapore → 2 children → Melbourne

Original GuideWit diagram 4 · Match each assignment to an available role. 03:58 · Microsoft video

Inspect the returned plan

The output assigns round-trip flights and family-friendly accommodation. An agent can carry the family requirement into a task description, but a successful validation does not establish that any property has a family room available. That requires a separate inventory result.

Inspect the returned plan · FlightBooking → HotelBooking → Activities

Original GuideWit diagram 5 · Inspect the returned plan. 04:20 · Microsoft video

Worked example · Editorial exercise

Input

Action

Expected evidence

Family asks for a trip

Create the main task

Keep both cities and the party composition.

Hotel specialist receives a task

Extract the family requirement

Ask inventory for suitable rooms.

Unknown agent name is supplied

Check a registry of valid roles

Hold the task for correction.

Troubleshooting

Observation

What to check

The plan validates but hotel search fails

Check occupancy, dates and inventory independently.

A child’s requirement disappears

Compare the original request with each downstream task.

Try it

  1. Sketch two tasks for the family.
  2. Change the hotel owner to a nonexistent role.
  3. Test shape and routing separately and write down which check catches it.

Expected result. The malformed route is rejected before dispatch while the valid flight assignment remains identifiable.

Check your understanding

  1. Does validated JSON prove a reservation exists?
  2. Where should the family requirement appear?

Answer key

  1. No. Look for a successful booking response and a reference.
  2. In each task whose outcome depends on it, particularly rooms and activities.

Glossary

  • Schema. The fields and types an output must contain.
  • Dispatch. Sending an accepted task to a recognised recipient.

Sources

The linked notebook is the repository version and may use a different implementation.

Microsoft Learn · Microsoft video · Microsoft · Lesson · Microsoft · Notebook