now.executor.gateway.bff.app.v1.models.search module#

class now.executor.gateway.bff.app.v1.models.search.IndexRequestModel(**data)[source]#

Bases: BaseRequestModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

data: List[Tuple[Dict[str, ModalityModel], Dict[str, Any]]]#
class now.executor.gateway.bff.app.v1.models.search.SearchRequestModel(**data)[source]#

Bases: BaseRequestModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

limit: int#
filters: Optional[Dict[str, Union[List, Dict[str, Union[int, float]]]]]#
query: List[Dict]#
score_calculation: List[List]#
get_score_breakdown: bool#
class now.executor.gateway.bff.app.v1.models.search.SearchResponseModel(id, scores={}, tags={}, fields={})[source]#

Bases: BaseModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

id: str#
scores: Optional[Dict[str, _NamedScore]]#
fields: Dict[str, ModalityModel]#
tags: Optional[Dict[str, Union[str, bool, float, None, List[Optional[Union[str, bool, float]]], Dict[str, Optional[Union[str, bool, float]]]]]]#
validate_tags(tags)[source]#
to_html(disable_to_datauri=False)[source]#

Converts the SearchResponseModel to HTML. This is used to display the a single multi-modal result as HTML.

Parameters

disable_to_datauri (bool) – If True, the image is not converted to datauri.

Return type

str

classmethod responses_to_html(responses, disable_to_datauri=False)[source]#

Converts a list of SearchResponseModel to HTML. This is used to display the multi-modal results as HTML.

Return type

str

class Config[source]#

Bases: object

case_sensitive = False#
arbitrary_types_allowed = True#
class now.executor.gateway.bff.app.v1.models.search.SuggestionRequestModel(**data)[source]#

Bases: BaseRequestModel

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

text: Optional[str]#