frontend añadido y backend de creacion de notas
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from typing import Optional, List, Dict
|
||||
|
||||
|
||||
# ---------------------
|
||||
# Base
|
||||
# ---------------------
|
||||
class NotaBase(BaseModel):
|
||||
titulo: str = Field(..., description="Título de la nota")
|
||||
contenido: str = Field(..., description="Contenido de la nota")
|
||||
tags: Optional[Dict] = Field(None, description="Tags de la nota")
|
||||
relaciones: Optional[Dict] = Field(None, description="Relaciones")
|
||||
propiedades: Optional[Dict] = Field(None, description="Propiedades adicionales")
|
||||
|
||||
|
||||
# ---------------------
|
||||
# Create & Update
|
||||
# ---------------------
|
||||
class NotaCreate(NotaBase):
|
||||
pass
|
||||
|
||||
|
||||
class NotaUpdate(BaseModel):
|
||||
contenido: Optional[str]
|
||||
tags: Optional[Dict]
|
||||
relaciones: Optional[Dict]
|
||||
propiedades: Optional[Dict]
|
||||
|
||||
|
||||
# ---------------------
|
||||
# Response
|
||||
# ---------------------
|
||||
class NotaOut(NotaBase):
|
||||
id: str
|
||||
embedder: List[float] = Field(..., description="Vector embedding de la nota")
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
# ---------------------
|
||||
# Search Inputs
|
||||
# ---------------------
|
||||
class SearchQuery(BaseModel):
|
||||
texto: str
|
||||
top_k: int = 5
|
||||
|
||||
|
||||
class HybridSearchQuery(BaseModel):
|
||||
texto: str
|
||||
tags: Optional[Dict] = None
|
||||
top_k: int = 5
|
||||
Reference in New Issue
Block a user