Etape 2 fini
This commit is contained in:
@@ -65,13 +65,18 @@ async def on_message(message: cl.Message):
|
||||
|
||||
summary+= f"- **Nom du projet** : {spec.get('title')}\n"
|
||||
summary+= f"- **Description** : {spec.get('description')}\n"
|
||||
summary+= f"- **Actions** : {', '.join(spec.get('requirements', []))}\n"
|
||||
summary+= f"- **Contraintes** : {', '.join(spec.get('constraints', []))}\n"
|
||||
summary += "- **Actions** :\n"
|
||||
summary += "\n".join(
|
||||
f" - {req}" for req in spec.get("requirements", [])
|
||||
) + "\n"
|
||||
summary += "- **Contraintes** :\n"
|
||||
summary += "\n".join(
|
||||
f" - {constraint}" for constraint in spec.get("constraints", [])
|
||||
) + "\n"
|
||||
summary+= f"- **Langage** : {spec.get('language')}\n"
|
||||
|
||||
summary += "\n**Est-ce que cela vous convient ?**"
|
||||
|
||||
# Ajout des boutons de décision
|
||||
res = await cl.AskActionMessage(
|
||||
content=summary,
|
||||
actions=[
|
||||
@@ -90,11 +95,9 @@ async def on_message(message: cl.Message):
|
||||
if res and res.get("name") == "oui":
|
||||
await cl.Message(content="🚀 **Spécifications validées !** Lancement de la génération du code...").send()
|
||||
|
||||
# On passe le statut attendu par ton graphe
|
||||
new_state["status"] = "spec_approved"
|
||||
cl.user_session.set("graph_state", new_state)
|
||||
|
||||
# On relance immédiatement le workflow pour exécuter la suite (dev, qa...)
|
||||
async with httpx.AsyncClient() as client:
|
||||
response = await client.post(
|
||||
"http://127.0.0.1:8000/api/workflow/run",
|
||||
@@ -109,7 +112,6 @@ async def on_message(message: cl.Message):
|
||||
).send()
|
||||
|
||||
else:
|
||||
# Si "non" (ou si le choix a expiré)
|
||||
new_state["status"] = "spec_incomplete"
|
||||
cl.user_session.set("graph_state", new_state)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user