Skip to main content

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

llama_index_readers_clickhouse-0.2.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file llama_index_readers_clickhouse-0.2.0.tar.gz.

File metadata

File hashes

Hashes for llama_index_readers_clickhouse-0.2.0.tar.gz
Algorithm Hash digest
SHA256 be598143bc2f00b2b499625353354e9251bb1c8e6b11e00c850be0c2b5aff875
MD5 562b61d54308b10303a5c0b7d8405bd5
BLAKE2b-256 abf5f613ad9c1cac77b51bfd6938c7b7432ab506dd4b05056b4bc13b0b6c5c5b

See more details on using hashes here.

File details

Details for the file llama_index_readers_clickhouse-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_readers_clickhouse-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 17109cea70dd938347a27672aba05ecc0e1df579b7c0effe853a5b3b54758c49
MD5 510c86ec4c9066a2d2c724e8f272da4b
BLAKE2b-256 6d2be1eb005eb355664ff211281eee1d3a9cc21495240de8ebf2b9676fbc4b56

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page