mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-24 04:36:23 +00:00
chore:fmt
This commit is contained in:
parent
5d67f166d9
commit
2fad7485fc
@ -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
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user