Repository for experimenting with Streamlit <> LangChain integrations. Current projects:
- StreamlitCallbackHandler: Show LangChain agent steps and tool usage natively in Streamlit via LangChain Callbacks.
- MRKL Demo: Demo the LangChain MRKL agent as a Streamlit app.
Create Python environment:
$ pipenv install
$ pipenv shell
Install pre-commit hook:
$ pre-commit install
Create .streamlit/secrets.toml
:
openai_api_key = "[YOUR_KEY]"
serpapi_api_key = "[YOUR_KEY]"
$ streamlit run mrkl_demo.py
mrkl_demo.py
- Replicates the MRKL Agent demo notebook as a Streamlit app, using the callback handler.
streamlit_callback_handler.py
- LangChain callback handler that displays LangChain output in a Streamlit-y fashionmutable_expander.py
- used by the callback handler to create "dynamic" expander UIscapturing_callback_handler.py
- LangChain callback handler that captures and stores LangChain queries for offline replay. (This is a developer tool, and is not required bystreamlit_callback_handler
!)