embedding-server / app /models /request_models.py
Faysal4200's picture
Upload 45 files
ec855e6 verified
Raw
History Blame Contribute Delete
603 Bytes
# 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"]]
)