MyScaleReader#

class llama_index.readers.MyScaleReader(myscale_host: str, username: str, password: str, myscale_port: Optional[int] = 8443, database: str = 'default', table: str = 'llama_index', index_type: str = 'IVFLAT', metric: str = 'cosine', batch_size: int = 32, index_params: Optional[dict] = None, search_params: Optional[dict] = None, **kwargs: Any)#

Bases: BaseReader

MyScale reader.

Parameters
  • myscale_host (str) – An URL to connect to MyScale backend.

  • username (str) – Usernamed to login.

  • password (str) – Password to login.

  • myscale_port (int) – URL port to connect with HTTP. Defaults to 8443.

  • database (str) – Database name to find the table. Defaults to ‘default’.

  • table (str) – Table name to operate on. Defaults to ‘vector_table’.

  • index_type (str) – index type string. Default to “IVFLAT”

  • metric (str) – Metric to compute distance, supported are (‘l2’, ‘cosine’, ‘ip’). Defaults to ‘cosine’

  • batch_size (int, optional) – the size of documents to insert. Defaults to 32.

  • index_params (dict, optional) – The index parameters for MyScale. Defaults to None.

  • search_params (dict, optional) – The search parameters for a MyScale query. Defaults to None.

Methods Summary

load_data(query_vector[, where_str, limit])

Load data from MyScale.

Methods Documentation

load_data(query_vector: List[float], where_str: Optional[str] = None, limit: int = 10) List[Document]#

Load data from MyScale.

Parameters
  • query_vector (List[float]) – Query vector.

  • where_str (Optional[str], optional) – where condition string. Defaults to None.

  • limit (int) – Number of results to return.

Returns

A list of documents.

Return type

List[Document]