llama-index readers readwise integration
Project description
Readwise Reader
Use Readwise's export API to fetch your highlights from web articles, epubs, pdfs, Kindle, YouTube, and load the resulting text into LLMs.
Setup
- Get your Readwise API key from readwise.io/access_token.
Usage
Here is an example usage of the Readwise Reader:
import os
from llama_index import VectorStoreIndex, download_loader
ReadwiseReader = download_loader("ReadwiseReader")
token = os.getenv("READWISE_API_KEY")
loader = ReadwiseReader(api_key=token)
documents = loader.load_data()
index = VectorStoreIndex.from_documents(documents)
index.query("What was the paper 'Attention is all you need' about?")
You can also query for highlights that have been created after a certain time:
import os
import datetime
from llama_index import VectorStoreIndex, download_loader
ReadwiseReader = download_loader("ReadwiseReader")
token = os.getenv("READWISE_API_KEY")
loader = ReadwiseReader(api_key=token)
seven_days_ago = datetime.datetime.now() - datetime.timedelta(days=7)
documents = loader.load_data(updated_after=seven_days_ago)
index = VectorStoreIndex.from_documents(documents)
index.query("What has Elon Musk done this time?")
This loader is designed to be used as a way to load data into LlamaIndex and/or subsequently used as a Tool in a LangChain Agent. See here for examples.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for llama_index_readers_readwise-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b43c77136cd1bd59e4559aab91f6137b4205fa696fd981de267b903a2857b576 |
|
MD5 | a3227bf7d8166855e0cfb52ce373ad89 |
|
BLAKE2b-256 | 53df889960dca6a11697bf282aa98708ae42e8bd11e69212b74875042752f3ed |
Close
Hashes for llama_index_readers_readwise-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53ab95380f50570529dfa7856bfd295d7e10359ca55dad87257f74efe42926df |
|
MD5 | 3f78f457be708e3c5d63bd545922410a |
|
BLAKE2b-256 | 2293b480eb976c1e7682361a06d81e065549c687392dbc0c1cf69c559dd92391 |