Back to Llama Index

MyScale Reader

docs/examples/data_connectors/MyScaleReaderDemo.ipynb

0.14.211.2 KB
Original Source

<a href="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/data_connectors/MyScaleReaderDemo.ipynb" target="_parent"></a>

MyScale Reader

If you're opening this Notebook on colab, you will probably need to install LlamaIndex 🦙.

python
%pip install llama-index-readers-myscale
python
!pip install llama-index
python
import logging
import sys

logging.basicConfig(stream=sys.stdout, level=logging.INFO)
logging.getLogger().addHandler(logging.StreamHandler(stream=sys.stdout))
python
import clickhouse_connect

host = "YOUR_CLUSTER_HOST"
username = "YOUR_USERNAME"
password = "YOUR_CLUSTER_PASSWORD"
client = clickhouse_connect.get_client(
    host=host, port=8443, username=username, password=password
)
python
import random
from llama_index.readers.myscale import MyScaleReader

reader = MyScaleReader(myscale_host=host, username=username, password=password)
reader.load_data([random.random() for _ in range(1536)])
python
reader.load_data(
    [random.random() for _ in range(1536)],
    where_str="extra_info._dummy=0",
    limit=3,
)