Chat Your Doc is an experimental project aimed at exploring various applications based on LLM. Although it is nominally a chatbot project, its purpose is broader. The project explores various applications using tools such as LangChain or scikit-learn LLM. In the "Lab Apps" section, you can find many examples, including simple and complex ones. The project focuses on researching and exploring various LLM applications, while also incorporating other fields such as UX and computer vision. The "Lab App" section includes a table with links to various apps, descriptions, launch commands, and demos.
For OpenAI, set API-KEY to your environment variables.
export OPENAI_API_KEY="sk-$TJHGFHJDSFDGAFDFRTHT§$%$%&§%&"
conda env create -n chat-ur-doc -f environment.yml
conda activate chat-ur-doc
pip install -r requirements.txt
ref: https://python.langchain.com/docs/modules/data_connection/vectorstores/
Chroma, FAISS
pip install chromadb
pip install faiss-cpu
App | Models & Components | Description | Launch | Demo |
---|---|---|---|---|
chat_ur_docs.py | ConversationalRetrievalChain, ConversationBufferMemory, ChatOpenAI, LangChain | Chat with documents freely | streamlit run advanced/chat_ur_docs.py --server.port 8004 --server.enableCORS false |
|
chatbot.py | ConversationChain, ConversationBufferMemory, ChatOpenAI, LangChain | Basic chatbot | streamlit run simple/chatbot.py --server.port 8003 --server.enableCORS false |
![]() ![]() |
faiss_app.py | OpenAI, FAISS, OpenAIEmbeddings, RecursiveCharacterTextSplitter, VectorDBQAWithSourcesChain LangChain | Ask info from a internet file, find similar docs and answer with VectorDBQAWithSourcesChain | streamlit run advanced/faiss_app.py --server.port 8005 --server.enableCORS false |
![]() ![]() |
App | Models & Components | Description | Launch | Demo |
---|---|---|---|---|
i-ask.sh | OpenAI http-request | Simply ask & answer via OpenAI API | i-ask.sh "Who is Joe Biden?" |
![]() |
chat_openai.py | ChatOpenAI, LangChain | Just one chat session | streamlit run simple/chat_openai.py --server.port 8000 --server.enableCORS false |
![]() |
open_api_llm_app.py | OpenAI, LLMChain, LangChain | Use OpenAI LLM to answer simple question | streamlit run simple/open_api_llm_app.py --server.port 8001 --server.enableCORS false |
![]() |
read_html_app.py | CharacterTextSplitter, LangChain | Get html content and chunk | streamlit run simple/read_html_app.py --server.port 8002 --server.enableCORS false |
![]() |
💥 chatbot.py | ConversationChain, ConversationBufferMemory, ChatOpenAI, LangChain | Basic chatbot | streamlit run simple/chatbot.py --server.port 8003 --server.enableCORS false |
![]() ![]() |
App | Models & Components | Description | Launch | Demo |
---|---|---|---|---|
💥 sim_app.py | Chroma, RecursiveCharacterTextSplitter, OpenAIEmbeddings, LangChain | Use the vector database to save file in chunks and retrieve similar content from the database | streamlit run intermediate/sim_app.py --server.port 8002 --server.enableCORS false |
![]() |
llm_chain_translator_app.py | ChatOpenAI, LLMChain, LangChain | Use LLMChain to do language translation | streamlit run intermediate/llm_chain_translator_app.py --server.port 8003 --server.enableCORS false |
![]() ![]() |
html_summary_chat_app.py | ChatOpenAI, LangChain | Summary html content | streamlit run intermediate/html_summary_chat_app.py --server.port 8004 --server.enableCORS false |
![]() |
💥 html_2_json_app.py | ChatOpenAI, LangChain | Summary html keypoints into keypoint json | streamlit run intermediate/html_2_json_app.py --server.port 8005 --server.enableCORS false |
![]() |
App | Models & Components | Description | Launch | Demo |
---|---|---|---|---|
qa_chain_pdf_app.py | OpenAI, Chroma, RecursiveCharacterTextSplitter, load_qa_chain->BaseCombineDocumentsChain, LangChain | Ask info from PDF file, chat with it | streamlit run advanced/qa_chain_pdf_app.py --server.port 8004 --server.enableCORS false |
![]() ![]() |
faiss_app.py | OpenAI, FAISS, OpenAIEmbeddings, RecursiveCharacterTextSplitter, VectorDBQAWithSourcesChain LangChain | Ask info from a internet file, find similar docs and answer with VectorDBQAWithSourcesChain | streamlit run advanced/faiss_app.py --server.port 8005 --server.enableCORS false |
![]() ![]() |
html_2_json_output_app.py | ResponseSchema, StructuredOutputParser, LangChain | Load html content and summary into json objects | streamlit run advanced/html_2_json_output_app.py --server.port 8006 --server.enableCORS false |
![]() ![]() |
joke_bot.py | ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate ResponseSchema, StructuredOutputParser, ChatOpenAI, LangChain | Prompt engineering to get one random joke or rate one joke | python advanced/joke_bot.py --rate "Why couldn't the bicycle stand up by itself? It was two tired." or python advanced/joke_bot.py --tell --num 4 |
![]() ![]() |
chat_ur_docs.py | ConversationalRetrievalChain, ConversationBufferMemory, ChatOpenAI, LangChain | Chat with documents freely | streamlit run advanced/chat_ur_docs.py --server.port 8004 --server.enableCORS false |
These key notes can be very helpful in getting up to speed quickly. Look for them while you're learning and share them with others. These notes are especially useful when you're asking yourself questions like why, what, and how.
<style> table { width: 100%; border-collapse: collapse; } td { padding: 8px; text-align: center; } img { width: 100%; height: auto; } @media screen and (max-width: 600px) { table, td, tr { display: block; } td { text-align: center; border-bottom: none; } } </style>![]() |
![]() |
![]() |
|
![]() |
![]() |
![]() |
|
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
![]() |