Spaces:
Sleeping
Sleeping
| # app/models/request_models.py | |
| """ | |
| Pydantic request models for the API endpoints. | |
| """ | |
| from typing import List | |
| from pydantic import BaseModel, Field | |
| class SingleRequest(BaseModel): | |
| text: str = Field( | |
| ..., | |
| description="The text content to be embedded.", | |
| min_length=1, | |
| examples=["Hello, this is a test sentence."] | |
| ) | |
| class BatchRequest(BaseModel): | |
| texts: List[str] = Field( | |
| ..., | |
| description="List of text strings to embed.", | |
| min_items=1, | |
| examples=[["Hello world", "This is another sentence"]] | |
| ) | |