We are experimenting with the new function calling API from OpenAI
Create a virtualenv e.g. by running python -m venv .venv and activate it.
Then install the requirements
pip install -r requirements.txt
You are ready to run the script run.py
The code defines a function for multiplication, passes the function definition along with the params as per the documentation (I assume this gets translated to the prompt) and then asks the llm to multiply two numbers
The way function calling works is that the LLM responds that it wants to call the function which you can invoke with the params that the LLM has parsed / created from the user and then you provide back the response for the LLM to continue its completion.