11from typing import TypedDict
2+ from abc import abstractmethod
23from pydantic import BaseModel , SecretStr
4+
35from ..api import DBConfig , DBCaseConfig , MetricType , IndexType
46
57
@@ -53,6 +55,9 @@ def parse_metric_str(self) -> str:
5355 elif self .metric_type == MetricType .COSINE :
5456 return "cosineDistance"
5557
58+ @abstractmethod
59+ def session_param (self ):
60+ pass
5661
5762class ClickhouseHNSWConfig (ClickhouseIndexConfig ):
5863 M : int | None # Default in clickhouse in 32
@@ -64,7 +69,6 @@ class ClickhouseHNSWConfig(ClickhouseIndexConfig):
6469 granularity : int | None = 10_000_000 # Size of the index granules. By default, in CH it's equal 10.000.000
6570
6671 def index_param (self ) -> dict :
67- print (self .M , self .efConstruction )
6872 return {
6973 "vector_data_type" : self .vector_data_type ,
7074 "metric_type" : self .parse_metric_str (),
@@ -79,4 +83,8 @@ def search_param(self) -> dict:
7983 "metric_type" : self .parse_metric_str (),
8084 "params" : {"ef" : self .ef },
8185 }
86+ def session_param (self ) -> dict :
87+ return {
88+ 'allow_experimental_vector_similarity_index' : 1 ,
89+ }
8290
0 commit comments