Function Calling with LLMs that do not implement tools support
It is possible to reproduce this feature with some LLMs that do not implement the "Function Calling" feature natively, but we need to supervise them and explain precisely what we need. The result (the output) will be less predictable, so you will need to add some tests before using the output, but with some "clever" LLMs, you will obtain correct results. I did my experiments with phi3:mini.
The trick is simple:
Add this message at the begining of the list of messages:
Add this message at the end of the list of messages, just before the user message:
At the end, you will have this:
Note
Look at this sample for a complete sample: examples/17-fake-function-calling