Initial commit
This commit is contained in:
27
app/models.py
Normal file
27
app/models.py
Normal file
@@ -0,0 +1,27 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
class StoreCreate(BaseModel):
|
||||
name: str = Field(..., min_length=1, max_length=255)
|
||||
|
||||
class StoreResponse(BaseModel):
|
||||
store_id: UUID
|
||||
name: str
|
||||
|
||||
class UpsertRequest(BaseModel):
|
||||
store_id: UUID
|
||||
texts: list[str] = Field(..., min_length=1)
|
||||
metadata: list[dict] = []
|
||||
|
||||
class QueryRequest(BaseModel):
|
||||
store_id: UUID
|
||||
query: str = Field(..., min_length=1)
|
||||
top_k: int = Field(default=5, ge=1, le=50)
|
||||
filter: Optional[dict] = None
|
||||
|
||||
class QueryResult(BaseModel):
|
||||
id: UUID
|
||||
content: str
|
||||
metadata: dict
|
||||
similarity: float
|
||||
Reference in New Issue
Block a user