A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://python.langchain.com/docs/integrations/document_loaders/astradb/ below:

AstraDB | ๐Ÿฆœ๏ธ๐Ÿ”— LangChain

AstraDB

DataStax Astra DB is a serverless AI-ready database built on Apache Cassandraยฎ and made conveniently available through an easy-to-use JSON API.

Overviewโ€‹

The Astra DB Document Loader returns a list of Langchain Document objects read from an Astra DB collection.

The loader takes the following parameters:

The loader sets the following metadata for the documents it reads:

metadata={
"namespace": "...",
"api_endpoint": "...",
"collection": "..."
}
Setupโ€‹
!pip install "langchain-astradb>=0.6,<0.7"
Load documents with the Document Loaderโ€‹
from langchain_astradb import AstraDBLoader

API Reference: AstraDBLoader

from getpass import getpass

ASTRA_DB_API_ENDPOINT = input("ASTRA_DB_API_ENDPOINT = ")
ASTRA_DB_APPLICATION_TOKEN = getpass("ASTRA_DB_APPLICATION_TOKEN = ")
ASTRA_DB_API_ENDPOINT =  https://01234567-89ab-cdef-0123-456789abcdef-us-east1.apps.astra.datastax.com
ASTRA_DB_APPLICATION_TOKEN = ยทยทยทยทยทยทยทยท
loader = AstraDBLoader(
api_endpoint=ASTRA_DB_API_ENDPOINT,
token=ASTRA_DB_APPLICATION_TOKEN,
collection_name="movie_reviews",
projection={"title": 1, "reviewtext": 1},
limit=10,
)
Document(metadata={'namespace': 'default_keyspace', 'api_endpoint': 'https://01234567-89ab-cdef-0123-456789abcdef-us-east1.apps.astra.datastax.com', 'collection': 'movie_reviews'}, page_content='{"_id": "659bdffa16cbc4586b11a423", "title": "Dangerous Men", "reviewtext": "\\"Dangerous Men,\\" the picture\'s production notes inform, took 26 years to reach the big screen. After having seen it, I wonder: What was the rush?"}')

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4