Demos for Function Calling

This repository contains a series of demos for manually implementing function calling. The milestones are described in the project here: https://hackmd.io/@timothy1ee/Hk1jhHCaA

To run each milestone, use the following command:

chainlit run milestone_<number>.py -w

Installation

1. Create a virtual environment

First, create a virtual environment to isolate the project dependencies:

python -m venv .venv

2. Activate the virtual environment:

  • On Windows:
    .venv\Scripts\activate
  • On macOS and Linux:
    source .venv/bin/activate

3. Install dependencies

Install the project dependencies from the requirements.txt file:

pip install -r requirements.txt

Updating dependencies

If you need to update the project dependencies, follow these steps:

  1. Update the requirements.in file with the new package or version.

  2. Install pip-tools if you haven't already:

    pip install pip-tools
  3. Compile the new requirements.txt file:

    pip-compile requirements.in
  4. Install the updated dependencies:

    pip install -r requirements.txt

This process ensures that all dependencies are properly resolved and pinned to specific versions for reproducibility.