Source code for deployment.bff.app.v1.models.text

from typing import List, Optional

from pydantic import Field

from deployment.bff.app.v1.models.helper import (
    BaseIndexRequestModel,
    BaseSearchRequestModel,
    BaseSearchResponseModel,
)


# Request Model
[docs]class NowTextIndexRequestModel(BaseIndexRequestModel): texts: Optional[List[str]] = Field( default=..., description='List of Texts to index.' )
[docs]class NowTextSearchRequestModel(BaseSearchRequestModel): text: Optional[str] = Field(default=None, description='Text query')
# Response Model
[docs]class NowTextResponseModel(BaseSearchResponseModel): text: Optional[str] = Field(description='Matching text result.', default='')
NowTextResponseModel.update_forward_refs()