mirror of
https://github.com/open-webui/open-webui
synced 2024-11-07 17:19:53 +00:00
40 lines
914 B
Python
40 lines
914 B
Python
from pymilvus import MilvusClient as Milvus
|
|
|
|
from typing import Optional
|
|
|
|
from open_webui.apps.rag.vector.main import VectorItem, QueryResult
|
|
|
|
|
|
class MilvusClient:
|
|
def __init__(self):
|
|
self.client = Milvus()
|
|
|
|
def list_collections(self) -> list[str]:
|
|
pass
|
|
|
|
def create_collection(self, collection_name: str):
|
|
pass
|
|
|
|
def delete_collection(self, collection_name: str):
|
|
pass
|
|
|
|
def search(
|
|
self, collection_name: str, vectors: list[list[float | int]], limit: int
|
|
) -> Optional[QueryResult]:
|
|
pass
|
|
|
|
def get(self, collection_name: str) -> Optional[QueryResult]:
|
|
pass
|
|
|
|
def insert(self, collection_name: str, items: list[VectorItem]):
|
|
pass
|
|
|
|
def upsert(self, collection_name: str, items: list[VectorItem]):
|
|
pass
|
|
|
|
def delete(self, collection_name: str, ids: list[str]):
|
|
pass
|
|
|
|
def reset(self):
|
|
pass
|