The SingleStoreLoader
allows you to load documents directly from a SingleStore database table. It is part of the langchain-singlestore
integration package.
SingleStoreLoader
langchain_singlestore
❌ Features
To use the SingleStoreLoader
, you need to install the langchain-singlestore
package. Follow the installation instructions below.
Install langchain_singlestore.
%pip install -qU langchain_singlestore
Initialization
To initialize SingleStoreLoader
, you need to provide connection parameters for the SingleStore database and specify the table and fields to load documents from.
str
): Hostname, IP address, or URL for the database.str
): Name of the table to query. Defaults to embeddings
.str
): Field containing document content. Defaults to content
.str
): Field containing document metadata. Defaults to metadata
.str
): Field containing document IDs. Defaults to id
.int
): Number of active connections in the pool. Defaults to 5
.int
): Maximum connections beyond pool_size
. Defaults to 10
.float
): Connection timeout in seconds. Defaults to 30
.bool
): Enables pure Python mode.bool
): Allows local file uploads.str
): Character set for string values.str
): Paths to SSL files.bool
): Disables SSL.bool
): Verifies server's certificate.bool
): Verifies server's identity.bool
): Enables autocommits.str
): Structure of query results (e.g., tuples
, dicts
).from langchain_singlestore.document_loaders import SingleStoreLoader
loader = SingleStoreLoader(
host="127.0.0.1:3306/db",
table_name="documents",
content_field="content",
metadata_field="metadata",
id_field="id",
)
Load
docs = loader.load()
docs[0]
Lazy Load
page = []
for doc in loader.lazy_load():
page.append(doc)
if len(page) >= 10:
page = []
API reference
For detailed documentation of all SingleStore Document Loader features and configurations head to the github page: https://github.com/singlestore-labs/langchain-singlestore/
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