Let's look in the concept of semantic routing in LLMs. So you are talking to a closed domain LLM power chatbot that knows all of it about flights. So it needs to understand the conversation and accordingly call that service. Now this can get a little overwhelming for your model. Instead you should be applying a semantic routing layer before you even call the LLM. Acting is a super fast decision making layer. This Python library makes it really easy for implementing this functionality. You can install it with the pip command, import the route class and define its name and some sample references that are representation for that route. We then define a embedding instance for calculating the similarity between the utterance and the route representation. And wrap all of it inside the route layer. During inference you just give in an utterance and it gives you the route. If not, it will return none. Follow for more.