📝 doc pydantic character builder
This commit is contained in:
@@ -72,3 +72,31 @@ Pour exécuter ce projet, vous aurez besoin de Python 3.7 ou supérieur.
|
||||
```bash
|
||||
python3 app.py
|
||||
```
|
||||
|
||||
## Personnalisation du CharacterBuilder
|
||||
|
||||
Le `CharacterBuilder` peut être personnalisé pour utiliser différentes implémentations de sauvegarde et de chargement selon vos besoins.
|
||||
Cette personnalisation se fait simplement en définissant une variable d'environnement avant de lancer votre script Python.
|
||||
|
||||
### Variable d'environnement : `ELIRON_BUILDER`
|
||||
|
||||
- **Nom** : `ELIRON_BUILDER`
|
||||
- **Valeur possible** :
|
||||
- `"pydantic"` : Utilise des implementations basées sur `pydantic`.
|
||||
- Toute autre valeur ou absence de variable : Utilise les fonctions par défaut.
|
||||
|
||||
> ⚠️ **Important** : Pour utiliser le builder pydantic, vous devez avoir installé le package `pydantic` au préalable :
|
||||
> ```bash
|
||||
> pip install pydantic
|
||||
> ```
|
||||
|
||||
### Exemple d'utilisation sous Linux / macOS
|
||||
|
||||
```bash
|
||||
# Pour utiliser l'implémentation pydantic
|
||||
export ELIRON_BUILDER=pydantic
|
||||
python app.py
|
||||
|
||||
# Pour utiliser l'implémentation par defaut
|
||||
unset ELIRON_BUILDER
|
||||
python app.py
|
||||
|
||||
Reference in New Issue
Block a user