open-webui/backend/open_webui/apps/rag/vector/main.py

17 lines
373 B
Python
Raw Normal View History

2024-09-10 03:37:06 +00:00
from pydantic import BaseModel
from typing import Optional, List, Any
class VectorItem(BaseModel):
id: str
text: str
vector: List[float | int]
metadata: Any
class QueryResult(BaseModel):
ids: Optional[List[List[str]]]
distances: Optional[List[List[float | int]]]
documents: Optional[List[List[str]]]
metadatas: Optional[List[List[Any]]]