This is a starter project for the function calling project here: https://hackmd.io/@timothy1ee/Hk1jhHCaA
It starts you off with a basic Chainlit app that streams responses, and maintains chat history. There is an initial system prompt that sets up an AI movie assistant that can generate a function call to fetch now playing movies.
There is a helper file that provides the required movie functions.
To run the app, use the following command:
chainlit run app.py -w
First, create a virtual environment to isolate the project dependencies:
python -m venv .venv
- On Windows:
.venv\Scripts\activate
- On macOS and Linux:
source .venv/bin/activate
Copy the .env_sample
file to .env
:
cp .env_sample .env
Then edit the .env
file and add your API keys:
- OPENAI_API_KEY: Your OpenAI API key
- TMDB_API_ACCESS_TOKEN: Your TMDB API access token
- SERP_API_KEY: Your SERP API key
- LANGCHAIN_API_KEY: Your LangChain API key
Install the project dependencies from the requirements.txt
file:
pip install -r requirements.txt
If you need to update the project dependencies, follow these steps:
-
Update the
requirements.in
file with the new package or version. -
Install
pip-tools
if you haven't already:pip install pip-tools
-
Compile the new
requirements.txt
file:pip-compile requirements.in
-
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.