Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'修改SupportedVSType类为枚举类' #4055

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion server/knowledge_base/kb_service/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import numpy as np
from langchain.embeddings.base import Embeddings
from langchain.docstore.document import Document
from enum import Enum

from server.db.repository.knowledge_base_repository import (
add_kb_to_db, delete_kb_from_db, list_kbs_from_db, kb_exists,
Expand Down Expand Up @@ -40,7 +41,7 @@ def normalize(embeddings: List[List[float]]) -> np.ndarray:
return np.divide(embeddings, norm)


class SupportedVSType:
class SupportedVSType(Enum):
FAISS = 'faiss'
MILVUS = 'milvus'
DEFAULT = 'default'
Expand Down