| | import gradio as gr |
| | import json |
| |
|
| | def analyse_prompt(prompt): |
| | |
| | |
| | articles = [ |
| | {"code": "A1001", "description": "Tôle acier S235 1mm", "quantite": 10, "source": "stock principal"}, |
| | {"code": "B2002", "description": "Ecrou M8 A4", "quantite": 50, "source": "fournisseur X"} |
| | ] |
| | destinataire = { |
| | "societe": "Société Exemple", |
| | "nom": "Dupont", |
| | "prenom": "Jean", |
| | "email": "jean.dupont@exemple.com" |
| | } |
| | delai = "2024-07-15" |
| | |
| | data = { |
| | "articles": articles, |
| | "destinataire": destinataire, |
| | "delai": delai |
| | } |
| | return json.dumps(data, indent=2, ensure_ascii=False) |
| |
|
| | def greet(name): |
| | return "Hello " + name + "!!" |
| |
|
| | demo = gr.Interface(fn=analyse_prompt, inputs="text", outputs="text") |
| |
|
| | if __name__ == "__main__": |
| | demo.launch(share=True) |
| |
|