Part 3/7:
A classifier agent is added to determine whether the user request pertains to an itinerary or flight details. This classifier outputs a JSON object with a classification
property, which can be either flight info
or itinerary
.
Step 3: Branching Logic with Conditional Nodes
An if-else node uses the classifier's output to route the request to the appropriate agent:
If classification indicates flight info, it proceeds to a flight agent.
Otherwise, it goes to an itinerary agent.
Step 4: Creating Specialized Agents
Flight Agent
The flight agent is configured to:
Function as a travel assistant with prompts like "always recommend specific flights using airport codes".
Have access to web search for real-time flight data.