FASTCHAIN is work in progress!!
Fastchain is a library which helps you build production grade LLM powered agents faster and integrate it with your existing applications.
- First step is to edit the .env.example file, rename the file to just .env (remove .example from the filename)
- Get your openai api key and set the value in .env file by replace <ENTER_YOUR_API_KEY> with your api key
pip install fastchain
from fastchain import FastChainApp
app = FastChainApp()
# PDF location can be local file path or a web url
app.add_data("pdf", "test.pdf")
# Add a webpage as data source
app.add_data("url", "https://www.samplewebsite.com/index.html")
# You can also add a whole website to crawl all the pages from
app.add_data("website", "https://www.pranavpandey2511.github.io", page_limit=50)
# Index all the data sources you have added till now
app.index()
fastchain provides you with multiple high level APIs, we will explain them one by one how and where you can use each one.
fastchain
the highest level api that you can use to get started
from chainsaw import fastchain
Let's say you want to build a simple chatbot for your website, here's how you can do that with fastchain:
from fastchain import FastChainApp
app = FastChainApp()
app.add_data("website", my_website, page_limit=25)
app.index()
- Data connectors
- Vector DBs
- Qdrant
- Weaviate
- Pinecone
- ChromaDB
- Agents
- Custom Agents
There might be a use case where you want to add your custom dataloader for some reason which is not yet supported by fastchain, that can be easily achieved by extending the BaseLoader class inside dataloaders.base_loader
you have to simply implement two functions to make it work
-
load_data() -> To load the data from the datasource and return document type data.
-
_verify_data() -> To verify if the loaded data is consistent or not
from fastchain.dataloaders.base_loader import BaseDataLoader
class CustomDataLoader(BaseDataLoader):
def __init__(self):
pass
def load_data(self, source) -> Document:
pass
def _verify_data(self, data) -> bool:
pass