Added new demo

This commit is contained in:
ShubhamSaboo 2024-05-03 21:20:59 -05:00
parent ef53163218
commit bd2e5aa68d
4 changed files with 74 additions and 0 deletions

View file

@ -24,6 +24,9 @@ Streamlit app that allows you to chat with any webpage using local Llama-3 and R
### 📨 Chat with Gmail
Interact with your Gmail inbox using natural language. Get accurate answers to your questions based on the content of your emails with Retrieval Augmented Generation (RAG).
### 📝 Chat with Substack Newsletter
Streamlit app that allows you to chat with a Substack newsletter using OpenAI's API and the Embedchain library. This app leverages GPT-4 to provide accurate answers to questions based on the content of the specified Substack newsletter.
### 📄 Chat with PDF
Engage in intelligent conversation and question-answering based on the content of your PDF documents. Simply upload a PDF document and start asking questions. Chat with PDF will analyze the document, extract relevant information, and generate accurate responses to your queries.

View file

@ -0,0 +1,28 @@
## 📝 Chat with Substack Newsletter
Streamlit app that allows you to chat with a Substack newsletter using OpenAI's API and the Embedchain library. This app leverages GPT-4 to provide accurate answers to questions based on the content of the specified Substack newsletter.
## Features
- Input a Substack blog URL
- Ask questions about the content of the Substack newsletter
- Get accurate answers using OpenAI's API and Embedchain
### How to get Started?
1. Clone the GitHub repository
```bash
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
```
2. Install the required dependencies:
```bash
pip install -r requirements.txt
```
3. Get your OpenAI API Key
- Sign up for an [OpenAI account](https://platform.openai.com/) (or the LLM provider of your choice) and obtain your API key.
4. Run the Streamlit App
```bash
streamlit run chat_substack.py
```

View file

@ -0,0 +1,41 @@
import streamlit as st
from embedchain import App
import tempfile
# Define the embedchain_bot function
def embedchain_bot(db_path, api_key):
return App.from_config(
config={
"llm": {"provider": "openai", "config": {"model": "gpt-4-turbo", "temperature": 0.5, "api_key": api_key}},
"vectordb": {"provider": "chroma", "config": {"dir": db_path}},
"embedder": {"provider": "openai", "config": {"api_key": api_key}},
}
)
st.title("Chat with Substack Newsletter 📝")
st.caption("This app allows you to chat with Substack newsletter using OpenAI API")
# Get OpenAI API key from user
openai_access_token = st.text_input("OpenAI API Key", type="password")
if openai_access_token:
# Create a temporary directory to store the database
db_path = tempfile.mkdtemp()
# Create an instance of Embedchain App
app = embedchain_bot(db_path, openai_access_token)
# Get the Substack blog URL from the user
substack_url = st.text_input("Enter Substack Newsletter URL", type="default")
if substack_url:
# Add the Substack blog to the knowledge base
app.add(substack_url, data_type='substack')
st.success(f"Added {substack_url} to knowledge base!")
# Ask a question about the Substack blog
query = st.text_input("Ask any question about the substack newsletter!")
# Query the Substack blog
if query:
result = app.query(query)
st.write(result)

View file

@ -0,0 +1,2 @@
streamlit
embedchain