File size: 603 Bytes
ec855e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# 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"]]
    )