Skip to content

Commit

Permalink
fix: pydantic error
Browse files Browse the repository at this point in the history
  • Loading branch information
elisalimli committed Apr 26, 2024
1 parent 371f171 commit 12d72f2
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions models/query.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pydantic import BaseModel
from pydantic import BaseModel, RootModel
from typing import List, Optional, Union, Any

from models.document import BaseDocumentChunk
Expand All @@ -7,26 +7,7 @@
from qdrant_client.http.models import Filter as QdrantFilter


class PineconeFilter(BaseModel):
__root__: dict[str, Union[str, float, int, bool, List, dict]]


class AstraFilter(BaseModel):
__root__: dict[str, Any]


class WeaviateFilter(BaseModel):
__root__: dict


class PgVectorFilter(BaseModel):
__root__: dict


class Filter(BaseModel):
__root__: Union[
PineconeFilter, QdrantFilter, WeaviateFilter, AstraFilter, PgVectorFilter
]
Filter = Union[QdrantFilter, dict]


class RequestPayload(BaseModel):
Expand Down

0 comments on commit 12d72f2

Please sign in to comment.