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.2.0.tar.gz
.
File metadata
- Download URL: llama_index_readers_clickhouse-0.2.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be598143bc2f00b2b499625353354e9251bb1c8e6b11e00c850be0c2b5aff875 |
|
MD5 | 562b61d54308b10303a5c0b7d8405bd5 |
|
BLAKE2b-256 | abf5f613ad9c1cac77b51bfd6938c7b7432ab506dd4b05056b4bc13b0b6c5c5b |
File details
Details for the file llama_index_readers_clickhouse-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: llama_index_readers_clickhouse-0.2.0-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17109cea70dd938347a27672aba05ecc0e1df579b7c0effe853a5b3b54758c49 |
|
MD5 | 510c86ec4c9066a2d2c724e8f272da4b |
|
BLAKE2b-256 | 6d2be1eb005eb355664ff211281eee1d3a9cc21495240de8ebf2b9676fbc4b56 |