In the class "Building Applications in LLM", there is a lesson regarding OpenAI function calling. Since openAI is not paid, I have tried to simulate the same behavior for Hugging Face Mistral model.
However HuggingFace, as of now does not support function calling from models. A round about way of doing it is to input a system prompt based on user prompt. This system prompt will generate output as JSON, which can then be used for function calling.
Please check this file for the code. Please share your feedback.