langchain.vectorstores.clickhouse.ClickhouseSettings¶

class langchain.vectorstores.clickhouse.ClickhouseSettings(_env_file: Optional[Union[str, PathLike, List[Union[str, PathLike]], Tuple[Union[str, PathLike], ...]]] = '<object object>', _env_file_encoding: Optional[str] = None, _env_nested_delimiter: Optional[str] = None, _secrets_dir: Optional[Union[str, PathLike]] = None, *, host: str = 'localhost', port: int = 8123, username: Optional[str] = None, password: Optional[str] = None, index_type: str = 'annoy', index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100], index_query_params: Dict[str, str] = {}, column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'}, database: str = 'default', table: str = 'langchain', metric: str = 'angular')[source]¶

Bases: BaseSettings

ClickHouse Client Configuration

Attribute:
clickhouse_host (str)An URL to connect to MyScale backend.

Defaults to ‘localhost’.

clickhouse_port (int) : URL port to connect with HTTP. Defaults to 8443. username (str) : Username to login. Defaults to None. password (str) : Password to login. Defaults to None. index_type (str): index type string. index_param (list): index build parameter. index_query_params(dict): index query parameters. database (str) : Database name to find the table. Defaults to ‘default’. table (str) : Table name to operate on.

Defaults to ‘vector_table’.

metric (str)Metric to compute distance,

supported are (‘angular’, ‘euclidean’, ‘manhattan’, ‘hamming’, ‘dot’). Defaults to ‘angular’. https://github.com/spotify/annoy/blob/main/src/annoymodule.cc#L149-L169

column_map (Dict)Column type map to project column name onto langchain

semantics. Must have keys: text, id, vector, must be same size to number of columns. For example: .. code-block:: python

{

‘id’: ‘text_id’, ‘uuid’: ‘global_unique_id’ ‘embedding’: ‘text_embedding’, ‘document’: ‘text_plain’, ‘metadata’: ‘metadata_dictionary_in_json’,

}

Defaults to identity map.

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

param column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'}¶
param database: str = 'default'¶
param host: str = 'localhost'¶
param index_param: Optional[Union[List, Dict]] = ["'L2Distance'", 100]¶
param index_query_params: Dict[str, str] = {}¶
param index_type: str = 'annoy'¶
param metric: str = 'angular'¶
param password: Optional[str] = None¶
param port: int = 8123¶
param table: str = 'langchain'¶
param username: Optional[str] = None¶
model Config[source]¶

Bases: object

env_file = '.env'¶
env_file_encoding = 'utf-8'¶
env_prefix = 'clickhouse_'¶

Examples using ClickhouseSettings¶