wangjuns / chat-agent

Reference implementations of several LangChain agents as Streamlit apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🦜️🔗 LangChain 🤝 Streamlit agent examples

Open in GitHub Codespaces

This repository contains reference implementations of various LangChain agents as Streamlit apps including:

  • basic_streaming.py: Simple streaming app with langchain.chat_models.ChatOpenAI (View the app)
  • mrkl_demo.py: An agent that replicates the MRKL demo (View the app)
  • minimal_agent.py: A minimal agent with search (requires setting OPENAI_API_KEY env to run)
  • search_and_chat.py: A search-enabled chatbot that remembers chat history (View the app)

Apps feature LangChain 🤝 Streamlit integrations such as the Callback integration.

Setup

This project uses Poetry for dependency management.

# Create Python environment
$ poetry install

# Install git pre-commit hooks
$ poetry shell
$ pre-commit install

Running

# Run mrkl_demo.py or another app the same way
$ streamlit run streamlit_agent/mrkl_demo.py

Contributing

We plan to add more agent examples over time - PRs welcome

  • Chat QA over docs
  • SQL agent

About

Reference implementations of several LangChain agents as Streamlit apps

License:Apache License 2.0


Languages

Language:Python 98.1%Language:Dockerfile 1.9%