Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Function calling

We are experimenting with the new function calling API from OpenAI

Setup

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

Experiment

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.