File size: 732 Bytes
b6154b2
 
 
 
 
 
 
 
 
 
 
 
 
9218640
 
b6154b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
32
33
34
35
36
37
38
from __future__ import annotations

from pydantic import BaseModel, Field


class ProductCreate(BaseModel):
    producto: str
    precio: float = Field(ge=0)
    cantidad: float = Field(gt=0)
    unidad: str = "unidad"
    fechaCaducidad: str
    fechaIngreso: str
    fechaProduccion: str
    categoria: str = ""
    caducidadEstimada: bool = False
    notas: str = ""
    fuente: str = "web"


class ConsumptionCreate(BaseModel):
    producto: str
    cantidad: float = Field(gt=0)
    unidad: str = "unidad"
    notas: str = ""
    fuente: str = "telegram-consumo"


class SearchRequest(BaseModel):
    question: str


class DiagramRequest(BaseModel):
    instruction: str


class TextExtractionRequest(BaseModel):
    text: str