I have created a new tool that does the inverse of the previous one: it receives a City as input and will retrieve the IATA code of the airport in that city. Below you see screenshots of the workflow and the result of the Agent calling it. Note that if the Prompt includes more than one city, the Agent will just call the Tool repeatedly.
As a next step, we will create another tool that looks up available flights between two airports.
Having the Agent use these two tools in combination will allow the user to ask questions like "What flights are available between Washington and Atlanta?"
Below you can see the Workflow/Tool that looks up the flights. As this is just a prototype, there are obviously some things missing, as for example the date the User wants to fly on. The Tool will just retrieve all flights it can find between the two cities, even if they are in the past.
Note that, as we now pass two inputs to the tool (origin and destination), we have two String Configuration nodes.
Let's try this out. Below you see the Prompt we have put into our Agent and the resulting output.
And finally, below you can see the output of the View Agent Conversation node. Looks OK .
I have now modified the User Prompt to ask the agent to reserve the second option for two passengers. This is what I got back:
Makes sense, because we don't have a tool yet to handle reservations. So let's build one
Below you can see the Reserve Flight tool and the output when we run the Agent again.
Of course, the Reserve Flight tool is very rudimentary (it just writes a row to the Reservations table), but I hope the idea is clear on how you can modularly design and develop a set of tools.