|
2 роки тому | |
---|---|---|
embedchain | 2 роки тому | |
.gitignore | 2 роки тому | |
LICENSE | 2 роки тому | |
README.md | 2 роки тому | |
setup.py | 2 роки тому |
embedchain is a framework to easily create bots over any dataset.
You can add a single or multiple dataset using .add
function and then use .query
function to find an answer from the added datasets.
from embedchain import App
app = app()
app.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44")
app.add("pdf_file", "https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf")
app.add("web_page", "https://nav.al/feedback")
app.add("web_page", "https://nav.al/agi")
app.query("How to do a startup?")
First make sure that you have the package installed. If not, then install it using pip
pip install embedchain
We use OpenAI's embedding model to create embeddings for chunks and ChatGPT API as LLM to get answer given the relevant docs. Make sure that you have an OpenAI account and an API key.
Once you have the API key, set it in an environment variable called OPENAI_API_KEY
export OPENAI_API_KEY='sk-xxxxxxxx'
App
class from embedchain and use .add
function to add any dataset.
from embedchain import App
naval_ravikant_chat_bot_app = App()
naval_ravikant_chat_bot_app.add("youtube_video", "https://www.youtube.com/watch?v=3qHkcs3kG44")
naval_ravikant_chat_bot_app.add("pdf_file", "https://navalmanack.s3.amazonaws.com/Eric-Jorgenson_The-Almanack-of-Naval-Ravikant_Final.pdf")
naval_ravikant_chat_bot_app.add("web_page", "https://nav.al/agi")
.query
function to get the answer for any query.print(app.query("How to do a startup?"))
We support the following formats:
To add any youtube video to your app, use the data_type (first argument to .add
) as youtube_video
. Eg:
app.add('youtube_video', 'a_valid_youtube_url_here')
To add any pdf file, use the data_type as pdf_file
. Eg:
app.add('pdf_file', 'a_valid_url_where_pdf_file_can_be_accessed')
Note that we do not support password protected pdfs as of now.
To add any web page, use the data_type as web_page
. Eg:
app.add('web_page', 'a_valid_web_page_url')
Creating a chat bot over any dataset needs the following steps to happen
Whenever a user asks any query, following process happens to find the answer for the query
The process of loading the dataset and then querying involves multiple steps and each steps has nuances of it is own.
These questions may be trivial for some but for a lot of us, it needs research, experimentation and time to find out the accurate answers.
embedchain is a framework which takes care of all these nuances and provides a simple interface to create bots over any dataset.
In the first release, we are making it easier for anyone to get a chatbot over any dataset up and running in less than a minute. All you need to do is create an app instance, add the data sets using .add
function and then use .query
function to get the relevant answer.
embedchain is built on the following stack: