NeedleLoader is a document loader for managing documents stored in a collection.
Setup:
Install the needle-python library and set your Needle API key.
.. code-block:: bash
pip install needle-python
export NEEDLE_API_KEY="your-api-key"
Key init args:
needle_api_key (Optional[str]): API key for authenticating with Needle.collection_id (str): Needle collection to load documents from.Usage:
.. code-block:: python
from langchain_community.document_loaders.needle import NeedleLoader
loader = NeedleLoader( needle_api_key="your-api-key", collection_id="your-collection-id" )
documents = loader.load() for doc in documents: print(doc.metadata)
for doc in loader.lazy_load(): print(doc.metadata)
API key for authenticating with Needle.
Identifier for the Needle collection.
Adds files to the Needle collection.
Loads all documents from the Needle collection.
Lazily loads documents from the Needle collection.