https://github.com/streamlit/streamlitlangchain
https://github.com/streamlit/streamlitlangchain
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/streamlit/streamlitlangchain
- Owner: streamlit
- License: apache-2.0
- Created: 2023-05-25T18:14:00.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-10-17T20:38:05.000Z (over 1 year ago)
- Last Synced: 2025-01-29T10:36:44.103Z (5 months ago)
- Language: Python
- Size: 857 KB
- Stars: 58
- Watchers: 2
- Forks: 9
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StreamlitLangChain
Repository for experimenting with Streamlit <> LangChain integrations. Current projects:
- **MRKL Demo:** Demo the LangChain MRKL agent as a Streamlit app.
## Setup
Create Python environment:
```shell
$ pipenv install
$ pipenv shell
```Install pre-commit hook:
```shell
$ pre-commit install
```Create `.streamlit/secrets.toml`:
```toml
openai_api_key = "[YOUR_KEY]"
```## Run
```shell
$ streamlit run mrkl_demo.py
```## Relevant Source Files
- `mrkl_demo.py` - Replicates the [MRKL Agent demo notebook](https://python.langchain.com/en/latest/modules/agents/agents/examples/mrkl.html) as a Streamlit app, using the callback handler.
- `mrkl_minimal.py` - Minimal version of the MRKL app, currently embedded in LangChain docs
- `minimal_agent.py` - A most-minimal version of the integration, referenced in the LangChain callback integration docs### `callbacks/`
- `capturing_callback_handler.py` - LangChain callback handler that captures and stores LangChain queries for offline replay. (This is a developer tool, and is not required by `streamlit_callback_handler`!)