A collection of small Python projects that explore chat models, structured output, embeddings, and Streamlit interfaces using LangChain.
| Project | Description | Run |
|---|---|---|
| Mood AI chatbot | Chat with an assistant in angry, sad, or funny modes. | streamlit run chatmodels/UIchatbot.py |
| Movie information extractor | Converts a movie description into structured fields such as title, genre, cast, rating, and summary. | streamlit run CineSage/UICore.py |
| CLI movie extractor | Command-line version of the movie information extractor. | python CineSage/core.py |
| CLI mood chatbot | Command-line version of the mood chatbot. | python chatmodels/chatbot.py |
| Embeddings example | Creates a Mistral embedding vector for a text query. | python embeddingmodels/embeddings.py |
- Python 3.10 or later
- A Mistral AI API key
Install the project dependencies:
pip install -r requirements.txt
pip install streamlitCreate a .env file in the project root and add your Mistral API key:
MISTRAL_API_KEY=your_mistral_api_keyThe Hugging Face example in chatmodels/huggingface.py may additionally require a Hugging Face access token, depending on the model and endpoint configuration.
Run the movie extractor web app:
streamlit run CineSage/UICore.pyOr run the mood chatbot web app:
streamlit run chatmodels/UIchatbot.pyStreamlit will display a local address in the terminal; open it in your browser to use the app.
.
|-- chatmodels/
| |-- UIchatbot.py # Streamlit mood chatbot
| |-- chatbot.py # CLI mood chatbot
| |-- chat.py # Basic chat-model example
| `-- huggingface.py # Hugging Face chat-model setup
|-- CineSage/
| |-- UICore.py # Streamlit movie extractor
| `-- core.py # CLI movie extractor
|-- embeddingmodels/
| `-- embeddings.py # Mistral embeddings example
`-- requirements.txt
- The examples use
mistral-small-latestfor chat andmistral-embed-2312for embeddings. - Keep
.envprivate; never commit API keys to source control.