Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,17 @@ from streamlit_chat import message
|
|
| 21 |
from streamlit_option_menu import option_menu
|
| 22 |
import json
|
| 23 |
import streamlit.components.v1 as components
|
| 24 |
-
from pydantic import BaseModel,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
with st.sidebar:
|
| 26 |
sidebar_selection = option_menu(" Menu", ['Question Answering','json' ],
|
| 27 |
icons=['bi bi-patch-question-fill','bi bi-filetype-json'], menu_icon="cast", default_index=1)
|
|
|
|
| 21 |
from streamlit_option_menu import option_menu
|
| 22 |
import json
|
| 23 |
import streamlit.components.v1 as components
|
| 24 |
+
from pydantic import BaseModel, model_validator
|
| 25 |
+
|
| 26 |
+
class VotreModele(BaseModel):
|
| 27 |
+
champ1: str
|
| 28 |
+
champ2: int
|
| 29 |
+
|
| 30 |
+
@model_validator(pre=False, skip_on_failure=True)
|
| 31 |
+
def validate_something(cls, values):
|
| 32 |
+
# Votre logique de validation ici
|
| 33 |
+
return values
|
| 34 |
+
|
| 35 |
with st.sidebar:
|
| 36 |
sidebar_selection = option_menu(" Menu", ['Question Answering','json' ],
|
| 37 |
icons=['bi bi-patch-question-fill','bi bi-filetype-json'], menu_icon="cast", default_index=1)
|