File size: 1,028 Bytes
21db53c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
27
28
29
30
31
from enum import Enum

from pydantic import BaseModel, Field


class SearchBasisEnum(str, Enum):
    vision = "vision"
    ocr = "ocr"


class SearchModelEnum(str, Enum):
    average = "average"
    best = "best"


class AdvancedSearchModel(BaseModel):
    criteria: list[str] = Field([],
                                description="The positive criteria you want to search with",
                                max_length=16,
                                min_length=1)
    negative_criteria: list[str] = Field([],
                                         description="The negative criteria you want to search with",
                                         max_length=16)
    mode: SearchModelEnum = Field(SearchModelEnum.average,
                                  description="The mode you want to use to combine the criteria.")


class CombinedSearchModel(AdvancedSearchModel):
    extra_prompt: str = Field(max_length=100,
                              description="The secondary prompt used for filtering the image.")