Added new app demo

This commit is contained in:
ShubhamSaboo 2024-04-30 15:23:16 -05:00
parent 57e9dd38c4
commit 4a50599055
7 changed files with 116 additions and 3 deletions

View file

@ -1,5 +1,7 @@
<p align="center">
<img src="docs/banner/unwind.png" width="600px" alt="Unwind AI">
<a href="https://unwindai.substack.com">
<img src="docs/banner/unwind.png" width="600px" alt="Unwind AI">
</a>
</p>
<p align="center">
@ -25,3 +27,28 @@ Engage in intelligent conversation and question-answering based on the content o
### 📽️ Chat with YouTube Videos
Dive into the world of video content with interactive conversation and question-answering based on YouTube videos. Simply provide a YouTube video URL and start engaging with the video's content through natural language.
## 🚀 Getting Started
1. Clone the repository
```bash
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
```
2. Navigate to the desired project directory
```bash
cd awesome-llm-apps/chat_with_gmail
```
3. Install the required dependencies
```bash
pip install -r requirements.txt
```
4. Follow the project-specific instructions in each project's README.md file to set up and run the app.
### 🤝 Contributing
Contributions are welcome! If you have any ideas, improvements, or new apps to add, please submit a pull request. Make sure to follow the existing project structure and include a detailed README.md for each new app.

42
chat_with_gmail/README.md Normal file
View file

@ -0,0 +1,42 @@
## 📨 Chat with Gmail Inbox
LLM app with RAG to chat with Gmail in just 30 lines of Python Code. The app uses Retrieval Augmented Generation (RAG) to provide accurate answers to questions based on the content of your Gmail Inbox.
## Features
- Connect to your Gmail Inbox
- Ask questions about the content of your emails
- Get accurate answers using RAG and the selected LLM
## Installation
1. Clone the repository
```bash
git clone https://github.com/Shubhamsaboo/awesome-llm-apps.git
```
2. Install the required dependencies
```bash
pip install -r requirements.txt
```
3. Set up your Google Cloud project and enable the Gmail API:
- Go to the [Google Cloud Console](https://console.cloud.google.com/) and create a new project.
- Navigate to "APIs & Services > OAuth consent screen" and configure the OAuth consent screen.
- Publish the OAuth consent screen by providing the necessary app information.
- Enable the Gmail API and create OAuth client ID credentials.
- Download the credentials in JSON format and save them as `credentials.json` in your working directory.
4. 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_gmail.py
```

View file

@ -0,0 +1,40 @@
import tempfile
import streamlit as st
from embedchain import App
# 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}},
}
)
# Create Streamlit app
st.title("Chat with your Gmail Inbox 📧")
st.caption("This app allows you to chat with your Gmail inbox using OpenAI API")
# Get the OpenAI API key from the user
openai_access_token = st.text_input("Enter your OpenAI API Key", type="password")
# Set the Gmail filter statically
gmail_filter = "to: me label:inbox"
# Add the Gmail data to the knowledge base if the OpenAI API key is provided
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)
app.add(gmail_filter, data_type="gmail")
st.success(f"Added emails from Inbox to the knowledge base!")
# Ask a question about the emails
prompt = st.text_input("Ask any question about your emails")
# Chat with the emails
if prompt:
answer = app.query(prompt)
st.write(answer)

View file

@ -0,0 +1,2 @@
streamlit
embedchain[gmail]

View file

@ -1,4 +1,4 @@
## Chat with PDF 📄
## 📄 Chat with PDF
LLM app with RAG to chat with PDF in just 30 lines of Python Code. The app uses Retrieval Augmented Generation (RAG) to provide accurate answers to questions based on the content of the uploaded PDF.

View file

@ -1,4 +1,4 @@
## Chat with YouTube Videos 📺
## 📽️ Chat with YouTube Videos
LLM app with RAG to chat with YouTube Videos in just 30 lines of Python Code. The app uses Retrieval Augmented Generation (RAG) to provide accurate answers to questions based on the content of the uploaded video.

View file

@ -0,0 +1,2 @@
streamlit
embedchain[youtube]