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

feat: Qdrant enhancement #1049

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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 camel/storages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
VectorRecord,
)
from .vectordb_storages.milvus import MilvusStorage
from .vectordb_storages.qdrant import QdrantStorage
from .vectordb_storages.qdrant import QdrantManager, QdrantStorage

__all__ = [
'BaseKeyValueStorage',
Expand All @@ -37,6 +37,7 @@
'BaseVectorStorage',
'VectorDBQuery',
'VectorDBQueryResult',
'QdrantManager',
'QdrantStorage',
'MilvusStorage',
'BaseGraphStorage',
Expand Down
3 changes: 2 additions & 1 deletion camel/storages/vectordb_storages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@
VectorRecord,
)
from .milvus import MilvusStorage
from .qdrant import QdrantStorage
from .qdrant import QdrantManager, QdrantStorage

__all__ = [
'BaseVectorStorage',
'VectorDBQuery',
'VectorDBQueryResult',
'QdrantManager',
'QdrantStorage',
'MilvusStorage',
'VectorRecord',
Expand Down
10 changes: 9 additions & 1 deletion camel/storages/vectordb_storages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class VectorRecord(BaseModel):
Attributes:
vector (List[float]): The numerical representation of the vector.
id (str, optional): A unique identifier for the vector. If not
provided, an random uuid will be assigned.
provided, a random uuid will be assigned.
payload (Optional[Dict[str, Any]], optional): Any additional metadata
or information related to the vector. (default: :obj:`None`)
"""
Expand All @@ -45,12 +45,17 @@ class VectorDBQuery(BaseModel):
vector.
top_k (int, optional): The number of top similar vectors to retrieve
from the database. (default: :obj:`1`)
filter (Optional[Dict[str, Any]], optional): A filter for narrowing
down the search based on specific conditions. (default:
:obj:`None`)
"""

query_vector: List[float]
"""The numerical representation of the query vector."""
top_k: int = 1
"""The number of top similar vectors to retrieve from the database."""
filter: Optional[Dict[str, Any]] = None
"""A filter for narrowing down the search based on specific conditions."""

def __init__(
self, query_vector: List[float], top_k: int, **kwargs: Any
Expand All @@ -61,6 +66,9 @@ def __init__(
query vector.
top_k (int, optional): The number of top similar vectors to
retrieve from the database. (default: :obj:`1`)
filter (Optional[Dict[str, Any]], optional): A filter for narrowing
down the search based on specific conditions. (default:
:obj:`None`)
"""
super().__init__(query_vector=query_vector, top_k=top_k, **kwargs)

Expand Down
Loading