llama-index readers clickhouse integration
Project description
LlamaIndex Readers Integration: ClickHouse
Overview
ClickHouse Reader is a tool designed to retrieve documents from ClickHouse databases efficiently.
Installation
You can install ClickHouse Reader via pip:
pip install llama-index-readers-clickhouse
Usage
from llama_index.core.schema import Document
from llama_index.readers.clickhouse import ClickHouseReader
# Initialize ClickHouseReader with the connection details and configuration
reader = ClickHouseReader(
clickhouse_host="<ClickHouse Host>",
username="<Username>",
password="<Password>",
clickhouse_port=8123, # Optional: Default port is 8123
database="<Database Name>",
engine="MergeTree", # Optional: Default engine is "MergeTree"
table="<Table Name>",
index_type="NONE", # Optional: Default index type is "NONE"
metric="cosine", # Optional: Default metric is "cosine"
batch_size=1000, # Optional: Default batch size is 1000
index_params=None, # Optional: Index parameters
search_params=None, # Optional: Search parameters
)
# Load data from ClickHouse
documents = reader.load_data(
query_vector=[0.1, 0.2, 0.3], # Query vector
where_str=None, # Optional: Where condition string
limit=10, # Optional: Number of results to return
)
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.
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
File details
Details for the file llama_index_readers_clickhouse-0.3.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_clickhouse-0.3.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6f4fc9432f71c2c1b5492588efd453dbfffce5f57d5a2fb7cc95278565f5b70 |
|
MD5 | bbbf7ebb4e01c929cfac6d6e5da99d99 |
|
BLAKE2b-256 | d2c0143445dd42ec1271bc7f75b889f397f3110fda865848b0123ae3e0cf04a6 |
File details
Details for the file llama_index_readers_clickhouse-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_clickhouse-0.3.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/22.3.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 870f1a91cb3d0f8365410213ed58f811c8302aa6933dd566b07e2caa2023144d |
|
MD5 | 9b1698e84d6c513290ac7b1f950f264c |
|
BLAKE2b-256 | ad5087c4396c4850bb243ed5802fff46c81f87cf94e0efec23e26dd16ba35f7d |