diff --git a/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/elastic_store.py b/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/elastic_store.py index 0930e93ef..8530fe2d9 100644 --- a/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/elastic_store.py +++ b/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/elastic_store.py @@ -5,7 +5,7 @@ from __future__ import annotations import logging import os from dataclasses import dataclass, field -from typing import List, Optional, Any +from typing import Any, List, Optional from dbgpt.core import Chunk, Embeddings from dbgpt.core.awel.flow import Parameter, ResourceCategory, register_resource diff --git a/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/milvus_store.py b/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/milvus_store.py index 2fd992ed4..30eb2c4b6 100644 --- a/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/milvus_store.py +++ b/packages/dbgpt-ext/src/dbgpt_ext/storage/vector_store/milvus_store.py @@ -288,11 +288,11 @@ class MilvusStore(VectorStoreBase): def create_collection(self, collection_name: str, **kwargs) -> Any: """Create a Milvus collection. - Create a Milvus collection, indexes it with HNSW, load document - Args: - collection_name (str): your collection name. - Returns: - List[str]: document ids. + Create a Milvus collection, indexes it with HNSW, load document + Args: + collection_name (str): your collection name. + Returns: + List[str]: document ids. """ try: from pymilvus import ( @@ -365,12 +365,7 @@ class MilvusStore(VectorStoreBase): """ try: from pymilvus import ( - Collection, - CollectionSchema, DataType, - FieldSchema, - connections, - utility, ) from pymilvus.orm.types import infer_dtype_bydata # noqa: F401 except ImportError: @@ -387,10 +382,7 @@ class MilvusStore(VectorStoreBase): self.fields.remove(x.name) if x.is_primary: self.primary_field = x.name - if ( - x.dtype == DataType.FLOAT_VECTOR - or x.dtype == DataType.BINARY_VECTOR - ): + if x.dtype == DataType.FLOAT_VECTOR or x.dtype == DataType.BINARY_VECTOR: self.vector_field = x.name return self._add_documents(texts, metadatas)