This project is designed to experiment with language models using a Streamlit app interface. It allows users to interact with a language model chain to generate responses based on input messages.
To set up the project, ensure you have Python 3.12 installed. Use Poetry to manage dependencies.
-
Install dependencies:
poetry install
-
Set OPENAI_API_KEY as an environment variable:
To run the Streamlit app, execute the following command:
streamlit run app.py
This will start a local server, and you can interact with the app through your web browser.
To run the tests, use pytest
:
pytest tests/
This will execute the test suite to ensure the chain invocation works as expected.
To build the Docker image, use the following command:
docker build --target development -t chat-dev .
To run the app in the container, use:
docker run --env OPENAI_API_KEY=$Env:OPENAI_API_KEY -p 8501:8501 chat-dev
Or to run the unit tests in the container, use:
docker run chat-dev pytest /app/tests/unit