run dev/reformat

pull/18613/head
jiangzhijie 1 year ago
parent e581c8b70a
commit e6c5d95f39

@ -32,8 +32,4 @@ class LindormConfig(BaseSettings):
description="Using UGC index will store the same type of Index in a single index but can retrieve separately.", description="Using UGC index will store the same type of Index in a single index but can retrieve separately.",
default=False, default=False,
) )
QUERY_TIMEOUT: Optional[float] = Field( QUERY_TIMEOUT: Optional[float] = Field(description="The lindorm search request timeout (s)", default=2.0)
description="The lindorm search request timeout (s)",
default=2.0
)

@ -254,7 +254,7 @@ class LindormVectorStore(BaseVector):
try: try:
params = {"timeout": self._client_config.request_timeout} params = {"timeout": self._client_config.request_timeout}
if self._using_ugc: if self._using_ugc:
params["routing"] = self._routing params["routing"] = self._routing # type: ignore
response = self._client.search(index=self._collection_name, body=query, params=params) response = self._client.search(index=self._collection_name, body=query, params=params)
except Exception: except Exception:
logger.exception(f"Error executing vector search, query: {query}") logger.exception(f"Error executing vector search, query: {query}")
@ -555,7 +555,7 @@ class LindormVectorStoreFactory(AbstractVectorFactory):
username=dify_config.LINDORM_USERNAME, username=dify_config.LINDORM_USERNAME,
password=dify_config.LINDORM_PASSWORD, password=dify_config.LINDORM_PASSWORD,
using_ugc=dify_config.USING_UGC_INDEX, using_ugc=dify_config.USING_UGC_INDEX,
request_timeout=dify_config.QUERY_TIMEOUT request_timeout=dify_config.QUERY_TIMEOUT,
) )
using_ugc = dify_config.USING_UGC_INDEX using_ugc = dify_config.USING_UGC_INDEX
if using_ugc is None: if using_ugc is None:

Loading…
Cancel
Save